Merge branch 'master' of http://192.168.0.12:13000/sc/Audit_APP
This commit is contained in:
commit
06a4257126
6 files changed
+131
-11
No files matched your search
@@ -8,19 +8,29 @@ namespace Models
|
||||
{
|
||||
public class ProductProvider : IProvider<Product>
|
||||
{
|
||||
private readonly TicketEntities db = new TicketEntities();
|
||||
public int Delete(Product t)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
if (t == null) return 0;
|
||||
var model = db.Product.ToList().FirstOrDefault(item => t.ProductCode == item.ProductCode);
|
||||
if (model == null) return 0;
|
||||
db.Product.Remove(model);
|
||||
int count = db.SaveChanges();
|
||||
return count;
|
||||
}
|
||||
|
||||
public int Insert(Product t)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
if (t == null) return 0;
|
||||
if (String.IsNullOrEmpty(t.ProductCode)) return 0;
|
||||
db.Product.Add(t);
|
||||
int count = db.SaveChanges();
|
||||
return count;
|
||||
}
|
||||
|
||||
public List<Product> Select()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
return db.Product.SqlQuery("select * from Product").ToList();//查询
|
||||
}
|
||||
|
||||
public int Update(Product t)
|
||||
|
||||
Reference in new issue
Block a user