Beispiel #1
0
 public void SaveClassification(Classification classification)
 {
     using (var dbContext = new BasisDataDbContext())
     {
         if (classification.ID > 0)
         {
             dbContext.Update <Classification>(classification);
         }
         else
         {
             dbContext.Insert <Classification>(classification);
         }
     }
 }
Beispiel #2
0
 public void SaveSupplier(Supplier supplier)
 {
     using (var dbContext = new BasisDataDbContext())
     {
         if (supplier.ID > 0)
         {
             dbContext.Update <Supplier>(supplier);
         }
         else
         {
             dbContext.Insert <Supplier>(supplier);
         }
     }
 }
Beispiel #3
0
 public void SaveMaterial(Material material)
 {
     using (var dbContext = new BasisDataDbContext())
     {
         if (material.ID > 0)
         {
             dbContext.Update <Material>(material);
         }
         else
         {
             dbContext.Insert <Material>(material);
         }
     }
 }
Beispiel #4
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);
         }
     }
 }