private void grv_BG_CellClick(object sender, DataGridViewCellEventArgs e) { int i = e.RowIndex; if (e.RowIndex < 0) { return; } DTO_BangBaoGia grvbg = grv_BG.Rows[i].DataBoundItem as DTO_BangBaoGia; txt_ma_bao_gia.Text = grvbg.ma_bao_gia; txt_dongiachuyen.Text = Convert.ToString(grvbg.don_gia_chuyen); txt_dongiatan.Text = Convert.ToString(grvbg.don_gia_tan); txt_ghichu.Text = grvbg.ghi_chu; //cbb_hopdong.SelectedItem= grvbg.ma_hop_dong; cbb_hopdong.Text = grv_BG.Rows[i].Cells["colHD"].Value.ToString(); txt_noigiao.Text = grvbg.noi_giao; txt_noinhan.Text = grvbg.noi_nhan; //cbb_khuvuc.SelectedItem = grvbg.khu_vuc; //cbb_phanvung.SelectedItem = grvbg.phan_vung; dtpdenngay.Value = Convert.ToDateTime(grvbg.den_ngay); dtptungay.Value = Convert.ToDateTime(grvbg.tu_ngay); EnableControl(false); MethodHelper.ClearErrorProvider(); btn_luu.Enabled = false; btn_sua.Enabled = true; btn_xoa.Enabled = true; }
private void btn_luu_Click(object sender, EventArgs e) { if (!CheckBeforeSave()) { return; } DTO_Xe xe = new DTO_Xe(); xe.ma_so_xe = txt_ma_so_xe.Text; xe.loai_xe = txt_loai_xe.Text; xe.nhan_hieu = txt_nhan_hieu.Text; xe.trong_luong = Convert.ToInt32(txt_trong_luong.Text); xe.ma_tinh_trang = Convert.ToInt32(cbb_tinh_trang.SelectedValue); xe.ngay_tao = DateTime.Now; if (txt_ma_so_xe.Enabled) { dal_xe.Create_Xe(xe); } else { dal_xe.Update_Xe(xe); } BindDataGridView(); ResetControl(); MethodHelper.ClearErrorProvider(); btn_xoa.Enabled = false; btn_sua.Enabled = false; }
private void btn_sua_Click(object sender, EventArgs e) { if (txt_ma_bao_gia.Text.Length > 0) { EnableControl(true); txt_ma_bao_gia.Enabled = false; MethodHelper.ClearErrorProvider(); btn_luu.Enabled = true; } }
private void ResetControl() { txt_phanvung.Text = string.Empty; txt_khuvuc.Text = string.Empty; txt_dongiachuyen.Text = string.Empty; txt_dongiatan.Text = string.Empty; btn_luu.Enabled = true; btn_xoa.Enabled = false; btn_sua.Enabled = false; MethodHelper.ClearErrorProvider(); }
private void ResetControl() { txt_matt.Text = string.Empty; txt_tentt.Text = string.Empty; btn_luu.Enabled = true; btn_xoa.Enabled = false; btn_sua.Enabled = false; txt_tentt.Focus(); MethodHelper.ClearErrorProvider(); }
private void ResetControl() { txt_madieuxe.Text = string.Empty; txt_sotan.Text = string.Empty; txt_noinhan.Text = string.Empty; txt_noigiao.Text = string.Empty; data_ngaydieuxe.Value = DateTime.Now; btn_luu.Enabled = true; btn_xoa.Enabled = false; //btn_sua.Enabled = false; MethodHelper.ClearErrorProvider(); }
private void ResetControl() { txt_ma_so_xe.Text = string.Empty; txt_nhan_hieu.Text = string.Empty; txt_trong_luong.Text = string.Empty; txt_loai_xe.Text = string.Empty; btn_xoa.Enabled = false; btn_luu.Enabled = true; btn_xoa.Enabled = false; MethodHelper.ClearErrorProvider(); }
private void btn_sua_Click(object sender, EventArgs e) { if (txt_ma_khachhang.Text.Length > 0) { EnableControl(true); txt_ma_khachhang.Enabled = false; MethodHelper.ClearErrorProvider(); //cbbRoleId.Items.Clear(); btn_luu.Enabled = true; } }
private void ResetControl() { txt_ma_khachhang.Text = string.Empty; txt_ten_khachhang.Text = string.Empty; txt_sothue.Text = string.Empty; txt_diachi.Text = string.Empty; txt_dienthoai.Text = string.Empty; txt_fax.Text = string.Empty; btn_luu.Enabled = true; btn_xoa.Enabled = false; btn_sua.Enabled = false; txt_ten_khachhang.Focus(); MethodHelper.ClearErrorProvider(); }
private void ResetControl() { txt_ma_nhan_vien.Text = string.Empty; txt_ten_nhan_vien.Text = string.Empty; txt_cmnd.Text = string.Empty; txt_dia_chi.Text = string.Empty; txt_dien_thoai.Text = string.Empty; dt_nam_sinh.Value = DateTime.Now; btn_luu.Enabled = true; btn_xoa.Enabled = false; btn_sua.Enabled = false; txt_ten_nhan_vien.Focus(); MethodHelper.ClearErrorProvider(); }
private void ResetControl() { txt_ma_bao_gia.Text = string.Empty; txt_dongiachuyen.Text = string.Empty; txt_dongiatan.Text = string.Empty; txt_noinhan.Text = string.Empty; txt_noigiao.Text = string.Empty; txt_ghichu.Text = string.Empty; dtpdenngay.Value = DateTime.Now; dtptungay.Value = DateTime.Now; btn_luu.Enabled = true; btn_xoa.Enabled = false; btn_sua.Enabled = false; MethodHelper.ClearErrorProvider(); }
private void grv_ttxe_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex < 0) { return; } DTO_TinhTrangXe KH = grv_ttxe.Rows[e.RowIndex].DataBoundItem as DTO_TinhTrangXe; txt_matt.Text = KH.ma_tinh_trang; txt_tentt.Text = KH.ten_tinh_trang; EnableControl(false); MethodHelper.ClearErrorProvider(); EnableControl(false); MethodHelper.ClearErrorProvider(); btn_luu.Enabled = false; btn_sua.Enabled = true; btn_xoa.Enabled = true; }
private void grv_nhan_vien_CellClick(object sender, DataGridViewCellEventArgs e) { int i = e.RowIndex; if (e.RowIndex < 0) { return; } //if (e.RowIndex == grv_nhan_vien.Rows.Count-1) // return; DTO_NhanVien nhanvien = grv_nhan_vien.Rows[e.RowIndex].DataBoundItem as DTO_NhanVien; txt_ma_nhan_vien.Text = nhanvien.ma_nhan_vien; txt_ten_nhan_vien.Text = nhanvien.ten_nhan_vien; txt_cmnd.Text = nhanvien.cmnd; txt_dia_chi.Text = nhanvien.dia_chi; txt_dien_thoai.Text = nhanvien.dien_thoai; dt_nam_sinh.Value = Convert.ToDateTime(nhanvien.nam_sinh); cbb_chuc_vu.SelectedItem = nhanvien.chucvu.Trim(); // cbb_masoxe.SelectedItem = nhanvien.ma_so_xe.Trim(); cbb_masoxe.Text = grv_nhan_vien.Rows[i].Cells["col_soxe"].Value.ToString(); //cbbMaLoaiTB.Text = dgvDanhSachTB.Rows[curIndex].Cells["colMaLoaiTB"].Value.ToString(); //int i = e.RowIndex; //txt_ma_nhan_vien.Text = grv_nhan_vien.Rows[i].Cells[0].Value.ToString(); //txt_ten_nhan_vien.Text = grv_nhan_vien.Rows[i].Cells[1].Value.ToString(); //txt_cmnd.Text = grv_nhan_vien.Rows[i].Cells[2].Value.ToString(); //txt_dia_chi.Text = grv_nhan_vien.Rows[i].Cells[3].Value.ToString(); //txt_dien_thoai.Text = grv_nhan_vien.Rows[i].Cells[4].Value.ToString(); //dt_nam_sinh.Value = Convert.ToDateTime(grv_nhan_vien.Rows[i].Cells[5].Value.ToString()); //cbb_chuc_vu.SelectedItem = grv_nhan_vien.Rows[i].Cells[6].Value.ToString(); EnableControl(false); MethodHelper.ClearErrorProvider(); btn_luu.Enabled = false; btn_sua.Enabled = true; btn_xoa.Enabled = true; }
private void grv_xe_CellClick(object sender, DataGridViewCellEventArgs e) { int i = e.RowIndex; if (e.RowIndex == 0) { return; } DTO_Xe xe = grv_xe.Rows[e.RowIndex].DataBoundItem as DTO_Xe; txt_ma_so_xe.Text = Convert.ToString(xe.ma_so_xe); txt_loai_xe.Text = xe.loai_xe; txt_nhan_hieu.Text = xe.nhan_hieu; txt_trong_luong.Text = Convert.ToString(xe.trong_luong); cbb_tinh_trang.SelectedValue = xe.ma_tinh_trang.ToString().Trim(); EnableControl(false); MethodHelper.ClearErrorProvider(); btn_luu.Enabled = false; btn_sua.Enabled = true; btn_xoa.Enabled = true; }
private void grv_khachhang_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex < 0) { return; } DTO_KhachHang KH = grv_khachhang.Rows[e.RowIndex].DataBoundItem as DTO_KhachHang; txt_ma_khachhang.Text = KH.ma_khach_hang; txt_ten_khachhang.Text = KH.ten_khach_hang; txt_sothue.Text = KH.ma_so_thue; txt_fax.Text = KH.fax; txt_diachi.Text = KH.dia_chi; txt_dienthoai.Text = KH.dien_thoai; EnableControl(false); MethodHelper.ClearErrorProvider(); //if (e.RowIndex < 0) // return; //if (e.RowIndex == grv_khachhang.Rows.Count - 1) // return; //int i = e.RowIndex; //txt_ma_khachhang.Text = grv_khachhang.Rows[i].Cells[0].Value.ToString(); //txt_ten_khachhang.Text = grv_khachhang.Rows[i].Cells[1].Value.ToString(); //txt_sothue.Text = grv_khachhang.Rows[i].Cells[2].Value.ToString(); //txt_diachi.Text = grv_khachhang.Rows[i].Cells[3].Value.ToString(); //txt_dienthoai.Text = grv_khachhang.Rows[i].Cells[4].Value.ToString(); //txt_fax.Text = grv_khachhang.Rows[i].Cells[5].Value.ToString(); EnableControl(false); MethodHelper.ClearErrorProvider(); btn_luu.Enabled = false; btn_sua.Enabled = true; btn_xoa.Enabled = true; }
private void grv_dichvu_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex < 0) { return; } DTO_DichVu DV = grv_dichvu.Rows[e.RowIndex].DataBoundItem as DTO_DichVu; txt_khuvuc.Text = DV.khu_vuc; txt_phanvung.Text = DV.phan_vung; txt_dongiachuyen.Text = Convert.ToString(DV.don_gia_chuyen); txt_dongiatan.Text = Convert.ToString(DV.don_gia_tan); EnableControl(false); MethodHelper.ClearErrorProvider(); EnableControl(false); MethodHelper.ClearErrorProvider(); btn_luu.Enabled = false; btn_sua.Enabled = true; btn_xoa.Enabled = true; }
private void grv_dieuxe_CellClick(object sender, DataGridViewCellEventArgs e) { int i = e.RowIndex; if (e.RowIndex < 0) { return; } //if (e.RowIndex == grv_nhan_vien.Rows.Count-1) // return; DTO_DieuXe dieuxe = grv_dieuxe.Rows[e.RowIndex].DataBoundItem as DTO_DieuXe; txt_madieuxe.Text = dieuxe.ma_dieu_xe; txt_noigiao.Text = dieuxe.noi_giao; txt_noinhan.Text = dieuxe.noi_nhan; txt_sotan.Text = dieuxe.so_tan; cbb_khachhang.SelectedValue = dieuxe.ma_khach_hang.Trim(); //cbb_soxe.SelectedValue = dieuxe.ma_so_xe.Trim(); cbb_soxe.Text = grv_dieuxe.Rows[i].Cells["col_sx"].Value.ToString(); // cbb_soxe.SelectedIndex = 3; // MessageBox.Show(dieuxe.ma_so_xe.Trim()); data_ngaydieuxe.Value = Convert.ToDateTime(dieuxe.ngay_dieu_xe); if (grv_dieuxe.Rows[i].Cells["ngay_ve"].Value.ToString().Trim() != "01/01/0001 12:00:00 SA") { dtpngayve.Value = Convert.ToDateTime(dieuxe.ngay_ve); //MessageBox.Show(grv_dieuxe.Rows[i].Cells["ngay_ve"].Value.ToString() ); } ; cbtinhtrangthanhtoan.SelectedValue = dieuxe.tinh_trang_thanh_toan == "Chưa Thanh Toán" ? 0 : 1; EnableControl(false); MethodHelper.ClearErrorProvider(); btn_luu.Enabled = false; btn_sua.Enabled = true; btn_xoa.Enabled = true; }