public async Task <IActionResult> Gladd(GlModel model) { if (ModelState.IsValid) { var glObj = new Gl { ClientId = (int)_workContext.CurrentCustomer.ClientId, Gl1 = model.GlName, Gldescription = model.Description }; var result = await _financialManagementService.InsertGL(glObj); if (result) { SuccessNotification("The gl data has been saved successfully."); return(RedirectToAction("Gladd")); } else { ModelState.AddModelError("", "Something went wrong while saving record"); } } return(View(model)); }
public async Task <IActionResult> EditCategory(GlModel model) { if (ModelState.IsValid) { var glObj = new Gl { Gl1 = model.GlName, ClientId = (int)_workContext.CurrentCustomer.ClientId, Gldescription = model.Description, Glid = model.GlID }; var result = await _financialManagementService.UpdateGL(glObj); if (result) { SuccessNotification("The category data has been updated successfully."); return(RedirectToAction("EditCategory", "FinancialManagement", new { Area = "Administration", GLID = model.GlID })); } else { ModelState.AddModelError("", "Something went wrong while saving record"); } } return(View(model)); }
public async Task <IActionResult> Gledit(int GLID) { if (GLID < 0) { return(RedirectToAction("GeneralLedger")); } var gl = await _financialManagementService.GetGenralLedger(GLID); if (gl == null) { SuccessNotification("The gl data has been updated successfully."); } var model = new GlModel { GlID = gl.Glid, GlName = gl.Gl1, Description = gl.Gldescription }; return(View(model)); }