public SaleTicketView()
        {
            InitializeComponent();

            _ticketBusiness = new TicketBusiness(SystemParam.CurrentUser);
            _ticketPriceConfigurationBusiness     = new TicketPriceConfigurationBusiness();
            _ticketReturnFeeConfigurationBusiness = new TicketReturnFeeConfigurationBusiness();
            _ticketSaleDateBusiness = new TicketSaleDateBusiness();
            _tourBusiness           = new TourBusiness();
            _busBusiness            = new BusBusiness();
            _selectedSeatNumbers    = new List <int>();

            btnSearchSeat.Click   += new EventHandler(btnSearchSeat_Click);
            ucSeatMap.LoadSeatInfo = new SeatMap.LoadSeatInfoDelegate(onSeatMapClick);

            this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.GenericView_FormClosed);
        }
Esempio n. 2
0
        public void BindData()
        {
            Ticket firstTicket = ConfirmTickets.FirstOrDefault();

            if (firstTicket != null)
            {
                Bus bus = new BusBusiness().Get(firstTicket.bus_id);
                lblBusNameText.Text       = bus == null ? string.Empty : bus.id;
                lblIDCardNumberText.Text  = firstTicket.passenger_id_card_no;
                lblPassengerNameText.Text = firstTicket.passenger_name;
                lblPhoneNumberText.Text   = firstTicket.phone;
                lblDepartureDateText.Text = String.Format("{0:d/M/yyyy}", firstTicket.departure_time);
            }

            lblSeatNameText.Text = firstTicket.seat_class;
            foreach (var ticket in ConfirmTickets.OrderBy(i => i.seat_number))
            {
                lblSeatNameText.Text += ticket.seat_number + ",";
            }
            lblSeatNameText.Text = lblSeatNameText.Text.Remove(lblSeatNameText.Text.Length - 1);

            tbTotalPayment.Text = CurrencyUtil.ToString(ConfirmTickets.Sum(i => i.cost));
        }