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

                MSBuildLogsExtended.DataSourceEntities.Solution entity = vm.Item;
                var _Response = MSBuildLogsExtended.CommonBLLIoC.IoCSolution.UpdateEntity(entity);


                log.Info(string.Format("{0}: Edit", Framework.LoggingOptions.UI_Process_Ended.ToString()));
                return(RedirectToAction(UrlStringsAlias.ActionName_Solution_Index));
            }
            catch (Exception ex)
            {
                Framework.UIAction uiAction = Framework.UIAction.Update;
                vm.ContentData.Title     = Framework.Resources.UIStringResource.EditAlternativeText;
                vm.ContentData.Summary   = MSBuildLogsExtended.Resources.UIStringResourcePerEntitySolution.Edit_Solution;
                vm.StatusOfResult        = Framework.CommonBLLEntities.BusinessLogicLayerResponseStatus.MessageErrorDetected;
                vm.StatusMessageOfResult = ex.Message;
                vm.UIActionStatusMessage = new Framework.UIActionStatusMessage(typeof(MSBuildLogsExtended.AspNetMvc40ViewModel.SolutionItemVM).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(MSBuildLogsExtended.AspNetMvc40ViewModel.SolutionItemVM vm)
        {
            try
            {
                log.Info(string.Format("{0}: AddNew", Framework.LoggingOptions.UI_Process_Started.ToString()));

                MSBuildLogsExtended.DataSourceEntities.Solution entity = vm.Item;

                var _Response = MSBuildLogsExtended.CommonBLLIoC.IoCSolution.InsertEntity(entity);



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

                return(RedirectToAction(UrlStringsAlias.ActionName_Solution_Index));
            }
            catch (Exception ex)
            {
                Framework.UIAction uiAction = Framework.UIAction.ViewDetails;
                var entity = CreateEmptyEntityOrGetFromTempData(TempDataKey_SolutionController_Copy);
                vm = MSBuildLogsExtended.AspNetMvc40ViewModel.SolutionItemVM.CreateNewViewModel(entity);
                vm.StatusOfResult        = Framework.CommonBLLEntities.BusinessLogicLayerResponseStatus.MessageErrorDetected;
                vm.StatusMessageOfResult = ex.Message;
                vm.UIActionStatusMessage = new Framework.UIActionStatusMessage(typeof(MSBuildLogsExtended.AspNetMvc40ViewModel.SolutionItemVM).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 isToCompareIdByIdentifierOftOfByIdentifier, System.Int32 valueToCompareIdByIdentifierOftOfByIdentifier)
 {
     Framework.UIAction uiAction = Framework.UIAction.Delete;
     MSBuildLogsExtended.AspNetMvc40ViewModel.SolutionItemVM vm = MSBuildLogsExtended.AspNetMvc40ViewModel.SolutionItemVM.Load(isToCompareIdByIdentifierOftOfByIdentifier, valueToCompareIdByIdentifierOftOfByIdentifier, uiAction);
     vm.ContentData.Title   = Framework.Resources.UIStringResource.DeleteAlternativeText;
     vm.ContentData.Summary = MSBuildLogsExtended.Resources.UIStringResourcePerEntitySolution.Delete_Solution;
     return(View(vm));
 }
        public ActionResult AddNew()
        {
            var entity = CreateEmptyEntityOrGetFromTempData(TempDataKey_SolutionController_Copy);

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

            return(View(vm));
        }
Esempio n. 5
0
        public static SolutionItemVM CreateNewViewModel(MSBuildLogsExtended.DataSourceEntities.Solution entity)
        {
            Framework.UIAction uiAction = Framework.UIAction.Create;
            SolutionItemVM     vm       = new SolutionItemVM();

            vm.ContentData.Title   = Framework.Resources.UIStringResource.AddNewAlternativeText;
            vm.ContentData.Summary = MSBuildLogsExtended.Resources.UIStringResourcePerEntitySolution.AddNew_Solution;

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

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

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

                MSBuildLogsExtended.CommonBLLEntities.SolutionResponseMessageBuiltIn _Response =
                    MSBuildLogsExtended.CommonBLLIoC.IoCSolution.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(SolutionItemVM).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(SolutionItemVM).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(SolutionItemVM).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);
        }
        public ActionResult Delete(bool isToCompareIdByIdentifierOftOfByIdentifier, System.Int32 valueToCompareIdByIdentifierOftOfByIdentifier, MSBuildLogsExtended.AspNetMvc40ViewModel.SolutionItemVM vm, FormCollection collection)
        {
            try
            {
                log.Info(string.Format("{0}: Delete", Framework.LoggingOptions.UI_Process_Started.ToString()));
                var _Response = MSBuildLogsExtended.CommonBLLIoC.IoCSolution.ExistsOfEntityOfByIdentifier(isToCompareIdByIdentifierOftOfByIdentifier, valueToCompareIdByIdentifierOftOfByIdentifier, -1, -1, null);
                if (_Response)
                {
                    MSBuildLogsExtended.DataSourceEntities.Solution entity = vm.Item;
                    MSBuildLogsExtended.CommonBLLIoC.IoCSolution.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_Solution_Index"));
            }
            catch (Exception ex)
            {
                Framework.UIAction uiAction = Framework.UIAction.Delete;
                vm.ContentData.Title     = Framework.Resources.UIStringResource.DeleteAlternativeText;
                vm.ContentData.Summary   = MSBuildLogsExtended.Resources.UIStringResourcePerEntitySolution.Delete_Solution;
                vm.StatusOfResult        = Framework.CommonBLLEntities.BusinessLogicLayerResponseStatus.MessageErrorDetected;
                vm.StatusMessageOfResult = ex.Message;
                vm.UIActionStatusMessage = new Framework.UIActionStatusMessage(typeof(MSBuildLogsExtended.AspNetMvc40ViewModel.SolutionItemVM).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));
            }
        }