public ActionResult Update(string key, List <spView_WebTemplate_ViralLoadReagentsGetAll_Result> changed, List <spView_WebTemplate_ViralLoadReagentsGetAll_Result> added, List <spView_WebTemplate_ViralLoadReagentsGetAll_Result> deleted) { Formulas formulas = new Formulas(); var order_no = TempData.Peek("OrderNumber").ToString(); OrderViralLoadReagentsModels obj = new OrderViralLoadReagentsModels(); ////Performing update operation if (changed != null && changed.Count() > 0) { foreach (var temp in changed) { obj.OrderNumber = order_no; //obj.StartDate = System.Convert.ToDateTime(temp.StartDate); //obj.EndDate = System.Convert.ToDateTime(temp.EndDate); //obj.FacilityCode = System.Convert.ToInt32(temp.FacilityCode); obj.ProductCode = System.Convert.ToInt32(temp.ProductCode); obj.OpeningBalance = temp.OpeningBalance; obj.QuantityRecieved = temp.QuantityRecieved; obj.Consumption = temp.Consumption; obj.LossesAndAdjustments = temp.LossesAndAdjustments; obj.TotalClosingBalance = temp.TotalClosingBalance; obj.QuantityOrdered = Convert.ToDouble(formulas.Allocated(temp.QuantityOrdered)); obj.QuantityAllocated = (formulas.Allocated(temp.QuantityOrdered)); obj.Comments = temp.Comment; obj.RFSONotes = temp.RFSONotes; obj.Update(); } } //var data = 0; return Json(data, JsonRequestBehavior.AllowGet); var data = 0; return(Json(data, JsonRequestBehavior.AllowGet)); }
public ActionResult UpdateCustom(string key, List <spView_WebTemplate_ViralLoadReagentsGetAll_Custom1_Result> changed, List <spView_WebTemplate_ViralLoadReagentsGetAll_Custom1_Result> added, List <spView_WebTemplate_ViralLoadReagentsGetAll_Custom1_Result> deleted) { var order_no = TempData.Peek("OrderNumber").ToString(); OrderViralLoadReagentsModels obj = new OrderViralLoadReagentsModels(); ////Performing update operation if (added != null && added.Count() > 0) { foreach (var temp in added) { obj.OrderNumber = order_no; obj.ProductCode = temp.product_code; obj.QuantityOrdered = temp.QuantityOrdered; obj.QuantityAllocated = System.Convert.ToInt32(temp.QuantityOrdered); obj.Comments = temp.Comment; obj.RFSONotes = temp.RFSONotes; obj.Update(); } } if (changed != null && changed.Count() > 0) { foreach (var temp in changed) { obj.OrderNumber = order_no; obj.ProductCode = temp.product_code; obj.QuantityOrdered = temp.QuantityOrdered; obj.QuantityAllocated = System.Convert.ToInt32(temp.QuantityOrdered); obj.Comments = temp.Comment; obj.RFSONotes = temp.RFSONotes; obj.Update(); } } //var data = 0; return Json(data, JsonRequestBehavior.AllowGet); var data = 0; return(Json(data, JsonRequestBehavior.AllowGet)); }