public List <ViewALLCB> TimKiemDangVien(string username, string password, TimKiem tk) { try { authen a = new authen(); bool bAuthen = a.fAuthen(username, password); if (bAuthen) { var ab = (from k in db.ViewALLCBs where (tk.HoTen != "" ? k.HoTenKhaiSinh.Contains(tk.HoTen) : true) && (tk.MaCB != "" ? k.MaCoSoDangQLDangVien.Contains(tk.MaCB) : true) && (tk.GioiTinh != "" ? k.GioiTinh == tk.GioiTinh : true) && (tk.ChuyenMonNghiepVu != "" ? k.ChuyenNganh == tk.ChuyenMonNghiepVu : true) select k).Where(x => x.KhongLaDangVien != 1).ToList(); return(ab); } else { return(null); } } catch (Exception ex) { return(null); } }
public bool XoaCanBo(string username, string password, int MaCB) { try { authen a1 = new authen(); bool bAuthen = a1.fAuthen(username, password); if (bAuthen) { db.CanBoes.Remove(db.CanBoes.FirstOrDefault(a => a.ID == MaCB)); db.SoYeuLyLiches.Remove(db.SoYeuLyLiches.FirstOrDefault(a => a.ID == MaCB)); db.DangViens.Remove(db.DangViens.FirstOrDefault(a => a.ID == MaCB)); db.KyLuats.Remove(db.KyLuats.FirstOrDefault(a => a.ID == MaCB)); db.SaveChanges(); return(true); } else { return(bAuthen); } } catch (Exception ex) { return(false); } }
public List <ViewALLCB> TimKiemCanBo(string username, string password, TimKiem tk) { try { authen a = new authen(); bool bAuthen = a.fAuthen(username, password); if (bAuthen) { return((from k in db.ViewALLCBs where (tk.HoTen != "" ? k.HoTenKhaiSinh.Contains(tk.HoTen) : true) && (tk.MaCB != "" ? k.SoHieuCB.Contains(tk.MaCB) : true) && (tk.GioiTinh != "" ? k.GioiTinh == tk.GioiTinh : true) && (tk.TrinhDoHocVan != "" ? k.TrinhDoHocVan == tk.TrinhDoHocVan : true) && (tk.NgheNghiep != "" ? k.NgheNghiepKhiTuyenDung == tk.NgheNghiep : true) && (tk.ThanhPhanGiaDinh != "" ? k.ThanhPhanGiaDinh == tk.ThanhPhanGiaDinh : true) && (tk.DanToc != "" ? k.DanToc == tk.DanToc : true) && (tk.TonGiao != "" ? k.TonGiao == tk.TonGiao : true) select k).ToList()); } else { return(null); } } catch (Exception ex) { return(null); } }
public bool XoaDangVien(string username, string password, int MaCB) { try { authen a1 = new authen(); bool bAuthen = a1.fAuthen(username, password); if (bAuthen) { CanBo dv = (from c in db.CanBoes where c.ID == MaCB select c).FirstOrDefault(); dv.KhongLaDangVien = 1; db.SaveChanges(); return(true); } else { return(bAuthen); } } catch (Exception ex) { return(false); } }
public bool LuuDangVien(string username, string password, DangVien kh) { try { authen a = new authen(); bool bAuthen = a.fAuthen(username, password); if (bAuthen) { DangVien dv = (from c in db.DangViens where c.ID == kh.ID select c).FirstOrDefault(); bool isInsert = false; if (dv == null) { dv = new DangVien(); isInsert = true; } dv.ID = kh.ID; dv.NgayVaoDang = kh.NgayVaoDang; dv.ChiBoKetNap = kh.ChiBoKetNap; dv.NguoiGioiThieu1 = kh.NguoiGioiThieu1; dv.ChucVuNguoiGioiThieu1 = kh.ChucVuNguoiGioiThieu1; dv.NgheNghiepKhiVaoDang = kh.NgheNghiepKhiVaoDang; dv.NguoiGioiThieu2 = kh.NguoiGioiThieu2; dv.GhiChuVeNguoiGioiThieu2 = kh.GhiChuVeNguoiGioiThieu2; dv.NgayChinhThucVaoDang = kh.NgayChinhThucVaoDang; dv.SoLyLichDangVien = kh.SoLyLichDangVien; dv.SoTheDangVien = kh.SoTheDangVien; dv.MaCoSoDangQLDangVien = kh.MaCoSoDangQLDangVien; dv.ChucVuTrongDang = kh.ChucVuTrongDang; if (isInsert == true) { db.DangViens.Add(dv); } db.SaveChanges(); return(true); } else { return(bAuthen); } } catch (Exception ex) { return(false); } }
public List <DiaPhuong> LoadXa(string username, string password, int?ID) { try { authen a = new authen(); bool bAuthen = a.fAuthen(username, password); if (bAuthen) { return(db.DiaPhuongs.Where(x => x.TYPE == "W" && x.ParentID == ID).ToList()); } else { return(null); } } catch (Exception ex) { return(null); } }
public List <CongViecChinhDangLam> CongViecChinhDangLam(string username, string password) { try { authen a = new authen(); bool bAuthen = a.fAuthen(username, password); if (bAuthen) { return(db.CongViecChinhDangLams.ToList()); } else { return(null); } } catch (Exception ex) { return(null); } }
public List <ViewALLCB> DanhSachCanBo(string username, string password) { try { authen a = new authen(); bool bAuthen = a.fAuthen(username, password); if (bAuthen) { return(db.ViewALLCBs.ToList()); } else { return(null); } } catch (Exception ex) { return(null); } }
public List <TrinhDoQuanLyNhaNuoc> TrinhDoQuanLyNhaNuoc(string username, string password) { try { authen a = new authen(); bool bAuthen = a.fAuthen(username, password); if (bAuthen) { return(db.TrinhDoQuanLyNhaNuocs.ToList()); } else { return(null); } } catch (Exception ex) { return(null); } }
public List <TinhTrangSucKhoe> TinhTrangSucKhoe(string username, string password) { try { authen a = new authen(); bool bAuthen = a.fAuthen(username, password); if (bAuthen) { return(db.TinhTrangSucKhoes.ToList()); } else { return(null); } } catch (Exception ex) { return(null); } }
public List <ThanhPhanGiaDinh> ThanhPhanGiaDinh(string username, string password) { try { authen a = new authen(); bool bAuthen = a.fAuthen(username, password); if (bAuthen) { return(db.ThanhPhanGiaDinhs.ToList()); } else { return(null); } } catch (Exception ex) { return(null); } }
public List <QuanHamCaoNhat> QuanHamCaoNhat(string username, string password) { try { authen a = new authen(); bool bAuthen = a.fAuthen(username, password); if (bAuthen) { return(db.QuanHamCaoNhats.ToList()); } else { return(null); } } catch (Exception ex) { return(null); } }
public List <NgheNghiepKhiTuyenDung> NgheNghiepKhiTuyenDung(string username, string password) { try { authen a = new authen(); bool bAuthen = a.fAuthen(username, password); if (bAuthen) { return(db.NgheNghiepKhiTuyenDungs.ToList()); } else { return(null); } } catch (Exception ex) { return(null); } }
public List <HocVi> HocVi(string username, string password) { try { authen a = new authen(); bool bAuthen = a.fAuthen(username, password); if (bAuthen) { return(db.HocVis.ToList()); } else { return(null); } } catch (Exception ex) { return(null); } }
public List <ViewALLCB> DanhSachDangVien(string username, string password) { try { authen a = new authen(); bool bAuthen = a.fAuthen(username, password); if (bAuthen) { return(db.ViewALLCBs.Where(x => x.KhongLaDangVien != 1).ToList()); } else { return(null); } } catch (Exception ex) { return(null); } }
public bool LuuKyLuat(string username, string password, KyLuat kh) { try { authen a = new authen(); bool bAuthen = a.fAuthen(username, password); if (bAuthen) { KyLuat dv = (from c in db.KyLuats where c.ID == kh.ID select c).FirstOrDefault(); bool isInsert = false; if (dv == null) { dv = new KyLuat(); isInsert = true; } dv.ID = kh.ID; dv.NgayBiKyluat = kh.NgayBiKyluat; dv.LyDoKyLuat = kh.LyDoKyLuat; if (isInsert == true) { db.KyLuats.Add(dv); } db.SaveChanges(); return(true); } else { return(bAuthen); } } catch (Exception ex) { return(false); } }
public List <DiaPhuong> LoadHuyen(string username, string password, int?ID) { try { List <DiaPhuong> dp = new List <DiaPhuong>(); authen a = new authen(); bool bAuthen = a.fAuthen(username, password); if (bAuthen) { dp.Add(new DiaPhuong()); dp.AddRange(db.DiaPhuongs.Where(x => x.TYPE == "D" && x.ParentID == ID).ToList()); return(dp); } else { return(null); } } catch (Exception ex) { return(null); } }
public ViewALLCB GetThongTin1DangVien(string username, string password, int MaCB) { try { authen a = new authen(); bool bAuthen = a.fAuthen(username, password); if (bAuthen) { ViewALLCB DangVien = (from c in db.ViewALLCBs where c.ID == MaCB select c).FirstOrDefault(); return(DangVien); } else { return(null); } } catch (Exception ex) { return(null); } }
public bool ThemCanBo(string username, string password, ViewModel kh) { try { authen a = new authen(); bool bAuthen = a.fAuthen(username, password); if (bAuthen) { SoYeuLyLich ll = new SoYeuLyLich(); ll.ID = kh.ID; ll.HoTenKhaiSinh = kh.HoTenKhaiSinh; ll.TenGoiKhac = kh.TenGoiKhac; ll.NgaySinh = kh.NgaySinh; ll.GioiTinh = kh.GioiTinh; ll.HoKhauThuongTru = kh.HoKhauThuongTru; ll.NoiSinh = kh.NoiSinh; ll.QueQuanTinh = kh.QueQuanTinh; ll.QueQuanHuyen = kh.QueQuanHuyen; ll.QueQuanXa = kh.QueQuanXa; ll.NoiOHienNay = kh.NoiOHienNay; ll.DanToc = kh.DanToc; ll.TonGiao = kh.TonGiao; ll.ThanhPhanGiaDinh = kh.ThanhPhanGiaDinh; ll.TinhTrangHonNhan = kh.TinhTrangHonNhan; ll.SoCMND = kh.SoCMND; ll.NgayCapCMND = kh.NgayCapCMND; ll.NoiCapCMND = kh.NoiCapCMND; ll.Image = kh.Image; ll.Email = kh.Email; ll.SDT = kh.SDT; db.SoYeuLyLiches.Add(ll); db.SaveChanges(); CanBo cb = new CanBo(); cb.ID = db.SoYeuLyLiches.Max(x => x.ID); cb.KhongLaDangVien = 0; cb.NgheNghiepKhiTuyenDung = kh.NgheNghiepKhiTuyenDung; cb.NgayTuyenDung = kh.NgayTuyenDung; cb.TenCoQuanTuyenDung = kh.TenCoQuanTuyenDung; cb.NgayVaoCoQuanHienTai = kh.NgayVaoCoQuanHienTai; cb.NgayNhapNgu = kh.NgayNhapNgu; cb.NgayXuatNgu = kh.NgayXuatNgu; cb.QuanHamCaoNhat = kh.QuanHamCaoNhat; cb.TrinhDoHocVan = kh.TrinhDoHocVan; cb.HocHam = kh.HocHam; cb.HocVi = kh.HocVi; cb.TrinhDoQuanLyNhaNuoc = kh.TrinhDoQuanLyNhaNuoc; cb.TrinhDoLyLuanChinhTri = kh.TrinhDoLyLuanChinhTri; cb.TrinhDoChuyenMonCaoNhat = kh.TrinhDoChuyenMonCaoNhat; cb.ChuyenNganh = kh.ChuyenNganh; cb.TrinhDoTinHoc = kh.TrinhDoTinHoc; cb.TrinhDoNgoaiNguThuNhat = kh.TrinhDoNgoaiNguThuNhat; cb.NgoaiNguThuNhat = kh.NgoaiNguThuNhat; cb.TrinhDoNgoaiNguThuHai = kh.TrinhDoNgoaiNguThuHai; cb.NgoaiNguThuHai = kh.NgoaiNguThuHai; cb.KhenThuong = kh.KhenThuong; cb.KyLuat = kh.KyLuat; cb.TinhTrangSucKhoe = kh.TinhTrangSucKhoe; cb.LaThuongBinh = kh.LaThuongBinh; cb.SoHieuCB = kh.SoHieuCB; cb.DoiTuong = kh.DoiTuong; cb.HuongLuong = kh.HuongLuong; cb.DonViQuanLy = kh.DonViQuanLy; cb.DonViCongTac = kh.DonViCongTac; cb.MaNgachCongChuc = kh.MaNgachCongChuc; cb.NgayHuong = kh.NgayHuong; cb.BacLuong = kh.BacLuong; cb.HeSoLuong = kh.HeSoLuong; cb.ChucVuHienTai = kh.ChucVuHienTai; cb.ChucVuKiemNhiem = kh.ChucVuKiemNhiem; cb.PhuCapChucVu = kh.PhuCapChucVu; cb.CongViecChinhDangLam = kh.CongViecChinhDangLam; db.CanBoes.Add(cb); db.SaveChanges(); return(true); } else { return(bAuthen); } } catch (Exception ex) { return(false); } }