private void BindControls()
        {
            TripController tripController = new TripController();
            TripInfo       tripInfo       = tripController.SelectByTripID(this.cboTrip.SelectedValue.ToString());

            string date = Convert.ToString(tripInfo.TripDate);

            this.txtTripDate.Text = date.Substring(0, 10);
            this.txtTime.Text     = (tripInfo.Time);
        }
Example #2
0
        private void BindTripComboBox()
        {
            TripController tripController = new TripController();
            TripInfo       tripInfo       = tripController.SelectByTripID(this.cboTripCode.SelectedValue.ToString());

            this.cboTripCode.SelectedValue = tripInfo.TripID;
            this.cboRoute.SelectedValue    = tripInfo.RouteID;
            this.dtpDate.Text          = Convert.ToString(tripInfo.TripDate);
            this.cboTime.SelectedValue = tripInfo.TimeID;
            this.txtPrice.Text         = Convert.ToString(tripInfo.Price);
            decimal price = Convert.ToDecimal(this.txtPrice.Text);

            this.txtPrice.Text = price.ToString("N");
            this.cboBusNumber.SelectedValue = tripInfo.BusID;
            string seat = tripController.SelectTotalSeat(this.cboBusNumber.SelectedValue.ToString());

            this.txtTotalSeat.Text        = seat;
            this.cboDriver1.SelectedValue = tripInfo.Driver1ID;
            this.cboDriver2.SelectedValue = tripInfo.Driver2ID;
        }