public ActionResult SaveApprovalPermission(List<CmnApprovalUserPermissionViewModel> obj)
        {
            Operation operation = new Operation { Success = false };
            if (ModelState.IsValid)
            {
                CmnApprovalUserPermission cmnApprovalUserPermission;
                int lastId = _cmnApprovalUserPermissionService.GetLastId();
                if (obj != null)
                {
                    foreach (CmnApprovalUserPermissionViewModel item in obj)
                    {
                        if (item.Id == 0)
                        {
                            cmnApprovalUserPermission = new CmnApprovalUserPermission();
                            cmnApprovalUserPermission.Id = lastId;
                            cmnApprovalUserPermission.CmnApprovalProcessLevelId = item.CmnApprovalProcessLevelId;
                            cmnApprovalUserPermission.SecUserId = item.SecUserId;
                            _cmnApprovalUserPermissionService.Save(cmnApprovalUserPermission);
                            lastId++;

                        }
                        else if (item.Id != 0 && item.Mapped == false)
                        {
                            cmnApprovalUserPermission = _cmnApprovalUserPermissionService.GetById(item.Id);
                            _cmnApprovalUserPermissionService.Delete(cmnApprovalUserPermission);
                        }
                    }
                    operation = _cmnApprovalUserPermissionService.Commit();

                }
                else { operation.Success = true; }
            }
            return Json(operation, JsonRequestBehavior.DenyGet);
        }
 public void Delete(CmnApprovalUserPermission cmnApprovalUserPermission)
 {
     _cmnApprovalUserPermissionRepository.Delete(cmnApprovalUserPermission);
 }
 public void Update(CmnApprovalUserPermission cmnApprovalUserPermission)
 {
     _cmnApprovalUserPermissionRepository.Update(cmnApprovalUserPermission);
 }
 public void Save(CmnApprovalUserPermission cmnApprovalUserPermission)
 {
     _cmnApprovalUserPermissionRepository.Add(cmnApprovalUserPermission);
 }