public ActionResult Delete(string id) { try { var result = iDesignation.Delete(id); return(Json(new { ErrorCode = result.ErrorCode, Message = result.Msg, Id = result.Id, JsonRequestBehavior.AllowGet })); } catch (Exception ex) { return(Json(new { ErrorCode = false, Message = ex.Message }, JsonRequestBehavior.AllowGet)); } }
public ActionResult DeleteConfirmed(ReasonViewModel vm) { List <LogTypeViewModel> LogList = new List <LogTypeViewModel>(); if (ModelState.IsValid) { var temp = _DesignationService.Find(vm.id); LogList.Add(new LogTypeViewModel { ExObj = temp, }); XElement Modifications = new ModificationsCheckService().CheckChanges(LogList); _DesignationService.Delete(vm.id); try { _unitOfWork.Save(); } catch (Exception ex) { string message = _exception.HandleException(ex); ModelState.AddModelError("", message); return(PartialView("_Reason", vm)); } LogActivity.LogActivityDetail(LogVm.Map(new ActiivtyLogViewModel { DocTypeId = new DocumentTypeService(_unitOfWork).FindByName(MasterDocTypeConstants.Designation).DocumentTypeId, DocId = vm.id, ActivityType = (int)ActivityTypeContants.Deleted, UserRemark = vm.Reason, xEModifications = Modifications, })); return(Json(new { success = true })); } return(PartialView("_Reason", vm)); }
public ActionResult Delete(Guid id) { designationService.Delete(id); return(RedirectToAction("Index")); }