private void SetThongTinLoaiXe2(string loaiXe)
 {
     if (!string.IsNullOrEmpty(loaiXe) && loaiXe != "0")
     {
         StaxiCarType temp = CommonBL.ListStaxiLoaiXe.FirstOrDefault(a => a.StaxiType.ToString() == loaiXe);
         if (temp.Seat == 4)
         {
             chk4Cho.Checked = true;
         }
         else if (temp.Seat == 7)
         {
             chk7Cho.Checked = true;
         }
     }
     else
     {
         chk4Cho.Checked = false;
         chk7Cho.Checked = false;
     }
 }
Esempio n. 2
0
        private void btnSave_Click(object sender, System.EventArgs e)
        {
            int row = 0;

            row = gridViewLoaiXe.FocusedRowHandle;
            var dataRow = ((List <StaxiCarType>)gridLoaiXe.DataSource)[row];

            if (dataRow != null && CheckValidate())
            {
                _carType          = new StaxiCarType();
                _carType          = (StaxiCarType)dataRow.Clone();
                _carType.Name     = txtName.Text;
                _carType.IsActive = (int)inputIsActive.EditValue == 1;
                _carType.Type     = (Taxi.Utils.StaxiCarType_Type)txtType.Text.To <int>();
                _carType.Seat     = txtSeat.Text.To <int>();
                _carType.OrderBy  = txtOrderBy.Text.To <int>();
                _carType.Update();
                DisplayMessage("Sửa thông tin loại xe thành công!", Color.Blue);
                gridLoaiXe.DataSource = CommonBL.ListStaxiLoaiXe.OrderBy(a => a.Seat).ThenBy(b => b.OrderBy).ToList();
            }
        }