コード例 #1
0
        public override void Do(IOleUndoManager pUndoManager)
        {
#if DEBUGUNDOREDO
            Debug.WriteLine(">>> AddActionRecord.Do");
#endif
            using (new ViewModel.ViewModelController.GuiChangeBlock(Controller))
            {
                ViewModel.Action newAction = new ViewModel.Action(Controller, this);
                Controller.StateMachine.Actions.Add(newAction);

                Controller.UndoManager.Add(new DeleteActionRecord(Controller, newAction));
            }
        }
コード例 #2
0
        public override void Do(IOleUndoManager pUndoManager)
        {
#if DEBUGUNDOREDO
            Debug.WriteLine(">>> DeleteActionRecord.Do");
#endif
            using (new ViewModel.ViewModelController.GuiChangeBlock(Controller))
            {
                ViewModel.Action targetAction    = Controller.StateMachine.Actions.Where(e => e.Id == Id).First();
                AddActionRecord  addActionRecord = new AddActionRecord(Controller, targetAction);
                Controller.StateMachine.Actions.Remove(targetAction);

                Controller.UndoManager.Add(addActionRecord);
            }
        }
コード例 #3
0
 private void NewToolWindowActionHandler(object sender, AddingNewItemEventArgs e)
 {
     ViewModel.Action action = ViewModel.Action.Create(ToolWindow.Designer.Model, ToolWindow.Designer.OptionsPage.ActionRootName);
     e.NewItem = new Icons.ToolWindowActionIcon(ToolWindow, action);
 }
コード例 #4
0
        public IActionResult Index(String TicketId, String TicketStatus, String TicketDate,
                                   int ServiceCatId, int SubCatId, String EnvironmentType, String TicketSubStatus, string ResultType)
        {
            try
            {
                if (isAuditor)
                {
                    if (string.IsNullOrWhiteSpace(TicketId) ||
                        string.IsNullOrWhiteSpace(TicketStatus) ||
                        string.IsNullOrWhiteSpace(TicketDate) ||
                        ServiceCatId == 0 || SubCatId == 0)
                    {
                        return(RedirectToAction("Index", "Search"));
                    }

                    var ticketId        = TicketId;
                    var ticketStatus    = TicketStatus;
                    var auditTicketDate = TicketDate.Replace("%2F", "/");
                    var recordDate      = DateTime.Parse(auditTicketDate);
                    var serviceCategory = ServiceCatId;
                    var subCategory     = SubCatId;
                    var environmentType = EnvironmentType;
                    var resultType      = ResultType;

                    var auditMain = _auditToolContext.AuditMain.Where(x => x.TicketId == TicketId &&
                                                                      x.AuditType == environmentType &&
                                                                      x.TicketDate == recordDate &&
                                                                      x.SubcategoryId == subCategory).FirstOrDefault();

                    if (auditMain != null)
                    {
                        return(RedirectToAction("Index", "Search"));
                    }

                    var auditViewModel = new AuditViewModel();
                    auditViewModel.isEscalated = false;

                    var subcategory = _auditToolContext.SubCategory.Where(cat => cat.SubCatgId == subCategory &&
                                                                          cat.CatgId == serviceCategory && cat.IsActive == true).FirstOrDefault();
                    var subCategoryDescription = subcategory != null ? subcategory.SubCatgDescription : String.Empty;

                    var category = _auditToolContext.Category.Where(cat => cat.CatgId == serviceCategory &&
                                                                    cat.IsActive == true).FirstOrDefault();
                    var categoryDescription = category != null ? category.CatgDescription : String.Empty;


                    if (resultType == "Escalated")
                    {
                        auditViewModel.isEscalated = true;
                    }


                    if (ticketStatus == "0")
                    {
                        var ssisTicket = _auditToolContext.TicketsViaSSIS.Where(
                            ssis => ssis.TicketCode == ticketId &&
                            ssis.TicketStatus == "0" &&
                            ssis.ClosedDate == recordDate &&
                            ssis.SubCategory == subCategoryDescription).OrderByDescending(ord => ord.LoadStamp).FirstOrDefault();

                        if (ssisTicket != null)
                        {
                            auditViewModel.Agent34Id = String.IsNullOrWhiteSpace(ssisTicket.CloseUserId) ? "" : ssisTicket.CloseUserId.Substring(0, 7);

                            var hrProff     = _auditToolContext.HROCRoster.Where(hrp => hrp.Employee34IdLowerCase == auditViewModel.Agent34Id).FirstOrDefault();
                            var hrProffName = hrProff != null ? hrProff.EmployeeFullName : String.Empty;

                            auditViewModel.TicketId        = ssisTicket.TicketCode;
                            auditViewModel.AuditorName     = _authService.LoggedInUserInfo().Result.LoggedInFullName;
                            auditViewModel.EnvironmentType = environmentType;
                            auditViewModel.ServiceCatId    = serviceCategory;
                            auditViewModel.SubCatName      = subCategoryDescription;
                            auditViewModel.SupervisorName  = hrProff != null?String.Concat(hrProff.SupervisorLastName, ", ", hrProff.SupervisorFirstName) : String.Empty;

                            auditViewModel.ServiceGroupName = categoryDescription;
                            auditViewModel.SubCatId         = subCategory;
                            auditViewModel.AgentName        = hrProffName;
                            auditViewModel.TicketDate       = (DateTime)ssisTicket.ClosedDate;

                            var listOfValues = _auditToolContext.ListOfValue.Where(x => x.IsActive == true &&
                                                                                   x.CodeType.Trim().ToLower() == "audit cancel reason").ToList();

                            var cancelReason = new List <SelectListItem>
                            {
                                new SelectListItem()
                                {
                                    Text = "--Select--", Value = "0", Selected = true
                                }
                            };
                            foreach (var item in listOfValues)
                            {
                                cancelReason.Add(new SelectListItem()
                                {
                                    Text = item.Code, Value = item.Id.ToString()
                                });
                            }

                            auditViewModel.CancellationReason = cancelReason;

                            var query = _auditToolContext.QuestionBank
                                        .Join(
                                _auditToolContext.QuestionMapping.Where(a => a.SubCatgId == subCategory &&
                                                                        a.IsActive == true),
                                questionBanks => questionBanks.QuestionId,
                                questionMasters => questionMasters.QuestionId,
                                (questionBanks, questionMasters) => new
                            {
                                questionBanks.QuestionId,
                                questionBanks.QuestionName,
                                questionBanks.QuestionDescription,
                                questionMasters.SeqNumber,
                                questionMasters.SubCatgId
                            })
                                        .OrderBy(b => b.SeqNumber)
                                        .Select(x => new QuestionConfigMappingJoinMast
                            {
                                QuestionId          = x.QuestionId,
                                QuestionName        = x.QuestionName,
                                QuestionDescription = x.QuestionDescription,
                                QuestionSeqNumber   = x.SeqNumber
                            }).OrderBy(c => c.QuestionSeqNumber).ToList();

                            List <HCAaudit.Service.Portal.AuditUI.ViewModel.Question> lstQuestionList = new List <HCAaudit.Service.Portal.AuditUI.ViewModel.Question>();

                            foreach (var item in query)
                            {
                                ViewModel.Action objAction = new ViewModel.Action();
                                Impact           objImpact = new Impact
                                {
                                    IsHighImpact = false,
                                    IsLowImpact  = false
                                };
                                objAction.Impact          = objImpact;
                                objAction.IsCompliance    = false;
                                objAction.IsNonCompliance = false;
                                objAction.IsNotApplicable = false;

                                HCAaudit.Service.Portal.AuditUI.ViewModel.Question objQuestion = new HCAaudit.Service.Portal.AuditUI.ViewModel.Question
                                {
                                    QuestionId          = item.QuestionId,
                                    QuestionName        = item.QuestionName,
                                    QuestionDescription = item.QuestionDescription,
                                    QuestionSequence    = item.QuestionSeqNumber,
                                    Action            = objAction,
                                    CorrectionRequire = false
                                };
                                lstQuestionList.Add(objQuestion);
                            }
                            auditViewModel.Question = lstQuestionList;
                        }
                        else
                        {
                            return(RedirectToAction("Index", "Search"));
                        }
                    }
                    else if (ticketStatus == "1")
                    {
                        var ssisTicket = _auditToolContext.TicketsViaSSIS.Where(
                            ssis => ssis.TicketCode == ticketId &&
                            ssis.TicketStatus == "1" &&
                            ssis.CreateDate == recordDate &&
                            ssis.SubCategory == subCategoryDescription).OrderByDescending(ord => ord.LoadStamp).FirstOrDefault();

                        if (ssisTicket != null)
                        {
                            auditViewModel.Agent34Id = String.IsNullOrWhiteSpace(ssisTicket.CreatorUserId) ? "" : ssisTicket.CreatorUserId.Substring(0, 7);

                            var hrProff     = _auditToolContext.HROCRoster.Where(hrp => hrp.Employee34IdLowerCase == auditViewModel.Agent34Id).FirstOrDefault();
                            var hrProffName = hrProff != null ? hrProff.EmployeeFullName : String.Empty;

                            auditViewModel.TicketId         = ssisTicket.TicketCode;
                            auditViewModel.AuditorName      = _authService.LoggedInUserInfo().Result.LoggedInFullName;
                            auditViewModel.EnvironmentType  = environmentType;
                            auditViewModel.ServiceCatId     = serviceCategory;
                            auditViewModel.SubCatName       = subCategoryDescription;
                            auditViewModel.ServiceGroupName = categoryDescription;
                            auditViewModel.ServiceCatId     = serviceCategory;
                            auditViewModel.AgentName        = hrProffName;
                            auditViewModel.TicketDate       = (DateTime)ssisTicket.CreateDate;

                            var listOfValues = _auditToolContext.ListOfValue.Where(x => x.IsActive == true &&
                                                                                   x.CodeType.Trim().ToLower() == "audit cancel reason").ToList();

                            var cancelReason = new List <SelectListItem>
                            {
                                new SelectListItem()
                                {
                                    Text = "--Select--", Value = "0", Selected = true
                                }
                            };
                            foreach (var item in listOfValues)
                            {
                                cancelReason.Add(new SelectListItem()
                                {
                                    Text = item.Code, Value = item.Id.ToString()
                                });
                            }

                            auditViewModel.CancellationReason = cancelReason;

                            var query = _auditToolContext.QuestionBank
                                        .Join(
                                _auditToolContext.QuestionMapping.Where(a => a.SubCatgId == serviceCategory &&
                                                                        a.IsActive == true),
                                questionBanks => questionBanks.QuestionId,
                                questionMasters => questionMasters.QuestionId,
                                (questionBanks, questionMasters) => new
                            {
                                questionBanks.QuestionId,
                                questionBanks.QuestionName,
                                questionBanks.QuestionDescription,
                                questionMasters.SeqNumber,
                                questionMasters.SubCatgId
                            })
                                        .OrderBy(b => b.SeqNumber)
                                        .Select(x => new QuestionConfigMappingJoinMast
                            {
                                QuestionId          = x.QuestionId,
                                QuestionName        = x.QuestionName,
                                QuestionDescription = x.QuestionDescription,
                                QuestionSeqNumber   = x.SeqNumber
                            }).ToList();

                            List <HCAaudit.Service.Portal.AuditUI.ViewModel.Question> lstQuestionList = new List <HCAaudit.Service.Portal.AuditUI.ViewModel.Question>();
                            foreach (var item in query)
                            {
                                ViewModel.Action objAction = new ViewModel.Action();
                                Impact           objImpact = new Impact
                                {
                                    IsHighImpact = false,
                                    IsLowImpact  = false
                                };
                                objAction.Impact          = objImpact;
                                objAction.IsCompliance    = false;
                                objAction.IsNonCompliance = false;
                                objAction.IsNotApplicable = false;

                                HCAaudit.Service.Portal.AuditUI.ViewModel.Question objQuestion = new HCAaudit.Service.Portal.AuditUI.ViewModel.Question
                                {
                                    QuestionId          = item.QuestionId,
                                    QuestionName        = item.QuestionName,
                                    QuestionDescription = item.QuestionDescription,
                                    QuestionSequence    = item.QuestionSeqNumber,
                                    Action            = objAction,
                                    CorrectionRequire = true
                                };
                                lstQuestionList.Add(objQuestion);
                            }
                            auditViewModel.Question = lstQuestionList;
                        }
                        else
                        {
                            return(RedirectToAction("Index", "Search"));
                        }
                    }
                    SessionHelper.SetObjectAsJson(HttpContext.Session, Common.CaseIDSessionKeyName, ticketId);
                    return(View(auditViewModel));
                }
            }
            catch (Exception ex)
            {
                _logger.LogInformation($"Exception in Index method");
                _log.WriteErrorLog(new LogItem {
                    ErrorType = "Error", ErrorSource = "AuditController_Index", ErrorDiscription = ex.InnerException != null ? ex.InnerException.ToString() : ex.Message
                });
            }

            return(RedirectToAction("Index", "Home"));
        }
コード例 #5
0
        internal DeleteActionRecord(ViewModel.ViewModelController controller, ViewModel.Action actionType) : base(ActionTypes.DeleteAction, controller, actionType)
        {
#if DEBUGUNDOREDO
            Debug.WriteLine($@">>> DeleteActionRecord.DeleteActionRecord: Created {UnitDescription} record, ID: {Id}, Name: {Name}");
#endif
        }