Ejemplo n.º 1
0
        public bool XoaPB(ref string err, string MaPB)
        {
            QuanLyNVEntities qlnvEntity = new QuanLyNVEntities();

            PhongBan pb = new PhongBan();

            pb.MaPhong = MaPB;
            qlnvEntity.PhongBans.Attach(pb);
            qlnvEntity.PhongBans.Remove(pb);
            qlnvEntity.SaveChanges();
            return(true);
        }
Ejemplo n.º 2
0
        public bool XoaDA(ref string err, string MaDA)
        {
            QuanLyNVEntities qlnvEntity = new QuanLyNVEntities();

            Duan da = new Duan();

            da.MaDA = MaDA;
            qlnvEntity.Duans.Attach(da);
            qlnvEntity.Duans.Remove(da);
            qlnvEntity.SaveChanges();
            return(true);
        }
Ejemplo n.º 3
0
        public bool XoaPhanCong(ref string err, string MaNV)
        {
            QuanLyNVEntities qlnvEntity = new QuanLyNVEntities();

            PhanCong pc = new PhanCong();

            pc.MaNV = MaNV;
            qlnvEntity.PhanCongs.Attach(pc);
            qlnvEntity.PhanCongs.Remove(pc);
            qlnvEntity.SaveChanges();
            return(true);
        }
Ejemplo n.º 4
0
        public bool XoaNV(ref string err, string MaNV)
        {
            QuanLyNVEntities qlnvEntity = new QuanLyNVEntities();

            NhanVien nv = new NhanVien();

            nv.MaNV = MaNV;
            qlnvEntity.NhanViens.Attach(nv);
            qlnvEntity.NhanViens.Remove(nv);
            qlnvEntity.SaveChanges();
            return(true);
        }
Ejemplo n.º 5
0
        public bool ThemDA(string MaDA, string TenDA, string Phong, ref string err)
        {
            QuanLyNVEntities qlnvEntity = new QuanLyNVEntities();
            Duan             da         = new Duan();

            da.MaDA  = MaDA;
            da.TenDA = TenDA;
            da.Phong = Phong;
            qlnvEntity.Duans.Add(da);
            qlnvEntity.SaveChanges();
            return(true);
        }
Ejemplo n.º 6
0
        public bool XoaLuong(ref string err, string MaNV)
        {
            QuanLyNVEntities qlnvEntity = new QuanLyNVEntities();

            Luong l = new Luong();

            l.MaNV = MaNV;
            qlnvEntity.Luongs.Attach(l);
            qlnvEntity.Luongs.Remove(l);
            qlnvEntity.SaveChanges();
            return(true);
        }
Ejemplo n.º 7
0
        public bool ThemLuong(string MaNV, string LuongCoBan, string LuongThuong, ref string err)
        {
            QuanLyNVEntities qlnvEntity = new QuanLyNVEntities();

            Luong l = new Luong();

            l.MaNV        = MaNV;
            l.LuongCoBan  = Convert.ToInt32(LuongCoBan);
            l.LuongThuong = Convert.ToInt32(LuongThuong);
            qlnvEntity.Luongs.Add(l);
            qlnvEntity.SaveChanges();
            return(true);
        }
Ejemplo n.º 8
0
        public bool ThemPC(string MaNV, string MaDA, string NgayBD, string NgayKT, ref string err)
        {
            QuanLyNVEntities qlnvEntity = new QuanLyNVEntities();

            PhanCong pc = new PhanCong();

            pc.MaNV            = MaNV;
            pc.MaDA            = MaDA;
            pc.ThoiGianBatDau  = Convert.ToDateTime(NgayBD, cultures);
            pc.ThoiGianKetThuc = Convert.ToDateTime(NgayKT, cultures);
            qlnvEntity.PhanCongs.Add(pc);
            qlnvEntity.SaveChanges();
            return(true);
        }
Ejemplo n.º 9
0
        public bool ThemPB(string MaPB, string TenPB, string Truong, string Pho, string KT, ref string err)
        {
            QuanLyNVEntities qlnvEntity = new QuanLyNVEntities();

            PhongBan pb = new PhongBan();

            pb.MaPhong     = MaPB;
            pb.TenPhong    = TenPB;
            pb.TruongPhong = Truong;
            pb.PhoPhong    = Pho;
            pb.KeToan      = KT;
            qlnvEntity.PhongBans.Add(pb);
            qlnvEntity.SaveChanges();
            return(true);
        }
Ejemplo n.º 10
0
        public bool CapNhatDA(string MaDA, string TenDA, string Phong, ref string err)
        {
            QuanLyNVEntities qlnvEntity = new QuanLyNVEntities();
            var DuanQuery = (from l in qlnvEntity.Duans
                             where l.MaDA == MaDA
                             select l).SingleOrDefault();

            if (DuanQuery != null)
            {
                DuanQuery.MaDA  = MaDA;
                DuanQuery.TenDA = TenDA;
                DuanQuery.Phong = Phong;

                qlnvEntity.SaveChanges();
            }
            return(true);
        }
Ejemplo n.º 11
0
        public bool CapNhatLuong(string MaNV, string LuongCoban, string LuongThuong, ref string err)
        {
            QuanLyNVEntities qlnvEntity = new QuanLyNVEntities();
            var LuongQuery = (from l in qlnvEntity.Luongs
                              where l.MaNV == MaNV
                              select l).SingleOrDefault();

            if (LuongQuery != null)
            {
                LuongQuery.MaNV        = MaNV;
                LuongQuery.LuongCoBan  = Convert.ToInt32(LuongCoban);
                LuongQuery.LuongThuong = Convert.ToInt32(LuongThuong);

                qlnvEntity.SaveChanges();
            }
            return(true);
        }
Ejemplo n.º 12
0
        public bool CapNhatPB(string MaPB, string TenPB, string Truong, string Pho, string KT, ref string err)
        {
            QuanLyNVEntities qlnvEntity = new QuanLyNVEntities();
            var PBQuery = (from l in qlnvEntity.PhongBans
                           where l.MaPhong == MaPB
                           select l).SingleOrDefault();

            if (PBQuery != null)
            {
                PBQuery.MaPhong     = MaPB;
                PBQuery.TenPhong    = TenPB;
                PBQuery.TruongPhong = Truong;
                PBQuery.PhoPhong    = Pho;
                PBQuery.KeToan      = KT;
                qlnvEntity.SaveChanges();
            }
            return(true);
        }
Ejemplo n.º 13
0
        public bool CapNhatPC(string MaNV, string MaDA, string NgayBD, string NgayKT, ref string err)
        {
            QuanLyNVEntities qlnvEntity = new QuanLyNVEntities();
            var pcQuery = (from pc in qlnvEntity.PhanCongs
                           where pc.MaNV == MaNV
                           select pc).SingleOrDefault();

            if (pcQuery != null)
            {
                pcQuery.MaNV            = MaNV;
                pcQuery.MaDA            = MaDA;
                pcQuery.ThoiGianBatDau  = Convert.ToDateTime(NgayBD, cultures);
                pcQuery.ThoiGianKetThuc = Convert.ToDateTime(NgayKT, cultures);

                qlnvEntity.SaveChanges();
            }
            return(true);
        }
Ejemplo n.º 14
0
        public bool CapNhatNhanVien(string MaNV, string TenNV, string NgaySinh, string Diachi, string GioiTinh, string Phong, ref string err)
        {
            QuanLyNVEntities qlnvEntity = new QuanLyNVEntities();
            var nvQuery = (from nv in qlnvEntity.NhanViens
                           where nv.MaNV == MaNV
                           select nv).SingleOrDefault();

            if (nvQuery != null)
            {
                nvQuery.HoVaTen  = TenNV;
                nvQuery.NgaySinh = Convert.ToDateTime(NgaySinh, cultures);
                nvQuery.DiaChi   = Diachi;
                nvQuery.GioiTinh = GioiTinh;
                nvQuery.Phong    = Phong;
                qlnvEntity.SaveChanges();
            }
            return(true);
        }
Ejemplo n.º 15
0
        public bool ThemNV(string MaNV, string TenNV, string NgaySinh, string Diachi, string GioiTinh, string Phong, ref string err)
        {
            QuanLyNVEntities qlnvEntity = new QuanLyNVEntities();

            NhanVien nv = new NhanVien();

            nv.MaNV     = MaNV;
            nv.HoVaTen  = TenNV;
            nv.NgaySinh = Convert.ToDateTime(NgaySinh, cultures);
            nv.DiaChi   = Diachi;
            nv.GioiTinh = GioiTinh;
            nv.Phong    = Phong;
            nv.Status   = "1";
            qlnvEntity.NhanViens.Add(nv);
            qlnvEntity.SaveChanges();

            return(true);
        }