This commit is contained in:
sc committed 2022-02-09 14:02:14 +08:00
commit 3323285542
6 files changed
+52 -9

No files matched your search

+2
View File
@@ -8,6 +8,8 @@ namespace Models
{
public class DyelotsBulkedRecipeProvider : IProvider<DyelotsBulkedRecipe>
{
private BatchDyeingCentralEntities db = new BatchDyeingCentralEntities();
public int Delete(DyelotsBulkedRecipe t)
{
throw new NotImplementedException();
+15 -3
View File
@@ -8,19 +8,31 @@ namespace Models
{
public class DyelotsProvider : IProvider<Dyelots>
{
private BatchDyeingCentralEntities db = new BatchDyeingCentralEntities();
public int Delete(Dyelots t)
{
throw new NotImplementedException();
if (t == null) return 0;
var model = db.Dyelots.ToList().FirstOrDefault(item => t.Dyelot == item.Dyelot);
if (model == null) return 0;
db.Dyelots.Remove(model);
int count = db.SaveChanges();
return count;
}
public int Insert(Dyelots t)
{
throw new NotImplementedException();
if (t == null) return 0;
if (String.IsNullOrEmpty(t.Dyelot)) return 0;
db.Dyelots.Add(t);
int count = db.SaveChanges();
return count;
}
public List<Dyelots> Select()
{
throw new NotImplementedException();
return db.Dyelots.ToList();
}
public int Update(Dyelots t)
+2
View File
@@ -8,6 +8,8 @@ namespace Models
{
public class MachinesProvider : IProvider<Machines>
{
private BatchDyeingCentralEntities db = new BatchDyeingCentralEntities();
public int Delete(Machines t)
{
throw new NotImplementedException();