public ActionResult Create(int?Id) { FormulationCreateViewModel model = new FormulationCreateViewModel(); model.Id = Id ?? 0; return(View(model)); }
public JsonNetResult GetFormulationRequestById(int Id) { var formulation = this._formulationRequestService.GetFormulationById(Id); if (formulation != null) { FormulationCreateViewModel model = new FormulationCreateViewModel { Id = formulation.Id, CategoryId = formulation.ProductMaster.CategoryId, ProductId = formulation.ProductId, QtyToProduce = formulation.QtyToProduce.ToString(), LotNo = formulation.LotNo, ColorSTD = formulation.ColorSTD, LOTSize = formulation.LOTSize, Notes = formulation.Notes, WorkOrderNo = formulation.WorkOrderNo, LineId = formulation.LineId }; return(JsonNet(model, JsonRequestBehavior.AllowGet)); } else { return(JsonNet(null, JsonRequestBehavior.AllowGet)); } }