public ActionResult Update(ActivityRoleItemModel activityRoleItemModel)
        {
            try
            {
                if (IsUpdate(activityRoleItemModel.OperationResult))
                {
                    if (IsValid(activityRoleItemModel.OperationResult, activityRoleItemModel.ActivityRole))
                    {
                        ActivityRole activityRole = (ActivityRole)activityRoleItemModel.ActivityRole.ToData();
                        if (Application.Update(activityRoleItemModel.OperationResult, activityRole))
                        {
                            if (activityRoleItemModel.IsSave)
                            {
                                return(JsonResultSuccess(activityRoleItemModel.OperationResult,
                                                         Url.Action("Update", "ActivityRole", new { ActivityId = activityRole.ActivityId, RoleName = activityRole.RoleName }, Request.Url.Scheme)));
                            }
                            else
                            {
                                return(JsonResultSuccess(activityRoleItemModel.OperationResult));
                            }
                        }
                    }
                }
            }
            catch (Exception exception)
            {
                activityRoleItemModel.OperationResult.ParseException(exception);
            }

            activityRoleItemModel.ActivityOperations = ActivityOperations;

            return(JsonResultOperationResult(activityRoleItemModel.OperationResult));
        }
        public ActionResult Create(string masterEntity = null, string masterKey = null)                                                     // !?!
        {
            ActivityRoleItemModel activityRoleItemModel = new ActivityRoleItemModel(ActivityOperations, "Create", masterEntity, masterKey); // !?!

            try
            {
                if (IsCreate(activityRoleItemModel.OperationResult))
                {
                    return(ZPartialView("CRUD", activityRoleItemModel));
                }
            }
            catch (Exception exception)
            {
                activityRoleItemModel.OperationResult.ParseException(exception);
            }

            return(JsonResultOperationResult(activityRoleItemModel.OperationResult));
        }
        public ActionResult Delete(ActivityRoleItemModel activityRoleItemModel)
        {
            try
            {
                if (IsDelete(activityRoleItemModel.OperationResult))
                {
                    if (Application.Delete(activityRoleItemModel.OperationResult, (ActivityRole)activityRoleItemModel.ActivityRole.ToData()))
                    {
                        return(JsonResultSuccess(activityRoleItemModel.OperationResult));
                    }
                }
            }
            catch (Exception exception)
            {
                activityRoleItemModel.OperationResult.ParseException(exception);
            }

            activityRoleItemModel.ActivityOperations = ActivityOperations;

            return(JsonResultOperationResult(activityRoleItemModel.OperationResult));
        }
        public ActionResult Delete(string activityId, string roleName, string masterEntity = null, string masterKey = null)                 // !?!
        {
            ActivityRoleItemModel activityRoleItemModel = new ActivityRoleItemModel(ActivityOperations, "Delete", masterEntity, masterKey); // !?!

            try
            {
                if (IsDelete(activityRoleItemModel.OperationResult))
                {
                    ActivityRole activityRole = Application.GetById(activityRoleItemModel.OperationResult, new object[] { activityId, roleName });
                    if (activityRole != null)
                    {
                        activityRoleItemModel.ActivityRole = new ActivityRoleViewModel(activityRole);

                        return(ZPartialView("CRUD", activityRoleItemModel));
                    }
                }
            }
            catch (Exception exception)
            {
                activityRoleItemModel.OperationResult.ParseException(exception);
            }

            return(JsonResultOperationResult(activityRoleItemModel.OperationResult));
        }