Пример #1
0
        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;
            }
        }
Пример #2
0
        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));
        }
Пример #3
0
        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));
        }
Пример #4
0
        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;
            }
        }