Example #1
0
        private string GetTicketsOnSearch(SearchTicketModel searchModel, int CreatedBy, int TenantID, string ConString)
        {
            List <SearchResponse> _searchResult = null;
            string SearchOutputFileName         = null;

            try
            {
                exceptions.FileText("Step BAL 6 Start");

                _searchResult = getdata.GetTicketsOnSearch(searchModel, ConString);

                SearchOutputFileName = StoreReportCreateExcel(_searchResult, CreatedBy, TenantID, "Tickets", "totalpages,ClaimStatus,createdago,assignedago,updatedago,responseTimeRemainingBy,responseOverdueBy,resolutionOverdueBy");

                exceptions.FileText("Step BAL 6 End");
            }
            catch (Exception ex)
            {
                exceptions.SendErrorToText(ex);
            }
            return(SearchOutputFileName);
        }
Example #2
0
        public void GetScheduleDetails(string ConString)
        {
            try
            {
                exceptions.FileText("Step BAL 1 Start");

                List <TicketScheduleModal> ListTicketScheduleModal = new List <TicketScheduleModal>();
                ListTicketScheduleModal = getdata.getScheduleDetails(ConString);

                if (ListTicketScheduleModal.Count > 0)
                {
                    for (int i = 0; i < ListTicketScheduleModal.Count; i++)
                    {
                        if (!String.IsNullOrEmpty(ListTicketScheduleModal[i].SearchInputParams))
                        {
                            if (ListTicketScheduleModal[i].ScheduleFrom == 0)
                            {
                                SearchInputModel searchparams = JsonConvert.DeserializeObject <SearchInputModel>(ListTicketScheduleModal[i].SearchInputParams);
                                searchparams.curentUserId = ListTicketScheduleModal[i].CreatedBy;
                                searchparams.TenantID     = ListTicketScheduleModal[i].TenantID;
                                ListTicketScheduleModal[i].SearchOutputFileName = DashBoardSearchTicket(searchparams, ListTicketScheduleModal[i].CreatedBy, ListTicketScheduleModal[i].TenantID, ConString);
                                ListTicketScheduleModal[i].Alert_TypeID         = (int)EnumMaster.Alert_TypeID.Dashboard;
                            }
                            if (ListTicketScheduleModal[i].ScheduleFrom == 2)
                            {
                                SearchTicketModel searchparams = JsonConvert.DeserializeObject <SearchTicketModel>(ListTicketScheduleModal[i].SearchInputParams);
                                searchparams.AssigntoId = ListTicketScheduleModal[i].CreatedBy;
                                searchparams.TenantID   = ListTicketScheduleModal[i].TenantID;
                                ListTicketScheduleModal[i].SearchOutputFileName = GetTicketsOnSearch(searchparams, ListTicketScheduleModal[i].CreatedBy, ListTicketScheduleModal[i].TenantID, ConString);
                                ListTicketScheduleModal[i].Alert_TypeID         = (int)EnumMaster.Alert_TypeID.Ticket;
                            }
                            if (ListTicketScheduleModal[i].ScheduleFrom == 3)
                            {
                                ReportSearchModel searchparams = new ReportSearchModel();
                                searchparams.reportSearch = JsonConvert.DeserializeObject <ReportSearchData>(ListTicketScheduleModal[i].SearchInputParams);
                                searchparams.curentUserId = ListTicketScheduleModal[i].CreatedBy;
                                searchparams.TenantID     = ListTicketScheduleModal[i].TenantID;
                                ListTicketScheduleModal[i].SearchOutputFileName = GetReportSearch(searchparams, ListTicketScheduleModal[i].CreatedBy, ListTicketScheduleModal[i].TenantID, ConString);
                                ListTicketScheduleModal[i].Alert_TypeID         = (int)EnumMaster.Alert_TypeID.Report;
                            }


                            ListTicketScheduleModal[i].SMTPDetails = getdata.GetSMTPDetails(ListTicketScheduleModal[i].TenantID, ConString);

                            getdata.GetMailContent(ListTicketScheduleModal[i]);
                        }
                    }
                }

                if (ListTicketScheduleModal.Count > 0)
                {
                    for (int i = 0; i < ListTicketScheduleModal.Count; i++)
                    {
                        if (!String.IsNullOrEmpty(ListTicketScheduleModal[i].SearchInputParams))
                        {
                            Task t = ProcessToSendMail(ListTicketScheduleModal[i]);
                            t.Wait();
                        }
                    }
                }

                exceptions.FileText("Step BAL 1 End");
            }
            catch (Exception ex)
            {
                exceptions.SendErrorToText(ex);
            }
        }