public ActionResult Delete(string activityId, string roleId, string masterActivityId = null, string masterRoleId = null)
        {
            ActivityRoleItemModel activityRoleItemModel = new ActivityRoleItemModel()
            {
                IsSecurityOperations = this.IsSecurityOperations,
                ActivityRole         = new ActivityRoleViewModel(),
                ControllerAction     = "Delete",
                MasterActivityId     = masterActivityId, MasterRoleId = masterRoleId
            };

            try
            {
                if (IsDelete(activityRoleItemModel.OperationResult))
                {
                    ActivityRole activityRole = Repository.GetById(new object[] { activityId, roleId });
                    if (activityRole != null)
                    {
                        activityRoleItemModel.ActivityRole = new ActivityRoleViewModel(activityRole);
                    }
                }
            }
            catch (Exception exception)
            {
                activityRoleItemModel.OperationResult.ParseException(exception);
            }

            return(View(activityRoleItemModel));
        }
        public ActionResult Update(ActivityRoleItemModel activityRoleItemModel)
        {
            try
            {
                if (IsUpdate(activityRoleItemModel.OperationResult))
                {
                    if (ValidateModelState(Repository))
                    {
                        if (Repository.Update(activityRoleItemModel.OperationResult, (ActivityRole)activityRoleItemModel.ActivityRole.ToData()))
                        {
                            if (UnitOfWork.Save(activityRoleItemModel.OperationResult))
                            {
                                return(RedirectToUrlDictionary());
                            }
                        }
                    }
                }
            }
            catch (Exception exception)
            {
                activityRoleItemModel.OperationResult.ParseException(exception);
            }

            activityRoleItemModel.IsSecurityOperations = IsSecurityOperations;

            return(View(activityRoleItemModel));
        }
        public ActionResult Update(ActivityRoleItemModel activityRoleItemModel)
        {
            try
            {
                if (IsUpdate(activityRoleItemModel.OperationResult))
                {
                    if (ValidateModelState(Repository))
                    {
                        if (Repository.Update(activityRoleItemModel.OperationResult, (ActivityRole)activityRoleItemModel.ActivityRole.ToData()))
                        {
                            if (UnitOfWork.Save(activityRoleItemModel.OperationResult))
                            {
                                return(JsonResultSuccess(new { uri = ReadUrlDictionary() }));
                            }
                        }
                    }
                }
            }
            catch (Exception exception)
            {
                activityRoleItemModel.OperationResult.ParseException(exception);
            }

            return(JsonResultOperationResult(activityRoleItemModel.OperationResult));
        }
        public ActionResult Create(string masterActivityId = null, string masterRoleId = null)
        {
            ActivityRoleItemModel activityRoleItemModel = new ActivityRoleItemModel()
            {
                IsSecurityOperations = this.IsSecurityOperations,
                ActivityRole         = new ActivityRoleViewModel(),
                ControllerAction     = "Create",
                MasterActivityId     = masterActivityId, MasterRoleId = masterRoleId
            };

            try
            {
                IsCreate(activityRoleItemModel.OperationResult);
            }
            catch (Exception exception)
            {
                activityRoleItemModel.OperationResult.ParseException(exception);
            }

            return(View(activityRoleItemModel));
        }