示例#1
0
 public void SaveMaterialSupplier(MaterialSupplier materialSupplier)
 {
     using (var dbContext = new BasisDataDbContext())
     {
         MaterialSupplier supplier = GetMaterialSupplier(materialSupplier.MaterialID, materialSupplier.SupplierID);
         if (supplier != null)
         {
             materialSupplier.ID = supplier.ID;
             dbContext.Update<MaterialSupplier>(materialSupplier);
         }
         else
         {
             dbContext.Insert<MaterialSupplier>(materialSupplier);
         }
     }
 }
示例#2
0
 public void SaveMaterial(Material material)
 {
     using (var dbContext = new BasisDataDbContext())
     {
         if (material.ID > 0)
         {
             dbContext.Update<Material>(material);
         }
         else
         {
             dbContext.Insert<Material>(material);
         }
     }
 }
示例#3
0
 public void SaveSupplier(Supplier supplier)
 {
     using (var dbContext = new BasisDataDbContext())
     {
         if (supplier.ID > 0)
         {
             dbContext.Update<Supplier>(supplier);
         }
         else
         {
             dbContext.Insert<Supplier>(supplier);
         }
     }
 }
示例#4
0
 public void SaveClassification(Classification classification)
 {
     using (var dbContext = new BasisDataDbContext())
     {
         if (classification.ID > 0)
         {
             dbContext.Update<Classification>(classification);
         }
         else
         {
             dbContext.Insert<Classification>(classification);
         }
     }
 }