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