private void btnXeChuaNhapDuThongTin_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { try { NhatkyThuebao NhatkyThuebaoControl = new NhatkyThuebao(); DataTable dt = NhatkyThuebaoControl.GetDSNhungCuocChuaNhapDuThongTin(); gridNhanVien.DataSource = dt; } catch (Exception ex) { LogError.WriteLogError("btnXeChuaNhapDuThongTin: ", ex); } }
private void cmdAdd_CommandClick(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e) { //cmdNew cmdEdit cmdDelete cmdExit cmdHelp if (e.Command.Key == "cmdThemMoi") { frmNhapNhatKyThueBao frmNhapNhatKyThueBaocontrol = new frmNhapNhatKyThueBao(); frmNhapNhatKyThueBaocontrol.ShowDialog(); LoadDSThueBao(); } else if (e.Command.Key == "cmdEdit") { } else if (e.Command.Key == "cmdXoa") { grdNhanVien.SelectionMode = Janus.Windows.GridEX.SelectionMode.SingleSelection; if (grdNhanVien.SelectedItems.Count > 0) { if (ThongTinDangNhap.USER_ID == "admin" || ThongTinDangNhap.HasPermission(DanhSachQuyen.UpdateThueBaoTuyen)) { MessageBox.MessageBox msgBox = new Taxi.MessageBox.MessageBox(); if (msgBox.Show(this, "Bạn có đồng ý xóa không ?", "Thông báo", Taxi.MessageBox.MessageBoxButtons.YesNoCancel, Taxi.MessageBox.MessageBoxIcon.Question) == DialogResult.Yes.ToString()) { GridEXRow row = ((GridEXSelectedItem)grdNhanVien.SelectedItems[0]).GetRow(); int ID = Convert.ToInt32(row.Cells["ID"].Text); // ID cua ban ghi NhatkyThuebao NhatkyThuebaoControl = new NhatkyThuebao(); int So = NhatkyThuebaoControl.Delete(ID); if (So > 0) { new MessageBox.MessageBox().Show(" xóa thành công"); // NhatkyThuebao NhatkyThuebaoControl = new NhatkyThuebao(); DataTable dt = NhatkyThuebaoControl.GetAll(); grdNhanVien.DataMember = "ID"; grdNhanVien.SetDataBinding(dt, "ID"); } else { new MessageBox.MessageBox().Show("xóa không thành công"); } } } else { new MessageBox.MessageBox().Show("Chỉ có quản trị hệ thống mới được xóa."); } } } else if (e.Command.Key == "cmdXeChuaNhapDuDuLieu") { NhatkyThuebao NhatkyThuebaoControl = new NhatkyThuebao(); DataTable dt = NhatkyThuebaoControl.GetDSNhungCuocChuaNhapDuThongTin(); grdNhanVien.DataMember = "lID"; grdNhanVien.SetDataBinding(dt, "lID"); } else if (e.Command.Key == "cmdXeNhapDu") { LoadDSThueBao(); } else if (e.Command.Key == "cmdTimKiem") { frmTimKiemXeThueBao frm = new frmTimKiemXeThueBao(); if (frm.ShowDialog() == DialogResult.OK) { NhatkyThuebao NhatkyThuebaoControl = new NhatkyThuebao(); DataTable dt = NhatkyThuebaoControl.GetDSCuocThuebao(frm.TuNgay(), frm.DenNgay(), frm.SoHieuXe(), frm.NoiDungTimKhac()); grdNhanVien.DataMember = "lID"; grdNhanVien.SetDataBinding(dt, "lID"); } } else if (e.Command.Key == "cmdThoat") { this.Close(); } }