public ActionResult Edit(MSBuildExtensionPack.AspNetMvc40ViewModel.OrganizationItemVM vm) { try { log.Info(string.Format("{0}: Edit", Framework.LoggingOptions.UI_Process_Started.ToString())); MSBuildExtensionPack.DataSourceEntities.Organization entity = MSBuildExtensionPack.EntityContracts.IOrganizationHelper.Clone <MSBuildExtensionPack.DataSourceEntities.Organization.Default, MSBuildExtensionPack.DataSourceEntities.Organization>(vm.Item); var _Response = MSBuildExtensionPack.CommonBLLIoC.IoCOrganization.UpdateEntity(entity); log.Info(string.Format("{0}: Edit", Framework.LoggingOptions.UI_Process_Ended.ToString())); return(RedirectToAction(UrlStringsAlias.ActionName_Organization_Index)); } catch (Exception ex) { Framework.UIAction uiAction = Framework.UIAction.Update; vm.ContentData.Title = Framework.Resx.UIStringResource.Edit; vm.ContentData.Summary = MSBuildExtensionPack.Resx.UIStringResourcePerEntityOrganization.Edit_Organization; vm.StatusOfResult = Framework.CommonBLLEntities.BusinessLogicLayerResponseStatus.MessageErrorDetected; vm.StatusMessageOfResult = ex.Message; vm.UIActionStatusMessage = new Framework.UIActionStatusMessage(typeof(MSBuildExtensionPack.AspNetMvc40ViewModel.OrganizationItemVM).FullName, uiAction.ToString(), uiAction, Framework.UIActionStatus.Failed); log.Error(string.Format("{0}: {1}, {2}, {3}", uiAction, Framework.LoggingOptions.UI_Process_Failed.ToString(), vm.StatusOfResult, vm.StatusMessageOfResult)); return(View(vm)); } }
public ActionResult AddNew(MSBuildExtensionPack.AspNetMvc40ViewModel.OrganizationItemVM vm) { try { log.Info(string.Format("{0}: AddNew", Framework.LoggingOptions.UI_Process_Started.ToString())); MSBuildExtensionPack.DataSourceEntities.Organization entity = MSBuildExtensionPack.EntityContracts.IOrganizationHelper.Clone <MSBuildExtensionPack.DataSourceEntities.Organization.Default, MSBuildExtensionPack.DataSourceEntities.Organization>(vm.Item); var _Response = MSBuildExtensionPack.CommonBLLIoC.IoCOrganization.InsertEntity(entity); TempData[TempDataKey_OrganizationController_Copy] = null; TempData.Remove(TempDataKey_OrganizationController_Copy); log.Info(string.Format("{0}: Insert", Framework.LoggingOptions.UI_Process_Ended.ToString())); return(RedirectToAction(UrlStringsAlias.ActionName_Organization_Index)); } catch (Exception ex) { Framework.UIAction uiAction = Framework.UIAction.Create; var entity = CreateEmptyEntityOrGetFromTempData(TempDataKey_OrganizationController_Copy); vm = MSBuildExtensionPack.AspNetMvc40ViewModel.OrganizationItemVM.CreateNewViewModel(entity); vm.StatusOfResult = Framework.CommonBLLEntities.BusinessLogicLayerResponseStatus.MessageErrorDetected; vm.StatusMessageOfResult = ex.Message; vm.UIActionStatusMessage = new Framework.UIActionStatusMessage(typeof(MSBuildExtensionPack.AspNetMvc40ViewModel.OrganizationItemVM).FullName, uiAction.ToString(), uiAction, Framework.UIActionStatus.Failed); log.Error(string.Format("{0}: AddNew: {1}", Framework.LoggingOptions.Business_Logic_Layer_Process_Failed.ToString(), ex.Message)); return(View(vm)); } }
public ActionResult Delete(bool isToCompareIdIdentifierAndUniqueConstraintOftOfIdentifierAndUniqueConstraint, System.Int64?valueToCompareIdIdentifierAndUniqueConstraintOftOfIdentifierAndUniqueConstraint, bool isToCompareUniqueIdentifierIdentifierAndUniqueConstraintOftOfIdentifierAndUniqueConstraint, System.Guid?valueToCompareUniqueIdentifierIdentifierAndUniqueConstraintOftOfIdentifierAndUniqueConstraint, bool isToCompareUniqueidentifierColumnIdentifierAndUniqueConstraintOftOfIdentifierAndUniqueConstraint, System.Guid?valueToCompareUniqueidentifierColumnIdentifierAndUniqueConstraintOftOfIdentifierAndUniqueConstraint) { Framework.UIAction uiAction = Framework.UIAction.Delete; MSBuildExtensionPack.AspNetMvc40ViewModel.OrganizationItemVM vm = new MSBuildExtensionPack.AspNetMvc40ViewModel.OrganizationItemVM(); vm.Load(isToCompareIdIdentifierAndUniqueConstraintOftOfIdentifierAndUniqueConstraint, valueToCompareIdIdentifierAndUniqueConstraintOftOfIdentifierAndUniqueConstraint, isToCompareUniqueIdentifierIdentifierAndUniqueConstraintOftOfIdentifierAndUniqueConstraint, valueToCompareUniqueIdentifierIdentifierAndUniqueConstraintOftOfIdentifierAndUniqueConstraint, isToCompareUniqueidentifierColumnIdentifierAndUniqueConstraintOftOfIdentifierAndUniqueConstraint, valueToCompareUniqueidentifierColumnIdentifierAndUniqueConstraintOftOfIdentifierAndUniqueConstraint, uiAction); vm.ContentData.Title = Framework.Resx.UIStringResource.Delete; vm.ContentData.Summary = MSBuildExtensionPack.Resx.UIStringResourcePerEntityOrganization.Delete_Organization; return(View(vm)); }
public ActionResult AddNew() { var entity = CreateEmptyEntityOrGetFromTempData(TempDataKey_OrganizationController_Copy); Framework.UIAction uiAction = Framework.UIAction.Create; MSBuildExtensionPack.AspNetMvc40ViewModel.OrganizationItemVM vm = MSBuildExtensionPack.AspNetMvc40ViewModel.OrganizationItemVM.CreateNewViewModel(entity); vm.LoadExtraData(uiAction); return(View(vm)); }
public static OrganizationItemVM CreateNewViewModel(MSBuildExtensionPack.DataSourceEntities.Organization.Default entity) { Framework.UIAction uiAction = Framework.UIAction.Create; OrganizationItemVM vm = new OrganizationItemVM(); vm.ContentData.Title = Framework.Resx.UIStringResource.AddNew; vm.ContentData.Summary = MSBuildExtensionPack.Resx.UIStringResourcePerEntityOrganization.AddNew_Organization; vm.LoadExtraData(uiAction); vm.Item = entity; vm.UIActionStatusMessage = new Framework.UIActionStatusMessage(typeof(OrganizationItemVM).FullName, uiAction.ToString(), uiAction, Framework.UIActionStatus.Launch); return(vm); }
public ActionResult Delete(bool isToCompareIdIdentifierAndUniqueConstraintOftOfIdentifierAndUniqueConstraint, System.Int64?valueToCompareIdIdentifierAndUniqueConstraintOftOfIdentifierAndUniqueConstraint, bool isToCompareUniqueIdentifierIdentifierAndUniqueConstraintOftOfIdentifierAndUniqueConstraint, System.Guid?valueToCompareUniqueIdentifierIdentifierAndUniqueConstraintOftOfIdentifierAndUniqueConstraint, bool isToCompareUniqueidentifierColumnIdentifierAndUniqueConstraintOftOfIdentifierAndUniqueConstraint, System.Guid?valueToCompareUniqueidentifierColumnIdentifierAndUniqueConstraintOftOfIdentifierAndUniqueConstraint, MSBuildExtensionPack.AspNetMvc40ViewModel.OrganizationItemVM vm, FormCollection collection) { try { log.Info(string.Format("{0}: Delete", Framework.LoggingOptions.UI_Process_Started.ToString())); var _Response = MSBuildExtensionPack.CommonBLLIoC.IoCOrganization.ExistsOfDefaultOfIdentifierAndUniqueConstraint(isToCompareIdIdentifierAndUniqueConstraintOftOfIdentifierAndUniqueConstraint, valueToCompareIdIdentifierAndUniqueConstraintOftOfIdentifierAndUniqueConstraint, isToCompareUniqueIdentifierIdentifierAndUniqueConstraintOftOfIdentifierAndUniqueConstraint, valueToCompareUniqueIdentifierIdentifierAndUniqueConstraintOftOfIdentifierAndUniqueConstraint, isToCompareUniqueidentifierColumnIdentifierAndUniqueConstraintOftOfIdentifierAndUniqueConstraint, valueToCompareUniqueidentifierColumnIdentifierAndUniqueConstraintOftOfIdentifierAndUniqueConstraint, -1, -1, null); if (_Response) { MSBuildExtensionPack.DataSourceEntities.Organization entity = MSBuildExtensionPack.EntityContracts.IOrganizationHelper.Clone <MSBuildExtensionPack.DataSourceEntities.Organization.Default, MSBuildExtensionPack.DataSourceEntities.Organization>(vm.Item); MSBuildExtensionPack.CommonBLLIoC.IoCOrganization.DeleteEntity(entity); log.Info(string.Format("{0}: Delete", Framework.LoggingOptions.UI_Process_Ended.ToString())); } else { log.Warn(string.Format("{0}: Delete, Entity not exists", Framework.LoggingOptions.UI_Process_Ended.ToString())); } return(RedirectToAction("UrlStringsAlias.ActionName_Organization_Index")); } catch (Exception ex) { Framework.UIAction uiAction = Framework.UIAction.Delete; vm.ContentData.Title = Framework.Resx.UIStringResource.Delete; vm.ContentData.Summary = MSBuildExtensionPack.Resx.UIStringResourcePerEntityOrganization.Delete_Organization; vm.StatusOfResult = Framework.CommonBLLEntities.BusinessLogicLayerResponseStatus.MessageErrorDetected; vm.StatusMessageOfResult = ex.Message; vm.UIActionStatusMessage = new Framework.UIActionStatusMessage(typeof(MSBuildExtensionPack.AspNetMvc40ViewModel.OrganizationItemVM).FullName, uiAction.ToString(), uiAction, Framework.UIActionStatus.Failed); log.Error(string.Format("{0}: {1}, {2}, {3}", uiAction, Framework.LoggingOptions.UI_Process_Failed.ToString(), vm.StatusOfResult, vm.StatusMessageOfResult)); return(View(vm)); } }