Exemplo n.º 1
0
        public ActionResult Edit(MSBuildLogsExtended.AspNetMvc40ViewModel.BuildEventCodeItemVM vm)
        {
            try
            {
                log.Info(string.Format("{0}: Edit", Framework.LoggingOptions.UI_Process_Started.ToString()));

                MSBuildLogsExtended.DataSourceEntities.BuildEventCode entity = vm.Item;
                var _Response = MSBuildLogsExtended.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.Resources.UIStringResource.EditAlternativeText;
                vm.ContentData.Summary   = MSBuildLogsExtended.Resources.UIStringResourcePerEntityBuildEventCode.Edit_BuildEventCode;
                vm.StatusOfResult        = Framework.CommonBLLEntities.BusinessLogicLayerResponseStatus.MessageErrorDetected;
                vm.StatusMessageOfResult = ex.Message;
                vm.UIActionStatusMessage = new Framework.UIActionStatusMessage(typeof(MSBuildLogsExtended.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));
            }
        }
Exemplo n.º 2
0
        public ActionResult AddNew(MSBuildLogsExtended.AspNetMvc40ViewModel.BuildEventCodeItemVM vm)
        {
            try
            {
                log.Info(string.Format("{0}: AddNew", Framework.LoggingOptions.UI_Process_Started.ToString()));

                MSBuildLogsExtended.DataSourceEntities.BuildEventCode entity = vm.Item;

                var _Response = MSBuildLogsExtended.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.ViewDetails;
                var entity = CreateEmptyEntityOrGetFromTempData(TempDataKey_BuildEventCodeController_Copy);
                vm = MSBuildLogsExtended.AspNetMvc40ViewModel.BuildEventCodeItemVM.CreateNewViewModel(entity);
                vm.StatusOfResult        = Framework.CommonBLLEntities.BusinessLogicLayerResponseStatus.MessageErrorDetected;
                vm.StatusMessageOfResult = ex.Message;
                vm.UIActionStatusMessage = new Framework.UIActionStatusMessage(typeof(MSBuildLogsExtended.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));
            }
        }
Exemplo n.º 3
0
 public ActionResult Delete(bool isToCompareIdByIdentifierOftOfByIdentifier, System.Int32 valueToCompareIdByIdentifierOftOfByIdentifier)
 {
     Framework.UIAction uiAction = Framework.UIAction.Delete;
     MSBuildLogsExtended.AspNetMvc40ViewModel.BuildEventCodeItemVM vm = MSBuildLogsExtended.AspNetMvc40ViewModel.BuildEventCodeItemVM.Load(isToCompareIdByIdentifierOftOfByIdentifier, valueToCompareIdByIdentifierOftOfByIdentifier, uiAction);
     vm.ContentData.Title   = Framework.Resources.UIStringResource.DeleteAlternativeText;
     vm.ContentData.Summary = MSBuildLogsExtended.Resources.UIStringResourcePerEntityBuildEventCode.Delete_BuildEventCode;
     return(View(vm));
 }
Exemplo n.º 4
0
        public ActionResult AddNew()
        {
            var entity = CreateEmptyEntityOrGetFromTempData(TempDataKey_BuildEventCodeController_Copy);

            MSBuildLogsExtended.AspNetMvc40ViewModel.BuildEventCodeItemVM vm = MSBuildLogsExtended.AspNetMvc40ViewModel.BuildEventCodeItemVM.CreateNewViewModel(entity);

            return(View(vm));
        }
Exemplo n.º 5
0
        public static BuildEventCodeItemVM CreateNewViewModel(MSBuildLogsExtended.DataSourceEntities.BuildEventCode entity)
        {
            Framework.UIAction   uiAction = Framework.UIAction.Create;
            BuildEventCodeItemVM vm       = new BuildEventCodeItemVM();

            vm.ContentData.Title   = Framework.Resources.UIStringResource.AddNewAlternativeText;
            vm.ContentData.Summary = MSBuildLogsExtended.Resources.UIStringResourcePerEntityBuildEventCode.AddNew_BuildEventCode;

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

            return(vm);
        }
Exemplo n.º 6
0
        public static BuildEventCodeItemVM Load(bool isToCompareIdByIdentifierOftOfByIdentifier, System.Int32 valueToCompareIdByIdentifierOftOfByIdentifier
                                                , Framework.UIAction uiAction)
        {
            BuildEventCodeItemVM vm = new BuildEventCodeItemVM();

            try
            {
                log.Info(string.Format("{0}: Details", Framework.LoggingOptions.UI_Process_Started.ToString()));

                MSBuildLogsExtended.CommonBLLEntities.BuildEventCodeResponseMessageBuiltIn _Response =
                    MSBuildLogsExtended.CommonBLLIoC.IoCBuildEventCode.GetMessageOfEntityOfByIdentifier(isToCompareIdByIdentifierOftOfByIdentifier && valueToCompareIdByIdentifierOftOfByIdentifier != default(System.Int32), valueToCompareIdByIdentifierOftOfByIdentifier, -1, -1, null);

                if (_Response.BusinessLogicLayerResponseStatus == Framework.CommonBLLEntities.BusinessLogicLayerResponseStatus.MessageOK || _Response.BusinessLogicLayerResponseStatus == Framework.CommonBLLEntities.BusinessLogicLayerResponseStatus.UIProcessReady)
                {
                    vm.Item = _Response.Message[0];
                    vm.UIActionStatusMessage = new Framework.UIActionStatusMessage(typeof(BuildEventCodeItemVM).FullName, uiAction.ToString(), uiAction, Framework.UIActionStatus.Launch);
                    log.Info(string.Format("{0}: {1}", uiAction, Framework.LoggingOptions.UI_Process_Succeeded.ToString()));
                }
                else
                {
                    vm.StatusOfResult        = _Response.BusinessLogicLayerResponseStatus;
                    vm.StatusMessageOfResult = _Response.ServerErrorMessage;
                    vm.UIActionStatusMessage = new Framework.UIActionStatusMessage(typeof(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));
                }
            }
            catch (Exception ex)
            {
                vm.StatusOfResult        = Framework.CommonBLLEntities.BusinessLogicLayerResponseStatus.MessageErrorDetected;
                vm.StatusMessageOfResult = ex.Message;
                vm.UIActionStatusMessage = new Framework.UIActionStatusMessage(typeof(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(vm);
        }
Exemplo n.º 7
0
        public ActionResult Delete(bool isToCompareIdByIdentifierOftOfByIdentifier, System.Int32 valueToCompareIdByIdentifierOftOfByIdentifier, MSBuildLogsExtended.AspNetMvc40ViewModel.BuildEventCodeItemVM vm, FormCollection collection)
        {
            try
            {
                log.Info(string.Format("{0}: Delete", Framework.LoggingOptions.UI_Process_Started.ToString()));
                var _Response = MSBuildLogsExtended.CommonBLLIoC.IoCBuildEventCode.ExistsOfEntityOfByIdentifier(isToCompareIdByIdentifierOftOfByIdentifier, valueToCompareIdByIdentifierOftOfByIdentifier, -1, -1, null);
                if (_Response)
                {
                    MSBuildLogsExtended.DataSourceEntities.BuildEventCode entity = vm.Item;
                    MSBuildLogsExtended.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.Resources.UIStringResource.DeleteAlternativeText;
                vm.ContentData.Summary   = MSBuildLogsExtended.Resources.UIStringResourcePerEntityBuildEventCode.Delete_BuildEventCode;
                vm.StatusOfResult        = Framework.CommonBLLEntities.BusinessLogicLayerResponseStatus.MessageErrorDetected;
                vm.StatusMessageOfResult = ex.Message;
                vm.UIActionStatusMessage = new Framework.UIActionStatusMessage(typeof(MSBuildLogsExtended.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));
            }
        }