diff --git a/Models/DyelotsBulkedRecipeProvider.cs b/Models/DyelotsBulkedRecipeProvider.cs index 7b3c931..35370f1 100644 --- a/Models/DyelotsBulkedRecipeProvider.cs +++ b/Models/DyelotsBulkedRecipeProvider.cs @@ -25,11 +25,16 @@ namespace Models throw new NotImplementedException(); } + public List Selectsql(DyelotsBulkedRecipe t) + { + string sqlselect = "select * from DyelotsBulkedRecipe Where Dyelot = "+"'"+ t.Dyelot.ToString()+"'"; + return db.DyelotsBulkedRecipe.SqlQuery(sqlselect).ToList();//查询前100条 + } + public List Select() { return db.DyelotsBulkedRecipe.SqlQuery("select TOP (100) * from DyelotsBulkedRecipe").ToList();//查询前100条 } - public int Update(DyelotsBulkedRecipe t) { throw new NotImplementedException(); diff --git a/Models/DyelotsProvider.cs b/Models/DyelotsProvider.cs index ad02600..3883c90 100644 --- a/Models/DyelotsProvider.cs +++ b/Models/DyelotsProvider.cs @@ -32,9 +32,29 @@ namespace Models public List Select() { - return db.Dyelots.SqlQuery("select TOP (100) * from Dyelots").ToList();//查询前100条 + string sqlselect= "select TOP (300) * from Dyelots Where CreationTime > '" + DateTime.Now.ToString("yyyy-MM-dd") + "'"; + return db.Dyelots.SqlQuery(sqlselect).ToList(); } + public List Selectsql(Dyelots t) + { + string sqlselect = "select * from Dyelots Where Dyelot = " + "'" + t.Dyelot.ToString() + "'"; + return db.Dyelots.SqlQuery(sqlselect).ToList(); + } + + public List Selecttime(Dyelots t) + { + string sqlselect = "select * from Dyelots Where CreationTime < " + "'" + t.EndTime.ToString() + + "' and CreationTime > '" + t.StartTime.ToString() + "'"; + return db.Dyelots.SqlQuery(sqlselect).ToList(); + } + + public List SelectMachine(Dyelots t) + { + string sqlselect = "select * from Dyelots Where CreationTime < " + "'" + t.EndTime.ToString() + + "' and CreationTime > '" + t.StartTime.ToString() + "' and Machine = '" + t.Machine.ToString() + "'"; + return db.Dyelots.SqlQuery(sqlselect).ToList(); + } public int Update(Dyelots t) { throw new NotImplementedException(); diff --git a/Models/IProvider.cs b/Models/IProvider.cs index 010dc49..413cde4 100644 --- a/Models/IProvider.cs +++ b/Models/IProvider.cs @@ -23,7 +23,7 @@ namespace Models /// /// /// - //int Select(T t); + List Selectsql(T t); /// /// 插入一条记录 diff --git a/Models/MachinesProvider.cs b/Models/MachinesProvider.cs index 837b115..543d20f 100644 --- a/Models/MachinesProvider.cs +++ b/Models/MachinesProvider.cs @@ -25,6 +25,10 @@ namespace Models throw new NotImplementedException(); } + public List Selectsql(Machines t) + { + throw new NotImplementedException(); + } public int Update(Machines t) { throw new NotImplementedException(); diff --git a/Models/ProductProvider.cs b/Models/ProductProvider.cs index 3c69ce4..944bc3b 100644 --- a/Models/ProductProvider.cs +++ b/Models/ProductProvider.cs @@ -46,6 +46,11 @@ namespace Models { return db.Product.SqlQuery("select * from Product where ProductType = 2").ToList();//查询 } + + public List Selectsql(Product t) + { + throw new NotImplementedException(); + } public int Update(Product t) { throw new NotImplementedException(); diff --git a/Models/UserAccountProvide.cs b/Models/UserAccountProvide.cs index f986dd4..7c7f42c 100644 --- a/Models/UserAccountProvide.cs +++ b/Models/UserAccountProvide.cs @@ -25,6 +25,10 @@ namespace Models return db.UserAccount.ToList(); } + public List Selectsql(UserAccount t) + { + throw new NotImplementedException(); + } public int Update(UserAccount t) { throw new NotImplementedException(); diff --git a/View/QueryView.xaml b/View/QueryView.xaml index adaa936..c4d1743 100644 --- a/View/QueryView.xaml +++ b/View/QueryView.xaml @@ -99,7 +99,7 @@ - +