This commit is contained in:
sc committed 2022-03-07 23:19:20 +08:00
commit 121ff87ef9
4 files changed
+40 -9

No files matched your search

+15 -2
View File
@@ -9,7 +9,7 @@ namespace Models
public class ProductProvider : IProvider<Product>
{
private readonly TicketEntities db = new TicketEntities();
public int Delete(Product t)
public int Delete(Product t)//删除
{
if (t == null) return 0;
var model = db.Product.ToList().FirstOrDefault(item => t.ProductCode == item.ProductCode);
@@ -19,7 +19,7 @@ namespace Models
return count;
}
public int Insert(Product t)
public int Insert(Product t)//插入
{
if (t == null) return 0;
if (String.IsNullOrEmpty(t.ProductCode)) return 0;
@@ -33,6 +33,19 @@ namespace Models
return db.Product.SqlQuery("select * from Product").ToList();//查询
}
public List<Product> Selects0()
{
return db.Product.SqlQuery("select * from Product where ProductType = 0").ToList();//查询
}
public List<Product> Selects1()
{
return db.Product.SqlQuery("select * from Product where ProductType = 1").ToList();//查询
}
public List<Product> Selects2()
{
return db.Product.SqlQuery("select * from Product where ProductType = 2").ToList();//查询
}
public int Update(Product t)
{
throw new NotImplementedException();