Пример #1
0
        public int themTrinhDoChuyenMon(TrinhDoChuyenMon_DTO tdcm)
        {
            int check = (from t in db.TRINHDOCHUYENMON6s
                         where t.NGANH == tdcm.Nganh
                         select t).Count();

            if (check != 0)
            {
                return(0);
            }

            TRINHDOCHUYENMON6 td = new TRINHDOCHUYENMON6
            {
                MANV       = tdcm.Manv,
                NGANH      = tdcm.Nganh,
                LOAIHINHDT = tdcm.LoaiHinhDT,
                TRUONGDT   = tdcm.TruongDT,
                TRINHDO    = tdcm.TrinhDo
            };

            db.TRINHDOCHUYENMON6s.InsertOnSubmit(td);
            db.SubmitChanges();

            return(1);
        }
        public void themNVCV_DAO(QuanLyNhanVienChucVu_DTO nvcv)
        {
            NHANVIEN_CHUCVU6 iNHANVIEN_CHUCVU6s = new NHANVIEN_CHUCVU6
            {
                MANV    = nvcv.MaNV,
                MACV    = nvcv.MaCV,
                TUNGAY  = nvcv.TuNgay,
                DENNGAY = nvcv.DenNgay,
            };

            db.NHANVIEN_CHUCVU6s.InsertOnSubmit(iNHANVIEN_CHUCVU6s);
            db.SubmitChanges();
        }
        public bool themPhongBan(string maPB, string tenPB, DateTime ngayTL)
        {
            int count = kiemTraTonTai(maPB);

            if (count > 0)
            {
                return(false);
            }
            else
            {
                PHONGBAN6 pb = new PHONGBAN6
                {
                    MAPB   = maPB,
                    TENPB  = tenPB,
                    NGAYTL = ngayTL,
                };
                db.PHONGBAN6s.InsertOnSubmit(pb);
                db.SubmitChanges();
                return(true);
            }
        }
        public bool themNVCV_DAO(string strMaNV, string ngoaingu, string trinhdo)
        {
            int dem = kiemTraTonTai(strMaNV, ngoaingu);

            if (dem > 0)
            {
                return(false);
            }
            else
            {
                TRINHDONGOAINGU6 iTRINHDONGOAINGU6s = new TRINHDONGOAINGU6
                {
                    MANV     = strMaNV,
                    NGOAINGU = ngoaingu,
                    TRINHDO  = trinhdo
                };
                db.TRINHDONGOAINGU6s.InsertOnSubmit(iTRINHDONGOAINGU6s);
                db.SubmitChanges();
                return(true);
            }
        }
Пример #5
0
        public int themChucVu(ChucVu_DTO cv)
        {
            int check = kiemTraTonTai(cv.MaCV);

            if (check > 0)
            {
                return(0);
            }
            else
            {
                CHUCVU6 themcv = new CHUCVU6
                {
                    MACV   = cv.MaCV,
                    TENCV  = cv.TenCV,
                    HESOPC = cv.HeSoPhuCap
                };
                db.CHUCVU6s.InsertOnSubmit(themcv);
                db.SubmitChanges();
                return(1);
            }
        }
Пример #6
0
        public bool themNVCV_DAO(string strMaNV, DateTime tuNgay, DateTime denNgay, string noiCongTac, string chucVu)
        {
            int dem = kiemTraTonTai(strMaNV, tuNgay);

            if (dem > 0)
            {
                return(false);
            }
            else
            {
                QUATRINHCONGTAC6 iQUATRINHCONGTAC6s = new QUATRINHCONGTAC6
                {
                    MANV       = strMaNV,
                    TUNGAY     = tuNgay,
                    DENNGAY    = denNgay,
                    NOICONGTAC = noiCongTac,
                    CHUCVU     = chucVu
                };
                db.QUATRINHCONGTAC6s.InsertOnSubmit(iQUATRINHCONGTAC6s);
                db.SubmitChanges();
                return(true);
            }
        }
Пример #7
0
        public bool themHoSo(string maNV, string tenNV, DateTime ngayS, string gt, string sdt, string email, DateTime ntd, string mpb, string tk, string mk, string q)
        {
            int count = kiemTraTonTai(maNV);

            if (count > 0)
            {
                return(false);
            }
            else
            {
                try
                {
                    HOSO6 pb = new HOSO6
                    {
                        MANV     = maNV,
                        HOTEN    = tenNV,
                        NGAYSINH = ngayS,
                        GIOITINH = gt,
                        SODT     = sdt,
                        EMAIL    = email,
                        NGAYTD   = ntd,
                        MAPB     = mpb,
                        TAIKHOAN = tk,
                        MATKHAU  = mk,
                        QUYEN    = q
                    };
                    db.HOSO6s.InsertOnSubmit(pb);
                    db.SubmitChanges();
                    return(true);
                }
                catch (Exception)
                {
                    return(false);
                }
            }
        }