private void btnLuu_Click(object sender, EventArgs e) { var result = MessageBox.Show("Bạn có muốn lưu sự thay đổi xuống cơ sở dữ liệu hay không?", "Lưu thông tin", MessageBoxButtons.YesNo); if (result == DialogResult.Yes) { DataUpdate <NhanVien_View> listUpdate = new DataUpdate <NhanVien_View>(); if (getData() != null) { listUpdate.Updates.Add(nv); } else { return; } if (NhanVien_DAL.saves(listUpdate)) { MessageBox.Show("Lưu thông tin thành công!"); Context.getInstance().nv = nv; InitVal(); } else { MessageBox.Show("Lưu thông tin thất bại!"); } } }
public static void Run(NhanVien_DAL NhanVien_DAL, NhanVien_BLL NhanVien_BLL, ArrayList arrayList) { NhanVien_DAL.DocFile(arrayList); int chon; while (true) { Menu(); //chọn chức năng chon = int.Parse(Console.ReadLine()); //nếu nhập = 0 thì dừng chương trình if (chon == 0) { break; } switch (chon) { case 1: NhanVien_BLL.Nhap(arrayList); Console.WriteLine("Nhập phím bất kì để tiếp tục"); NhanVien_DAL.GhiFile(arrayList); Console.ReadLine(); Console.Clear(); break; case 2: NhanVien_BLL.Hien(arrayList); Console.WriteLine("Nhập phím bất kì để tiếp tục"); Console.ReadLine(); Console.Clear(); break; case 3: NhanVien_BLL.Sua(arrayList); Console.WriteLine("Nhập phím bất kì để tiếp tục"); NhanVien_DAL.GhiFile(arrayList); Console.ReadLine(); Console.Clear(); break; case 4: NhanVien_BLL.Xoa(arrayList); Console.WriteLine("Nhập phím bất kì để tiếp tục"); NhanVien_DAL.GhiFile(arrayList); Console.ReadLine(); Console.Clear(); break; case 5: NhanVien_BLL.TimKiem(arrayList); Console.WriteLine("Nhập phím bất kì để tiếp tục"); Console.ReadLine(); Console.Clear(); break; default: break; } } }
private void InitVal() { lstHD = NhanVien_DAL.getAll_NhanVien(); gridControl1.DataSource = lstHD; gridThaoTac = new GridHelper <NhanVien_View>(gridControl1); gridThaoTac.Mapping("MaLoaiNhanVien", LoaiNhanVien_DAL.getAll_LoaiNhanVien()); count_row = 0; }
public static void Chon(ArrayList arrayList) { int chon; while (true) { Menu(); chon = int.Parse(Console.ReadLine()); Console.Clear(); if (chon == 6) { break; } switch (chon) { case 1: NhanVien_BLL.NhapNhanVien(arrayList); NhanVien_DAL.GhiFile(arrayList); Console.ReadKey(); Console.Clear(); break; case 2: NhanVien_BLL.HienThiAll(arrayList); Console.ReadKey(); Console.Clear(); break; case 3: NhanVien_BLL.HienThiAll(arrayList); NhanVien_BLL.TimKiem(arrayList); Console.ReadKey(); Console.Clear(); break; case 4: NhanVien_BLL.HienThiAll(arrayList); NhanVien_BLL.Sua(arrayList); NhanVien_DAL.GhiFile(arrayList); Console.ReadKey(); Console.Clear(); break; case 5: NhanVien_BLL.HienThiAll(arrayList); NhanVien_BLL.Xoa(arrayList); NhanVien_DAL.GhiFile(arrayList); Console.ReadKey(); Console.Clear(); break; default: break; } } }
public static void Run() { int chon; while (true) { Menu(); chon = int.Parse(Console.ReadLine()); Console.Clear(); if (chon == 7) { break; } switch (chon) { case 1: CTCC_DAL.DocFile(ctcc); CTCC_GUI.Chon(ctcc); break; case 2: GiaBan_DAL.DocFile(giaban); GiaBan_GUI.Chon(giaban); break; case 3: KhoXe_DAL.DocFile(khoxe); KhoXe_GUI.Chon(khoxe); break; case 4: NghiepVu_DAL.DocFile(nghiepvu); NghiepVu_GUI.Chon(nghiepvu); break; case 5: NhanVien_DAL.DocFile(nhanvien); NhanVien_GUI.Chon(nhanvien); break; case 6: TinhLuong_DAL.DocFile(tinhluong); TinhLuong_GUI.Chon(tinhluong); break; default: break; } } }
private void btnLogin_Click(object sender, EventArgs e) { Context.getInstance().nv = NhanVien_DAL.get_NhanVien_By_TenDN_And_Pass(textID.Text.Trim(), textPass.Text.Trim()); if (Context.getInstance().nv == null) { MessageBox.Show("Đăng nhập không thành công!"); } else { Context.getInstance().formLogin = this; FormMain fMain = new FormMain(); Context.getInstance().formMain = fMain; fMain.Show(); this.Hide(); } }
public static void Run() { int chon; while (true) { Menu(); chon = int.Parse(Console.ReadLine()); Console.Clear(); if (chon == 6) { break; } switch (chon) { case 1: MatHang_DAL.DocFile(mathang); MatHang_GUI.Chon(mathang); break; case 2: NhanVien_DAL.DocFile(nhanvien); NhanVien_GUI.Chon(nhanvien); break; case 3: GiaBan_DAL.DocFile(giaban); GiaBan_GUI.Chon(giaban); break; case 4: HoaDon_DAL.DocFile(hoadon); HoaDon_GUI.Chon(hoadon); break; case 5: BaoCaoThongKe_DAL.DocFile(thongke); BaoCaoThongKe_GUI.Chon(thongke); break; default: break; } } }
private void btnLuu_Click(object sender, EventArgs e) { var result = MessageBox.Show("Bạn có muốn lưu sự thay đổi xuống cơ sở dữ liệu hay không?", "Lưu thông tin", MessageBoxButtons.YesNo); if (result == DialogResult.Yes) { DataUpdate <NhanVien_View> listUpdate = gridThaoTac.update(); if (NhanVien_DAL.saves(listUpdate)) { MessageBox.Show("Lưu thông tin thành công!"); InitVal(); } else { MessageBox.Show("Lưu thông tin thất bại!"); } } }
public DataTable GetAllAccount() { NhanVien_DAL NhanVien = new NhanVien_DAL(); return(NhanVien.GetAllNhanVien()); }
public bool Login(NhanVien account) { NhanVien_DAL NhanVien = new NhanVien_DAL(); return(NhanVien.Login(account)); }
public NhanVien_View(int c) : base() { MaNhanVien = NhanVien_DAL.get_NhanVienMax(c); }
public static bool XoaNhanVien(NhanVien_DTO nv) { return(NhanVien_DAL.XoaNhanVien(nv)); }
//Sửa 1 giảng viên public static bool SuaNhanVien(NhanVien_DTO nv) { return(NhanVien_DAL.SuaNhanVien(nv)); }
public static int KiemTraMa(string MaNV) => NhanVien_DAL.KiemTraMa(MaNV);
public static List <NhanVien_DTO> HienThiDanhSachNhanVienLeTan() => NhanVien_DAL.HienThiDanhSachNhanVienLeTan();
public static int CapNhatNhanVien(NhanVien_DTO nvDTO) => NhanVien_DAL.CapNhatNhanVien(nvDTO);
public static int XoaNhanVien(string maNV) => NhanVien_DAL.XoaNhanVien(maNV);
public static int ThemNhanVien(NhanVien_DTO nvDTO) => NhanVien_DAL.ThemNhanVien(nvDTO);
public static List <NhanVien_DTO> HienThiDanhSachCacNhanVien(int index) => NhanVien_DAL.HienThiDanhSachCacNhanVien(index);
//Lấy một giảng viên public static NhanVien_DTO TimNhanVienTheoMa(string ma) { return(NhanVien_DAL.TimNhanVienTheoMa(ma)); }
public static List <NhanVien_DTO> LayDSNhanVien() { return(NhanVien_DAL.LayDSNhanVien()); }
public static DataTable LayMaNV(string maNV) => NhanVien_DAL.LayMaNV(maNV);
public static bool ThemNhanVien(NhanVien_DTO nv) { return(NhanVien_DAL.ThemNhanVien(nv)); }
public static DataTable LayThuocTinhNV() => NhanVien_DAL.LayThuocTinhNV();
public static DataTable LayTenNV(string tenNV) => NhanVien_DAL.LayTenNV(tenNV);
public static List <NhanVien_DTO> TimNVTheoTen(string ten) { return(NhanVien_DAL.TimNVTheoTen(ten)); }