private void ShowBy() { PrintShowBy(); var input = Console.ReadKey(true).Key; switch (input) { case ConsoleKey.D1: case ConsoleKey.NumPad1: TicketFilter isMoreThanFiveHundred = TicketFilters.IsMoreThanFiveHundred; mgr.PrintWhere(isMoreThanFiveHundred); Console.ReadKey(); break; case ConsoleKey.D2: case ConsoleKey.NumPad2: TicketFilter normalVIPAndMaxVIP = TicketFilters.NormalVIPAndMaxVIP; mgr.PrintWhere(normalVIPAndMaxVIP); Console.ReadKey(); break; case ConsoleKey.D3: case ConsoleKey.NumPad3: MainMenu(); break; } }
public async Task <ActionResult <bool> > BulkDelete([FromBody] List <long> Ids) { if (!ModelState.IsValid) { throw new BindException(ModelState); } TicketFilter TicketFilter = new TicketFilter(); TicketFilter = await TicketService.ToFilter(TicketFilter); TicketFilter.Id = new IdFilter { In = Ids }; TicketFilter.Selects = TicketSelect.Id; TicketFilter.Skip = 0; TicketFilter.Take = int.MaxValue; List <Ticket> Tickets = await TicketService.List(TicketFilter); Tickets = await TicketService.BulkDelete(Tickets); if (Tickets.Any(x => !x.IsValidated)) { return(BadRequest(Tickets.Where(x => !x.IsValidated))); } return(true); }
public async Task <ActionResult <IEnumerable <TicketContractedModel> > > Get( [FromQuery] TicketFilter filter ) { var result = await ListAsync(User.Identity.Name, filter); return(Ok(result)); }
public bool IsEmptyFilter(TicketFilter filter) { if (filter.TicketId == 0 && string.IsNullOrEmpty(filter.PassengerSurname) && string.IsNullOrEmpty(filter.PassengerDocumentValue) && filter.Date == new DateTime()) { return(true); } return(false); }
// GET: Festivals public ActionResult Index(TicketFilter ticketFilter, string sort = "Price", int page = 1) { IQueryable <Ticket> tickets = db.Tickets.Include(x => x.Festival).Include(x => x.TicketType); //sort if (sort == "") { sort = "Price"; } SortTypes sortType = SortTypesDict[sort]; switch (sortType) { case SortTypes.Price: tickets = tickets.OrderBy(x => x.Price); break; case SortTypes.PriceDesc: tickets = tickets.OrderByDescending(x => x.Price); break; case SortTypes.Date: tickets = tickets.OrderBy(x => x.PurchaseDate); break; case SortTypes.DateDesc: tickets = tickets.OrderByDescending(x => x.PurchaseDate); break; } //filter if (ticketFilter.PriceFrom != null) { tickets = tickets.Where(f => f.Price >= ticketFilter.PriceFrom); } if (ticketFilter.PriceTo != null) { tickets = tickets.Where(f => f.Price <= ticketFilter.PriceTo); } if (ticketFilter.DateFrom != null) { tickets = tickets.Where(f => f.PurchaseDate >= ticketFilter.DateFrom); } if (ticketFilter.DateTo != null) { tickets = tickets.Where(f => f.PurchaseDate <= ticketFilter.DateTo); } ViewBag.selectionList = new SelectList(SortTypesDict, "Key", "Key", sort); ViewBag.chosenSort = sort; ViewBag.filter = ticketFilter; return(View(tickets.ToPagedList(page, TicketsPerPage))); }
public MyTicketPage ApplyFilter(TicketFilter filter) { if (!filter.DepartStation.Trim().Equals("")) { new SelectElement(CmbDepartStation).SelectByText(filter.DepartStation); } BtnApplyFilter.Click(); return(this); }
public async Task <ActionResult <int> > Count([FromBody] TicketReport_TicketReportFilterDTO TicketReport_TicketReportFilterDTO) { if (!ModelState.IsValid) { throw new BindException(ModelState); } TicketFilter TicketFilter = ConvertFilterDTOToFilterEntity(TicketReport_TicketReportFilterDTO); return(await TicketService.Count(TicketFilter)); }
private void PrintWhere(TicketFilter filter) { foreach (var ticket in Tickets) { if (filter(ticket)) { Console.WriteLine(ticket.PrintInfo()); } } }
public void PrintWhere(TicketFilter filter) { foreach (var ticket in ListManager.TicketList) { if (filter(ticket)) { Console.WriteLine(ticket.PrintInfo()); } } }
public async Task <ActionResult <PagedResult <TicketCurrencyTermModel> > > ListPaginated( [FromQuery] TicketFilter filter ) { var result = await ListPaginatedAsync( User.Identity.Name, filter ); return(Ok(result)); }
private TicketFilter ConvertFilterDTOToFilterEntity(Ticket_TicketFilterDTO Ticket_TicketFilterDTO) { TicketFilter TicketFilter = new TicketFilter(); TicketFilter.Selects = TicketSelect.ALL; TicketFilter.Skip = Ticket_TicketFilterDTO.Skip; TicketFilter.Take = Ticket_TicketFilterDTO.Take; TicketFilter.OrderBy = Ticket_TicketFilterDTO.OrderBy; TicketFilter.OrderType = Ticket_TicketFilterDTO.OrderType; TicketFilter.Id = Ticket_TicketFilterDTO.Id; TicketFilter.Name = Ticket_TicketFilterDTO.Name; TicketFilter.Phone = Ticket_TicketFilterDTO.Phone; TicketFilter.CustomerId = Ticket_TicketFilterDTO.CustomerId; TicketFilter.UserId = Ticket_TicketFilterDTO.UserId; TicketFilter.CustomerTypeId = Ticket_TicketFilterDTO.CustomerTypeId; TicketFilter.ProductId = Ticket_TicketFilterDTO.ProductId; TicketFilter.ReceiveDate = Ticket_TicketFilterDTO.ReceiveDate; TicketFilter.ProcessDate = Ticket_TicketFilterDTO.ProcessDate; TicketFilter.FinishDate = Ticket_TicketFilterDTO.FinishDate; TicketFilter.Subject = Ticket_TicketFilterDTO.Subject; TicketFilter.Content = Ticket_TicketFilterDTO.Content; TicketFilter.TicketIssueLevelId = Ticket_TicketFilterDTO.TicketIssueLevelId; TicketFilter.TicketPriorityId = Ticket_TicketFilterDTO.TicketPriorityId; TicketFilter.TicketStatusId = Ticket_TicketFilterDTO.TicketStatusId; TicketFilter.TicketSourceId = Ticket_TicketFilterDTO.TicketSourceId; TicketFilter.TicketTypeId = Ticket_TicketFilterDTO.TicketTypeId; TicketFilter.TicketNumber = Ticket_TicketFilterDTO.TicketNumber; TicketFilter.DepartmentId = Ticket_TicketFilterDTO.DepartmentId; TicketFilter.RelatedTicketId = Ticket_TicketFilterDTO.RelatedTicketId; TicketFilter.SLA = Ticket_TicketFilterDTO.SLA; TicketFilter.RelatedCallLogId = Ticket_TicketFilterDTO.RelatedCallLogId; TicketFilter.ResponseMethodId = Ticket_TicketFilterDTO.ResponseMethodId; TicketFilter.StatusId = Ticket_TicketFilterDTO.StatusId; TicketFilter.CreatedAt = Ticket_TicketFilterDTO.CreatedAt; TicketFilter.UpdatedAt = Ticket_TicketFilterDTO.UpdatedAt; TicketFilter.CustomerAgentId = Ticket_TicketFilterDTO.CustomerAgentId; TicketFilter.CustomerRetailId = Ticket_TicketFilterDTO.CustomerRetailId; TicketFilter.TicketResolveTypeId = Ticket_TicketFilterDTO.TicketResolveTypeId; TicketFilter.ResolveContent = Ticket_TicketFilterDTO.ResolveContent; TicketFilter.closedAt = Ticket_TicketFilterDTO.closedAt; TicketFilter.AppUserClosedId = Ticket_TicketFilterDTO.AppUserClosedId; TicketFilter.FirstResponseAt = Ticket_TicketFilterDTO.FirstResponseAt; TicketFilter.LastResponseAt = Ticket_TicketFilterDTO.LastResponseAt; TicketFilter.LastHoldingAt = Ticket_TicketFilterDTO.LastHoldingAt; TicketFilter.ReraisedTimes = Ticket_TicketFilterDTO.ReraisedTimes; TicketFilter.ResolvedAt = Ticket_TicketFilterDTO.ResolvedAt; TicketFilter.AppUserResolvedId = Ticket_TicketFilterDTO.AppUserResolvedId; TicketFilter.SLAPolicyId = Ticket_TicketFilterDTO.SLAPolicyId; TicketFilter.HoldingTime = Ticket_TicketFilterDTO.HoldingTime; TicketFilter.ResolveTime = Ticket_TicketFilterDTO.ResolveTime; return(TicketFilter); }
public List <ITicket> GetAll() { List <ITicket> tickets = new List <ITicket>(); List <TicketDto> dtoList = DalFactory.TicketRepo.GetAll(); List <TicketDto> mergedList = TicketFilter.FilterDuplicateTickets(dtoList); foreach (var dto in mergedList) { _ticket = DtoConverter.ConvertToTicketObject(dto); tickets.Add(_ticket); } return(tickets); }
public async Task <ActionResult> Export([FromBody] TicketReport_TicketReportFilterDTO TicketReport_TicketReportFilterDTO) { if (!ModelState.IsValid) { throw new BindException(ModelState); } //Lấy danh sách Tickets TicketFilter TicketFilter = ConvertFilterDTOToFilterEntity(TicketReport_TicketReportFilterDTO); var Tickets = await TicketService.List(TicketFilter); List <TicketReport_TicketDTO> TicketDTOs = Tickets.Select(p => new TicketReport_TicketDTO(p)).ToList(); TicketReport_TicketReportDTO TicketReport_TicketReportDTO = new TicketReport_TicketReportDTO(); var STT = 1; foreach (var item in TicketDTOs) { item.STT = STT; STT++; } TicketReport_TicketReportDTO.Tickets = TicketDTOs; var maxDate = TicketDTOs.Max(p => p.CreatedAt); var minDate = TicketDTOs.Min(p => p.CreatedAt); DateTime Start = TicketReport_TicketReportFilterDTO.CreatedAt?.GreaterEqual == null ? minDate : TicketReport_TicketReportFilterDTO.CreatedAt.GreaterEqual.Value; DateTime End = TicketReport_TicketReportFilterDTO.CreatedAt?.LessEqual == null ? maxDate : TicketReport_TicketReportFilterDTO.CreatedAt.LessEqual.Value; string path = "Templates/TicketReport.xlsx"; byte[] arr = System.IO.File.ReadAllBytes(path); MemoryStream input = new MemoryStream(arr); MemoryStream output = new MemoryStream(); dynamic Data = new ExpandoObject(); Data.Start = Start.AddHours(CurrentContext.TimeZone).ToString("dd-MM-yyyy"); Data.End = End.AddHours(CurrentContext.TimeZone).ToString("dd-MM-yyyy"); Data.Tickets = TicketReport_TicketReportDTO.Tickets; using (var document = StaticParams.DocumentFactory.Open(input, output, "xlsx")) { document.Process(Data); }; return(File(output.ToArray(), "application/octet-stream", "BaoCaoTicket.xlsx")); }
public async Task <PagedResult <TicketVariableIncomeModel> > ListPaginatedAsync( string username, TicketFilter filter ) { var query = context.TicketVariableIncome .Include(t => t.Ticket) .Include(t => t.LineItems); var result = await ticketQueryPaginatedService.By(query) .Using(filter) .ListPaginatedAsync(username); return(result); }
public Task <ListResponse <ServiceTicketSummary> > GetServiceTicketsAsync(TicketFilter filter, string orgId, ListRequest listRequest) { Expression <Func <ServiceTicket, bool> > mthd = (exp => exp.OwnerOrganization.Id == orgId); if (filter.IsClosed.HasValue) { Expression <Func <ServiceTicket, bool> > closeExpression = (exp => exp.IsClosed == filter.IsClosed); var combined = Expression.And(mthd, closeExpression); mthd = Expression.Lambda <Func <ServiceTicket, bool> >(combined); } if (!String.IsNullOrEmpty(filter.StatusKey)) { Expression <Func <ServiceTicket, bool> > closeExpression = (exp => exp.Status != null && exp.Status.Id == filter.StatusKey); var combined = Expression.And(mthd, closeExpression); mthd = Expression.Lambda <Func <ServiceTicket, bool> >(combined); } if (!String.IsNullOrEmpty(filter.TemplateId)) { Expression <Func <ServiceTicket, bool> > closeExpression = (exp => exp.Template != null && exp.Template.Id == filter.TemplateId); var combined = Expression.And(mthd, closeExpression); mthd = Expression.Lambda <Func <ServiceTicket, bool> >(combined); } if (!String.IsNullOrEmpty(filter.UserId)) { Expression <Func <ServiceTicket, bool> > closeExpression = (exp => exp.AssignedTo != null && exp.AssignedTo.Id == filter.TemplateId); var combined = Expression.And(mthd, closeExpression); mthd = Expression.Lambda <Func <ServiceTicket, bool> >(combined); } if (!String.IsNullOrEmpty(filter.DeviceId)) { Expression <Func <ServiceTicket, bool> > closeExpression = (exp => exp.Device != null && exp.Device.Id == filter.TemplateId); var combined = Expression.And(mthd, closeExpression); mthd = Expression.Lambda <Func <ServiceTicket, bool> >(combined); } if (!String.IsNullOrEmpty(filter.ServiceBoardId)) { Expression <Func <ServiceTicket, bool> > closeExpression = (exp => exp.ServiceBoard != null && exp.ServiceBoard.Id == filter.ServiceBoardId); var combined = Expression.And(mthd, closeExpression); mthd = Expression.Lambda <Func <ServiceTicket, bool> >(combined); } return(GetServiceTickets(mthd, listRequest)); }
public async Task <ActionResult <TicketReport_TicketReportDTO> > List([FromBody] TicketReport_TicketReportFilterDTO TicketReport_TicketReportFilterDTO) { if (!ModelState.IsValid) { throw new BindException(ModelState); } TicketFilter TicketFilter = ConvertFilterDTOToFilterEntity(TicketReport_TicketReportFilterDTO); //Lấy danh sách Tickets var Tickets = await TicketService.List(TicketFilter); List <TicketReport_TicketDTO> TicketDTOs = Tickets.Select(p => new TicketReport_TicketDTO(p)).ToList(); TicketReport_TicketReportDTO TicketReport_TicketReportDTO = new TicketReport_TicketReportDTO(); TicketReport_TicketReportDTO.Tickets = TicketDTOs; return(TicketReport_TicketReportDTO); }
private IQueryable <E> GetData(string username, TicketFilter filter) { var accountManager = accountManagerService.GetAccountManager(username); if (filter.StatusId == -1) { query = query.Where(t => t.Ticket.WorkflowId == null); } else if (filter.StatusId > 0) { var status = GetWorkflowStatus(); query = query.ByWorkflows(status.Select(s => s.WorkflowId)); } return(query.ApplyFilter(filter, accountManager)); }
public void TC15_UserFilterWithDepartStation() { Console.WriteLine("TC15 - User can filter \"Manager ticket\" table with Depart Station"); //1. Navigate to QA Railway Website HomePage homePage = new HomePage(); homePage.Open(); //2. Login with a valid account LoginPage loginPage = homePage.GoToLoginPage(); homePage = loginPage.Login(user.Email, user.Password); //3. Book more than 6 tickets with different Depart Stations string[] departStations = { "Sài Gòn", "Phan Thiết", "Nha Trang", "Đà Nẵng", "Quảng Ngãi", "Huế" }; for (int i = 0; i < 6; i++) { //Book a ticket BookTicketPage bookTicketPage = homePage.GoToBookTicketPage(); DateTime dateTime = DateTime.Now.AddDays(5); Ticket ticket = new Ticket(); ticket.DepartDate = dateTime.ToString("M/d/yyyy"); ticket.DepartStation = departStations[i]; ticket.SeatType = "Soft bed with air conditioner"; ticket.Amount = "1"; BookTicketSuccessPage bookTicketSuccessPage = bookTicketPage.BookTicket(ticket); } //4. Click on "My ticket" tab //5. Select one of booked Depart Station in "Depart Station" dropdown list //6. Click "Apply filter" button //VP. "Manage ticket" table shows correct ticket(s) TicketFilter ticketFilter = new TicketFilter(); ticketFilter.DepartStation = "Nha Trang"; MyTicketPage myTicketPage = homePage.GoToMyTicketPage().ApplyFilter(ticketFilter); Assert.IsTrue(myTicketPage.CheckTicketsExistWithFilter(ticketFilter)); //Clean-up: Cancel all tickets myTicketPage.GoToMyTicketPage().CancelAllTickets(); }
public async Task <ActionResult <List <Ticket_TicketDTO> > > List([FromBody] Ticket_TicketFilterDTO Ticket_TicketFilterDTO) { if (!ModelState.IsValid) { throw new BindException(ModelState); } TicketFilter TicketFilter = ConvertFilterDTOToFilterEntity(Ticket_TicketFilterDTO); TicketFilter = await TicketService.ToFilter(TicketFilter); List <Ticket> Tickets = await TicketService.List(TicketFilter); List <Ticket_TicketDTO> Ticket_TicketDTOs = Tickets .Select(c => new Ticket_TicketDTO(c)).ToList(); return(Ticket_TicketDTOs); }
public static IQueryable <T> ApplyFilter <T>(this IQueryable <T> source, TicketFilter filter, AccountManager accountManager) where T : ITicketable { if (filter.StartDate != null) { source = source.Where(t => t.Ticket.OperationDate >= filter.StartDate.Value); } if (filter.EndDate != null) { source = source.Where(t => t.Ticket.OperationDate <= filter.EndDate.Value.EndOfDay()); } if (filter.PortfolioCode != null) { source = source.Where(t => t.Ticket.Portfolio.Code.Contains(filter.PortfolioCode)); } if (filter.PortfolioName != null) { source = source.Where(t => t.Ticket.Portfolio.Name.Contains(filter.PortfolioName)); } if (filter.PortfolioDocument != null) { source = source.Where(t => t.Ticket.Portfolio.Document.Contains(filter.PortfolioDocument)); } if (filter.TicketId != null) { source = source.Where(t => t.Ticket.Id == filter.TicketId.Value); } if (accountManager != null) { source = source.Where(t => t.Ticket.AccountManager.Id == accountManager.Id); } else if (filter.AccountManagerId != null) { source = source.Where(t => t.Ticket.AccountManager.Id == filter.AccountManagerId.Value); } return(source); }
public async Task <List <Ticket_TicketDTO> > SingleListTicket([FromBody] Ticket_TicketFilterDTO Ticket_TicketFilterDTO) { if (!ModelState.IsValid) { throw new BindException(ModelState); } TicketFilter TicketFilter = new TicketFilter(); TicketFilter.Skip = 0; TicketFilter.Take = 20; TicketFilter.OrderBy = TicketOrder.Id; TicketFilter.OrderType = OrderType.ASC; TicketFilter.Selects = TicketSelect.ALL; TicketFilter.Id = Ticket_TicketFilterDTO.Id; TicketFilter.Name = Ticket_TicketFilterDTO.Name; TicketFilter.Phone = Ticket_TicketFilterDTO.Phone; TicketFilter.CustomerId = Ticket_TicketFilterDTO.CustomerId; TicketFilter.UserId = Ticket_TicketFilterDTO.UserId; TicketFilter.ProductId = Ticket_TicketFilterDTO.ProductId; TicketFilter.ReceiveDate = Ticket_TicketFilterDTO.ReceiveDate; TicketFilter.ProcessDate = Ticket_TicketFilterDTO.ProcessDate; TicketFilter.FinishDate = Ticket_TicketFilterDTO.FinishDate; TicketFilter.Subject = Ticket_TicketFilterDTO.Subject; TicketFilter.Content = Ticket_TicketFilterDTO.Content; TicketFilter.TicketIssueLevelId = Ticket_TicketFilterDTO.TicketIssueLevelId; TicketFilter.TicketPriorityId = Ticket_TicketFilterDTO.TicketPriorityId; TicketFilter.TicketStatusId = Ticket_TicketFilterDTO.TicketStatusId; TicketFilter.TicketSourceId = Ticket_TicketFilterDTO.TicketSourceId; TicketFilter.TicketNumber = Ticket_TicketFilterDTO.TicketNumber; TicketFilter.DepartmentId = Ticket_TicketFilterDTO.DepartmentId; TicketFilter.RelatedTicketId = Ticket_TicketFilterDTO.RelatedTicketId; TicketFilter.SLA = Ticket_TicketFilterDTO.SLA; TicketFilter.RelatedCallLogId = Ticket_TicketFilterDTO.RelatedCallLogId; TicketFilter.ResponseMethodId = Ticket_TicketFilterDTO.ResponseMethodId; TicketFilter.StatusId = Ticket_TicketFilterDTO.StatusId; List <Ticket> Tickets = await TicketService.List(TicketFilter); List <Ticket_TicketDTO> Ticket_TicketDTOs = Tickets .Select(x => new Ticket_TicketDTO(x)).ToList(); return(Ticket_TicketDTOs); }
public async Task <ActionResult <int> > CountTicket([FromBody] Customer_TicketFilterDTO Customer_TicketFilterDTO) { if (UnAuthorization) { return(Forbid()); } if (!ModelState.IsValid) { throw new BindException(ModelState); } TicketFilter TicketFilter = ConvertFilterTicket(Customer_TicketFilterDTO); TicketFilter = await TicketService.ToFilter(TicketFilter); int count = await TicketService.Count(TicketFilter); return(count); }
public async Task <bool> ValidateId(Ticket Ticket) { TicketFilter TicketFilter = new TicketFilter { Skip = 0, Take = 10, Id = new IdFilter { Equal = Ticket.Id }, Selects = TicketSelect.Id }; int count = await UOW.TicketRepository.Count(TicketFilter); if (count == 0) { Ticket.AddError(nameof(TicketValidator), nameof(Ticket.Id), ErrorCode.IdNotExisted); } return(count == 1); }
private TicketFilter ConvertFilterDTOToFilterEntity(TicketReport_TicketReportFilterDTO TicketReport_TicketReportFilterDTO) { TicketFilter TicketFilter = new TicketFilter(); TicketFilter.Selects = TicketSelect.ALL; TicketFilter.Skip = TicketReport_TicketReportFilterDTO.Skip; TicketFilter.Take = TicketReport_TicketReportFilterDTO.Take; TicketFilter.OrderType = TicketReport_TicketReportFilterDTO.OrderType; TicketFilter.TicketNumber = TicketReport_TicketReportFilterDTO.TicketNumber; TicketFilter.TicketTypeId = TicketReport_TicketReportFilterDTO.TicketTypeId; TicketFilter.TicketGroupId = TicketReport_TicketReportFilterDTO.TicketGroupId; TicketFilter.TicketStatusId = TicketReport_TicketReportFilterDTO.TicketStatusId; TicketFilter.SLAStatusId = TicketReport_TicketReportFilterDTO.SLAStatusId; TicketFilter.TicketPriorityId = TicketReport_TicketReportFilterDTO.TicketPriorityId; TicketFilter.CustomerTypeId = TicketReport_TicketReportFilterDTO.CustomerTypeId; TicketFilter.CustomerId = TicketReport_TicketReportFilterDTO.CustomerId; TicketFilter.UserId = TicketReport_TicketReportFilterDTO.UserId; TicketFilter.CreatedAt = TicketReport_TicketReportFilterDTO.CreatedAt; return(TicketFilter); }
public async Task <ActionResult <List <Customer_TicketDTO> > > ListTicket([FromBody] Customer_TicketFilterDTO Customer_TicketFilterDTO) { if (UnAuthorization) { return(Forbid()); } if (!ModelState.IsValid) { throw new BindException(ModelState); } TicketFilter TicketFilter = ConvertFilterTicket(Customer_TicketFilterDTO); TicketFilter = await TicketService.ToFilter(TicketFilter); List <Ticket> Tickets = await TicketService.List(TicketFilter); List <Customer_TicketDTO> Customer_TicketDTOs = Tickets .Select(c => new Customer_TicketDTO(c)).ToList(); return(Customer_TicketDTOs); }
public async Task <IEnumerable <TicketVariableIncomeModel> > ListAsync( string username, TicketFilter filter ) { var accountManager = accountManagerService.GetAccountManager(username); var query = context.TicketVariableIncome .AsNoTracking() .ApplyFilter(filter, accountManager) .Include(t => t.LineItems) .Include(t => t.Ticket); var data = await query.ToListAsync(); if (data.Count == 0) { return(await Task.FromResult(new TicketVariableIncomeModel[] { })); } var ids = data .Where(d => d.Ticket.WorkflowId != null) .Select(d => (int)d.Ticket.WorkflowId); var workflowDetails = (await workflowService.GetWorkflowsDetailAsync(ids)).ToDictionary(kvp => kvp.WorkflowId, kvp => kvp); var result = data .Select(ticket => { var mapped = mapper.Map <TicketVariableIncomeModel>(ticket); mapped.MapWorkflowData(workflowDetails, ticket.Ticket.WorkflowId); return(mapped); }) .FilterWorkflowStatus(filter.StatusId); return(result.ToList()); }
private async Task <bool> HasPermission(long Id) { TicketFilter TicketFilter = new TicketFilter(); TicketFilter = await TicketService.ToFilter(TicketFilter); if (Id == 0) { } else { TicketFilter.Id = new IdFilter { Equal = Id }; int count = await TicketService.Count(TicketFilter); if (count == 0) { return(false); } } return(true); }
public async Task <ActionResult <PagedResult <TicketSwapCetipModel> > > ListPaginated( [FromQuery] TicketFilter filter ) { try { var result = await ListPaginatedAsync( User.Identity.Name, filter ); return(Ok(result)); } catch (Exception ex) { if (ex.Message == "not-found") { return(NotFound()); } throw; } }
public async Task <List <Ticket> > List(TicketFilter TicketFilter) { try { List <Ticket> Tickets = await UOW.TicketRepository.List(TicketFilter); return(Tickets); } catch (Exception ex) { if (ex.InnerException == null) { await Logging.CreateSystemLog(ex, nameof(TicketService)); throw new MessageException(ex); } else { await Logging.CreateSystemLog(ex.InnerException, nameof(TicketService)); throw new MessageException(ex.InnerException); } } }
public async Task <int> Count(TicketFilter TicketFilter) { try { int result = await UOW.TicketRepository.Count(TicketFilter); return(result); } catch (Exception ex) { if (ex.InnerException == null) { await Logging.CreateSystemLog(ex, nameof(TicketService)); throw new MessageException(ex); } else { await Logging.CreateSystemLog(ex.InnerException, nameof(TicketService)); throw new MessageException(ex.InnerException); } } }
/// <summary> /// Searches the filter tickets. /// </summary> /// <param name="ticketFilter">The ticket filter.</param> /// <param name="userId">The user identifier.</param> /// <param name="currentDate">current date identifier</param> /// <returns> /// ticket list /// </returns> public IList<Ticket> SearchFilterTickets(TicketFilter ticketFilter, int userId, string currentDate) { var items = this.ticketRepository.SearchFilterTickets(SerializeExtensions.XmlSerializerMethod(ticketFilter), userId); return this.GetTicketCollection(userId.ToString(CultureInfo.CurrentCulture), currentDate, items); }
/// <summary> /// Retrieves the open ticket advance comment details. /// </summary> /// <param name="ticketFilter">The ticket filter.</param> /// <param name="userId">The user identifier.</param> /// <returns>return ticket comment section details</returns> public IList<TicketCommentDetails> RetrieveOpenTicketAdvanceCommentDetails(TicketFilter ticketFilter, int? userId) { return this.ticketRepository.RetrieveOpenTicketAdvanceCommentDetails(SerializeExtensions.XmlSerializerMethod(ticketFilter), userId).ToList(); }