public void AddIngredient(IngredientModel ingredientModel) { Ingredient objIngredient = new Ingredient() { IngredientId = ingredientModel.IngredientId, Name = ingredientModel.Name, Category = ingredientModel.Category, //Type = ingredientModel.Type, OperatorId = ingredientModel.OperatorId, OperatorLocationId = ingredientModel.OperatorLocationId, CommercialIngredientId = ingredientModel.CommercialIngredientId, ProductionTimeHours = ingredientModel.ProductionTimeHours, ProductionTimeDays = ingredientModel.ProductionTimeDays, ProductionTimeMonths = ingredientModel.ProductionTimeMonths, PerishabilityIndexHours = ingredientModel.PerishabilityIndexHours, PerishabilityIndexDays = ingredientModel.PerishabilityIndexDays, PerishabilityIndexMonths = ingredientModel.PerishabilityIndexMonths, StorageCapacityInLiquid = ingredientModel.StorageCapacityInLiquid, StorageCapacityInVolume = ingredientModel.StorageCapacityInVolume, StorageUsedCapacityLiquid = ingredientModel.StorageUsedCapacityLiquid, StorageUsedCapacityVolume = ingredientModel.StorageUsedCapacityVolume, CurrentPrice = ingredientModel.CurrentPrice, LastCost = ingredientModel.LastCost, date_creation = ingredientModel.date_creation, created_by = ingredientModel.created_by, modified_by = ingredientModel.modified_by, date_modified = ingredientModel.date_modified }; db.Ingredients.Add(objIngredient); db.SaveChanges(); }
public void AddModifier(ModifierModel modifierModel) { Modifier objModifier = new Modifier() { ModifierId = modifierModel.ModifierId, RecipeId = modifierModel.RecipeId, IngredientId = modifierModel.IngredientId, Quantity = modifierModel.Quantity, UnitType = modifierModel.UnitType, //OrderType = modifierModel.OrderType, CurrentPrice = modifierModel.CurrentPrice, LastCost = modifierModel.LastCost, date_creation = modifierModel.date_creation, created_by = modifierModel.created_by, modified_by = modifierModel.modified_by, date_modified = modifierModel.date_modified }; db.Modifiers.Add(objModifier); db.SaveChanges(); }
public void AddRecipe(RecipeModel recipeModel) { Recipe objRecipe = new Recipe() { RecipeId = recipeModel.RecipeId, ProductName = recipeModel.ProductName, Variation = recipeModel.Variation, CurrentPrice = recipeModel.CurrentPrice, LastCost = recipeModel.LastCost, Description = recipeModel.Description, StandardRecipeId = recipeModel.StandardRecipeId, OperatorId = recipeModel.OperatorId, OperatorLocationId = recipeModel.OperatorLocationId, date_creation = recipeModel.date_creation, created_by = recipeModel.created_by, modified_by = recipeModel.modified_by, date_modified = recipeModel.date_modified }; db.Recipes.Add(objRecipe); db.SaveChanges(); }
public void Save() { db.SaveChanges(); }