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)); }
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)); }
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)); }
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)); }