public void Update(IngredientModel ingredientModel)
        {
            var Ingredient = db.Ingredients.Find(ingredientModel.IngredientId);

            Ingredient.IngredientId = ingredientModel.IngredientId;
            Ingredient.Name         = ingredientModel.Name;
            Ingredient.Category     = ingredientModel.Category;
            //Ingredient.Type = ingredientModel.Type;
            Ingredient.OperatorId                = ingredientModel.OperatorId;
            Ingredient.OperatorLocationId        = ingredientModel.OperatorLocationId;
            Ingredient.CommercialIngredientId    = ingredientModel.CommercialIngredientId;
            Ingredient.ProductionTimeHours       = ingredientModel.ProductionTimeHours;
            Ingredient.ProductionTimeDays        = ingredientModel.ProductionTimeDays;
            Ingredient.ProductionTimeMonths      = ingredientModel.ProductionTimeMonths;
            Ingredient.PerishabilityIndexHours   = ingredientModel.PerishabilityIndexHours;
            Ingredient.PerishabilityIndexDays    = ingredientModel.PerishabilityIndexDays;
            Ingredient.PerishabilityIndexMonths  = ingredientModel.PerishabilityIndexMonths;
            Ingredient.StorageCapacityInLiquid   = ingredientModel.StorageCapacityInLiquid;
            Ingredient.StorageCapacityInVolume   = ingredientModel.StorageCapacityInVolume;
            Ingredient.StorageUsedCapacityLiquid = ingredientModel.StorageUsedCapacityLiquid;
            Ingredient.StorageUsedCapacityVolume = ingredientModel.StorageUsedCapacityVolume;
            Ingredient.CurrentPrice              = ingredientModel.CurrentPrice;
            Ingredient.LastCost      = ingredientModel.LastCost;
            Ingredient.date_creation = ingredientModel.date_creation;
            Ingredient.created_by    = ingredientModel.created_by;
            Ingredient.modified_by   = ingredientModel.modified_by;
            Ingredient.date_modified = ingredientModel.date_modified;

            db.Ingredients.Add(Ingredient);
            db.Entry(Ingredient).State = EntityState.Modified;
            db.SaveChanges();
        }
        public void Update(RecipeModel recipeModel)
        {
            var objRecipe = db.Recipes.Find(recipeModel.RecipeId);

            objRecipe.ProductName        = recipeModel.ProductName;
            objRecipe.Variation          = recipeModel.Variation;
            objRecipe.CurrentPrice       = recipeModel.CurrentPrice;
            objRecipe.LastCost           = recipeModel.LastCost;
            objRecipe.Description        = recipeModel.Description;
            objRecipe.StandardRecipeId   = recipeModel.StandardRecipeId;
            objRecipe.OperatorId         = recipeModel.OperatorId;
            objRecipe.OperatorLocationId = recipeModel.OperatorLocationId;
            objRecipe.date_creation      = recipeModel.date_creation;
            objRecipe.created_by         = recipeModel.created_by;
            objRecipe.modified_by        = recipeModel.modified_by;
            objRecipe.date_modified      = recipeModel.date_modified;
            db.Recipes.Add(objRecipe);
            db.Entry(objRecipe).State = EntityState.Modified;
            db.SaveChanges();
        }
Beispiel #3
0
        public void Update(ModifierModel modifierModel)
        {
            var Modify = db.Modifiers.Find(modifierModel.ModifierId);

            Modify.ModifierId   = modifierModel.ModifierId;
            Modify.RecipeId     = modifierModel.RecipeId;
            Modify.IngredientId = modifierModel.IngredientId;
            Modify.Quantity     = modifierModel.Quantity;
            Modify.UnitType     = modifierModel.UnitType;
            //Modify.OrderType = modifierModel.OrderType;
            Modify.CurrentPrice  = modifierModel.CurrentPrice;
            Modify.LastCost      = modifierModel.LastCost;
            Modify.date_creation = modifierModel.date_creation;
            Modify.created_by    = modifierModel.created_by;
            Modify.modified_by   = modifierModel.modified_by;
            Modify.date_modified = modifierModel.date_modified;

            db.Modifiers.Add(Modify);
            db.Entry(Modify).State = EntityState.Modified;
            db.SaveChanges();
        }
 public void Update(Conversion conversion)
 {
     db.Entry(conversion).State = System.Data.Entity.EntityState.Modified;
     Save();
 }