예제 #1
0
        public ActionResult Edit(MSBuildExtensionPack.AspNetMvc40ViewModel.BuildEventCodeItemVM vm)
        {
            try
            {
                log.Info(string.Format("{0}: Edit", Framework.LoggingOptions.UI_Process_Started.ToString()));

                MSBuildExtensionPack.DataSourceEntities.BuildEventCode entity = vm.Item;
                var _Response = MSBuildExtensionPack.CommonBLLIoC.IoCBuildEventCode.UpdateEntity(entity);

                log.Info(string.Format("{0}: Edit", Framework.LoggingOptions.UI_Process_Ended.ToString()));
                return(RedirectToAction(UrlStringsAlias.ActionName_BuildEventCode_Index));
            }
            catch (Exception ex)
            {
                Framework.UIAction uiAction = Framework.UIAction.Update;
                vm.ContentData.Title     = Framework.Resx.UIStringResource.Edit;
                vm.ContentData.Summary   = MSBuildExtensionPack.Resx.UIStringResourcePerEntityBuildEventCode.Edit_BuildEventCode;
                vm.StatusOfResult        = Framework.CommonBLLEntities.BusinessLogicLayerResponseStatus.MessageErrorDetected;
                vm.StatusMessageOfResult = ex.Message;
                vm.UIActionStatusMessage = new Framework.UIActionStatusMessage(typeof(MSBuildExtensionPack.AspNetMvc40ViewModel.BuildEventCodeItemVM).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));
            }
        }
예제 #2
0
        public ActionResult AddNew(MSBuildExtensionPack.AspNetMvc40ViewModel.BuildEventCodeItemVM vm)
        {
            try
            {
                log.Info(string.Format("{0}: AddNew", Framework.LoggingOptions.UI_Process_Started.ToString()));

                MSBuildExtensionPack.DataSourceEntities.BuildEventCode entity = vm.Item;

                var _Response = MSBuildExtensionPack.CommonBLLIoC.IoCBuildEventCode.InsertEntity(entity);

                TempData[TempDataKey_BuildEventCodeController_Copy] = null;
                TempData.Remove(TempDataKey_BuildEventCodeController_Copy);
                log.Info(string.Format("{0}: Insert", Framework.LoggingOptions.UI_Process_Ended.ToString()));

                return(RedirectToAction(UrlStringsAlias.ActionName_BuildEventCode_Index));
            }
            catch (Exception ex)
            {
                Framework.UIAction uiAction = Framework.UIAction.Create;
                var entity = CreateEmptyEntityOrGetFromTempData(TempDataKey_BuildEventCodeController_Copy);
                vm = MSBuildExtensionPack.AspNetMvc40ViewModel.BuildEventCodeItemVM.CreateNewViewModel(entity);
                vm.StatusOfResult        = Framework.CommonBLLEntities.BusinessLogicLayerResponseStatus.MessageErrorDetected;
                vm.StatusMessageOfResult = ex.Message;
                vm.UIActionStatusMessage = new Framework.UIActionStatusMessage(typeof(MSBuildExtensionPack.AspNetMvc40ViewModel.BuildEventCodeItemVM).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));
            }
        }
예제 #3
0
 public ActionResult Delete(bool isToCompareIdByIdentifierOftOfByIdentifier, System.Int32?valueToCompareIdByIdentifierOftOfByIdentifier)
 {
     Framework.UIAction uiAction = Framework.UIAction.Delete;
     MSBuildExtensionPack.AspNetMvc40ViewModel.BuildEventCodeItemVM vm = new MSBuildExtensionPack.AspNetMvc40ViewModel.BuildEventCodeItemVM();
     vm.Load(isToCompareIdByIdentifierOftOfByIdentifier, valueToCompareIdByIdentifierOftOfByIdentifier, uiAction);
     vm.ContentData.Title   = Framework.Resx.UIStringResource.Delete;
     vm.ContentData.Summary = MSBuildExtensionPack.Resx.UIStringResourcePerEntityBuildEventCode.Delete_BuildEventCode;
     return(View(vm));
 }
예제 #4
0
        public ActionResult AddNew()
        {
            var entity = CreateEmptyEntityOrGetFromTempData(TempDataKey_BuildEventCodeController_Copy);

            Framework.UIAction uiAction = Framework.UIAction.Create;
            MSBuildExtensionPack.AspNetMvc40ViewModel.BuildEventCodeItemVM vm = MSBuildExtensionPack.AspNetMvc40ViewModel.BuildEventCodeItemVM.CreateNewViewModel(entity);
            vm.LoadExtraData(uiAction);

            return(View(vm));
        }
        public static BuildEventCodeItemVM CreateNewViewModel(MSBuildExtensionPack.DataSourceEntities.BuildEventCode entity)
        {
            Framework.UIAction   uiAction = Framework.UIAction.Create;
            BuildEventCodeItemVM vm       = new BuildEventCodeItemVM();

            vm.ContentData.Title   = Framework.Resx.UIStringResource.AddNew;
            vm.ContentData.Summary = MSBuildExtensionPack.Resx.UIStringResourcePerEntityBuildEventCode.AddNew_BuildEventCode;
            vm.LoadExtraData(uiAction);

            vm.Item = entity;
            vm.UIActionStatusMessage = new Framework.UIActionStatusMessage(typeof(BuildEventCodeItemVM).FullName, uiAction.ToString(), uiAction, Framework.UIActionStatus.Launch);

            return(vm);
        }
예제 #6
0
        public ActionResult Delete(bool isToCompareIdByIdentifierOftOfByIdentifier, System.Int32?valueToCompareIdByIdentifierOftOfByIdentifier, MSBuildExtensionPack.AspNetMvc40ViewModel.BuildEventCodeItemVM vm, FormCollection collection)
        {
            try
            {
                log.Info(string.Format("{0}: Delete", Framework.LoggingOptions.UI_Process_Started.ToString()));
                var _Response = MSBuildExtensionPack.CommonBLLIoC.IoCBuildEventCode.ExistsOfEntityOfByIdentifier(isToCompareIdByIdentifierOftOfByIdentifier, valueToCompareIdByIdentifierOftOfByIdentifier, -1, -1, null);
                if (_Response)
                {
                    MSBuildExtensionPack.DataSourceEntities.BuildEventCode entity = vm.Item;
                    MSBuildExtensionPack.CommonBLLIoC.IoCBuildEventCode.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_BuildEventCode_Index"));
            }
            catch (Exception ex)
            {
                Framework.UIAction uiAction = Framework.UIAction.Delete;
                vm.ContentData.Title     = Framework.Resx.UIStringResource.Delete;
                vm.ContentData.Summary   = MSBuildExtensionPack.Resx.UIStringResourcePerEntityBuildEventCode.Delete_BuildEventCode;
                vm.StatusOfResult        = Framework.CommonBLLEntities.BusinessLogicLayerResponseStatus.MessageErrorDetected;
                vm.StatusMessageOfResult = ex.Message;
                vm.UIActionStatusMessage = new Framework.UIActionStatusMessage(typeof(MSBuildExtensionPack.AspNetMvc40ViewModel.BuildEventCodeItemVM).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));
            }
        }