public ActionResult Create(QuotationApprovalViewModel model) { if (ModelState.IsValid) { QuotationApprovalRepository repo = new QuotationApprovalRepository(); TempData["Success"] = "Updated Successfully!"; //TempData["Id"] = 1; repo.UpdateSettings(model); } return(View(model)); }
public ActionResult Create() { QuotationApprovalRepository repo = new QuotationApprovalRepository(); QuotationApprovalViewModel model = new QuotationApprovalViewModel(); var amountSettings = repo.GetApprovalAmountSettings(); var approvalSettings = repo.GetApprovalSettings(); model.QuotationApprovalAmountSettings = new List <QuotationApprovalAmountSettings>(); model.QuotationApprovalSettings = new List <QuotationApprovalSettings>(); foreach (var item in amountSettings) { model.QuotationApprovalAmountSettings.Add(item); } foreach (var item in approvalSettings) { model.QuotationApprovalSettings.Add(item); } return(View(model)); }