public FileService(FileDataContext context, TicketDataContext ticketDataContext, ITicketBulkService <TicketVariableIncomeModel> ticketService, IHostingEnvironment hostingEnvironment) { this.Context = context; this.TicketDataContext = ticketDataContext; this.HostingEnvironment = hostingEnvironment; this.TicketService = ticketService; }
public TicketExportController( TicketDataContext context, IWorkflowService workflowService, IAuthService authService, TicketFundQuotasController fundQuotaController, TicketPrivateFixedIncomeController privateFixedIncomeController, TicketPublicFixedIncomeController publicFixedIncomeController, TicketFuturesController futuresController, TicketMarginController marginController, TicketContractedController contractedController, TicketCurrencyTermController ticketCurrencyTermController, TicketSwapCetipController swapCetipController, TicketVariableIncomeController variableIncomeController, IExportService exportService ) { this.context = context; this.workflowService = workflowService; this.authService = authService; this.ticketFundQuotaService = fundQuotaController; this.privateFixedService = privateFixedIncomeController; this.publicFixedIncomeService = publicFixedIncomeController; this.futuresService = futuresController; this.marginService = marginController; this.contractedService = contractedController; this.currencyTermService = ticketCurrencyTermController; this.swapCetipService = swapCetipController; this.variableIncomeService = variableIncomeController; this.exportService = exportService; }
public AccountManagerService(TicketDataContext context, IMapper mapper) { if ((this.context = context) == null) { throw new ArgumentNullException("context"); } this.Mapper = mapper; }
public DomainController ( TicketDataContext context, IAuthService authService ) { this.Context = context; this.AuthService = authService; }
public ActionResult Book(string CoachId, string SeatIds) { TicketDataContext dc = new TicketDataContext(); PassengerSessionModel passengerSession = PassengerSessionModel.FromSession(this.Session); Passenger passenger = new Passenger(); if (passengerSession != null) { passenger.Email = passengerSession.Email; passenger.FirstName = passengerSession.FirstName; passenger.LastName = passengerSession.LastName; passenger.Phone = passengerSession.Phone; passenger.RegisterDate = DateTime.Now; } else { return(RedirectToAction("Index", "Home")); } if (!String.IsNullOrEmpty(SeatIds)) { string[] seatIdBooked = SeatIds.Split(','); foreach (string seatId in seatIdBooked) { if (!String.IsNullOrWhiteSpace(seatId)) { Ticket ticket = new Ticket(); Ticket ticketCheck = dc.Tickets.Where(q => q.CoachId == int.Parse(CoachId) && q.SeatId == int.Parse(seatId)).FirstOrDefault(); if (ticketCheck == null) { ticket.CoachId = int.Parse(CoachId); ticket.SeatId = int.Parse(seatId); ticket.Status = Status.Pendding.ToString(); ticket.isNew = true; ticket.CreationDate = DateTime.Now; passenger.Tickets.Add(ticket); } else { return(RedirectToAction("GetInformation", "Information")); } } } } Coach coach = dc.Coaches.Where(q => q.Id == int.Parse(CoachId)).First(); if (passenger != null && passenger.FirstName != null && passenger.Tickets.Count > 0) { dc.Passengers.InsertOnSubmit(passenger); dc.SubmitChanges(); PassengerSessionModel.AbandonPassenger(this.Session); } ViewBag.Coach = coach; return(View(passenger)); }
public TicketController( TicketDataContext context, IWorkflowService workflowService, IAuthService authService, IAccountManagerService accountManagerService ) { this.Context = context; this.WorkflowService = workflowService; this.AuthService = authService; this.AccountManagerService = accountManagerService; }
public ActionResult GetInformation(PassengerViewModel model) { CoachViewModel resuftCoach = new CoachViewModel(); if (model != null && !String.IsNullOrEmpty(model.FirstName)) { PassengerSessionModel.FromSession(this.Session).getPassenger(model); TicketDataContext dc = new TicketDataContext(); List <Coach> coaches = new List <Coach>(); if (model.Hour == null || String.IsNullOrEmpty(model.Hour)) { coaches = dc.Coaches.Where(q => q.StartDate == DateTime.ParseExact(model.StartDate, "dd/MM/yyyy", null)).ToList(); } else { coaches = dc.Coaches.Where(q => q.StartDate == DateTime.ParseExact(model.StartDate, "dd/MM/yyyy", null) && q.StartHour == model.Hour).ToList(); } foreach (Coach coach in coaches) { resuftCoach.Name = coach.Name; resuftCoach.NumberSeat = coach.NumberSeat; resuftCoach.Router = coach.Router; resuftCoach.StartDate = coach.StartDate; resuftCoach.StartHour = coach.StartHour; resuftCoach.Id = coach.Id; for (int i = 0; i < resuftCoach.NumberSeat; i++) { TicketVewModel ticket = new TicketVewModel(); ticket.SeatId = i; resuftCoach.Tickets.Add(ticket); } List <Ticket> tickets = dc.Tickets.Where(q => q.CoachId == resuftCoach.Id).ToList(); if (tickets.Count > 0) { foreach (Ticket ticket in tickets) { resuftCoach.Tickets[ticket.SeatId].Status = ticket.Status; } } break; } } else { return(RedirectToAction("Index", "Home")); } return(View(resuftCoach)); }
public TicketVariableIncomeController( TicketDataContext context, IWorkflowService workflowService, IAccountManagerService accountManagerService, IMapper mapper, TicketListQueryService <TicketVariableIncome, TicketVariableIncomeModel> ticketQueryPaginatedService ) { this.context = context; this.workflowService = workflowService; this.accountManagerService = accountManagerService; this.mapper = mapper; this.ticketQueryPaginatedService = ticketQueryPaginatedService; }
private void SetDependency() { try { using (TicketDataContext dc = new TicketDataContext()) { SqlDependency.Start(dc.Connection.ConnectionString); command = new SqlCommand(textBox1.Text, (SqlConnection)dc.Connection); sqlDepenency = new SqlDependency(command); sqlDepenency.OnChange += new OnChangeEventHandler(sqlDepenency_OnChange); command.Connection.Open(); command.ExecuteReader(); } } catch (Exception e) { listBox1.Items.Add(DateTime.Now.ToString("HH:mm:ss:fff") + e.Message); } }
public TicketSignoffController(TicketDataContext context, IMapper mapper, IAccountManagerService accountManagerService) { this.Context = context; this.Mapper = mapper; this.AccountManagerService = accountManagerService; }
public TicketEventHistoryHandler(TicketDataContext context) { this.context = context; }