public ActionResult Edit(EducationLevelModel model) { try { if (ModelState.IsValid) { educationService.Update(model); TempData["Success"] = $"{model.LevelName} is updated"; return(RedirectToAction("Index")); } return(View(@"~\Views\Configuration\Education\Edit.cshtml", model)); } catch (Exception e) { TempData["Danger"] = $"Opps something went wrong {e.Message}"; throw; } }
public ActionResult Edit(ColourModel model) { try { if (ModelState.IsValid) { colourService.Update(model); TempData["Success"] = $"{model.ColourName} colour updated!!"; return(RedirectToAction("Index")); } TempData["Danger"] = $"Form error!!"; } catch (Exception ex) { TempData["Danger"] = $"Something went wrong {ex.Message}"; } return(View(@"~\Views\Configuration\Colour\Index.cshtml", model)); }
public ActionResult Edit(DesignationModel model) { try { if (ModelState.IsValid) { model.UpdatedDate = DateTime.Now; designService.Update(model); TempData["Success"] = $"{model.DesgName} is Updated !!"; return(RedirectToAction("Index")); } TempData["Danger"] = "Form Error"; } catch (Exception e) { TempData["Danger"] = $"Oppss something went wrong {e.Message}"; } return(View(@"~\Views\Configuration\Designation\Edit.cshtml", model.Id)); }
public ActionResult Edit(OfficeTypeModel model) { try { if (ModelState.IsValid) { model.UpdatedDate = DateTime.Now; officeTypeService.Update(model); TempData["Success"] = $"{model.OfficeTypeName} is updated"; return(RedirectToAction("Index")); } return(View(@"~\Views\Configuration\OfficeType\Edit.cshtml", model)); } catch (Exception e) { TempData["Danger"] = $"Oppsss something went wrong {e.Message}"; throw; } }