Ejemplo n.º 1
0
        public ActionResult Delete(string id)
        {
            ActivityItemModel activityItemModel = new ActivityItemModel()
            {
                IsSecurityOperations = this.IsSecurityOperations,
                Activity             = new ActivityViewModel(),
                ControllerAction     = "Delete"
            };

            try
            {
                if (IsDelete(activityItemModel.OperationResult))
                {
                    EasyLOB.Security.Data.Activity activity = Repository.GetById(new object[] { id }); // !!!
                    if (activity != null)
                    {
                        activityItemModel.Activity = new ActivityViewModel(activity);
                    }
                }
            }
            catch (Exception exception)
            {
                activityItemModel.OperationResult.ParseException(exception);
            }

            return(PartialView(activityItemModel));
        }
Ejemplo n.º 2
0
        public ActionResult Update(ActivityItemModel activityItemModel)
        {
            try
            {
                if (IsUpdate(activityItemModel.OperationResult))
                {
                    if (ValidateModelState(Repository))
                    {
                        if (Repository.Update(activityItemModel.OperationResult, (EasyLOB.Security.Data.Activity)activityItemModel.Activity.ToData())) // !!!
                        {
                            if (UnitOfWork.Save(activityItemModel.OperationResult))
                            {
                                return(JsonResultSuccess(new { uri = ReadUrlDictionary() }));
                            }
                        }
                    }
                }
            }
            catch (Exception exception)
            {
                activityItemModel.OperationResult.ParseException(exception);
            }

            return(JsonResultOperationResult(activityItemModel.OperationResult));
        }
Ejemplo n.º 3
0
        public ActionResult Update(ActivityItemModel activityItemModel)
        {
            try
            {
                if (IsUpdate(activityItemModel.OperationResult))
                {
                    if (ValidateModelState(Repository))
                    {
                        if (Repository.Update(activityItemModel.OperationResult, (EasyLOB.Security.Data.Activity)activityItemModel.Activity.ToData())) // !!!
                        {
                            if (UnitOfWork.Save(activityItemModel.OperationResult))
                            {
                                return(RedirectToUrlDictionary());
                            }
                        }
                    }
                }
            }
            catch (Exception exception)
            {
                activityItemModel.OperationResult.ParseException(exception);
            }

            activityItemModel.IsSecurityOperations = IsSecurityOperations;

            return(View(activityItemModel));
        }
Ejemplo n.º 4
0
        public ActionResult Create()
        {
            ActivityItemModel activityItemModel = new ActivityItemModel()
            {
                IsSecurityOperations = this.IsSecurityOperations,
                Activity             = new ActivityViewModel(),
                ControllerAction     = "Create"
            };

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

            return(PartialView(activityItemModel));
        }