Example #1
0
 private void btnLuu_Click(object sender, EventArgs e)
 {
     if (KiemTra())
     {
         Xe xe = new Xe();
         try
         {
             xe.TenChuXe     = txtTenChuXe.Text;
             xe.BienSo       = txtBienSo.Text;
             xe.DiaChi       = txtDiaChi.Text;
             xe.Email        = txtEmail.Text;
             xe.DienThoai    = txtDienThoai.Text;
             xe.HieuXe       = cbHieuXe.SelectedValue.ToString();
             xe.NgayTiepNhan = dateNgayTiepNhan.Text;
             //xe.TienNo = 0;
             XeBUS.Xe_Insert(xe);
             tableTiepNhanXe.DataSource = XeBUS.Xe_DanhSach();
             //tableTiepNhanXe.DataSource = XeBUS.Xe_DSTheoNgay(dateNgayTiepNhan.Text);
             // tableTiepNhanXe.DataSource = XeBUS.Xe_DSTheoNgay(xe.NgayTiepNhan.ToString());
             MessageBox.Show("Nhập thành công !!");
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message);
         }
         finally
         {
             SQLDataProvider.connection.Close();
         }
         btnXoa.Enabled = false;
         //btnThemMoi.Enabled = true;
     }
 }