Exemplo n.º 1
0
        public bool suachuyenbac(LichSuChuyenBac lichsuchuyenbac)
        {
            QuanLyLuongEntities csdl = new QuanLyLuongEntities();

            try
            {
                LichSuChuyenBac ls = csdl.LichSuChuyenBacs.SingleOrDefault(n => n.id == lichsuchuyenbac.id);
                ls.MaHeSo     = lichsuchuyenbac.MaHeSo;
                ls.NgayChuyen = lichsuchuyenbac.NgayChuyen;

                csdl.SaveChanges();
                var nhanvien = from p in csdl.NhanViens
                               where p.MaNV == lichsuchuyenbac.MaNV
                               select p;
                foreach (NhanVien nv in nhanvien)
                {
                    nv.MaHeSo  = lichsuchuyenbac.MaHeSo;
                    nv.MaNgach = lichsuchuyenbac.Mangach;
                }
                csdl.SaveChanges();
            }
            catch
            {
                return(false);
            }
            return(true);
        }
        public bool suachuyenbac(LichSuChuyenBac lichsuchuyenbac)
        {
            QuanLyLuongEntities csdl = new QuanLyLuongEntities();
            try
            {

                LichSuChuyenBac ls = csdl.LichSuChuyenBacs.SingleOrDefault(n => n.id == lichsuchuyenbac.id );
                ls.MaHeSo = lichsuchuyenbac.MaHeSo;
                ls.NgayChuyen = lichsuchuyenbac.NgayChuyen;

                csdl.SaveChanges();
                var nhanvien = from p in csdl.NhanViens
                               where p.MaNV == lichsuchuyenbac.MaNV
                               select p;
                foreach (NhanVien nv in nhanvien)
                {
                    nv.MaHeSo = lichsuchuyenbac.MaHeSo;
                    nv.MaNgach = lichsuchuyenbac.Mangach;
                }
                csdl.SaveChanges();

            }
            catch
            {
                return false;
            }
            return true;
        }
Exemplo n.º 3
0
        public bool themchuyenbac(LichSuChuyenBac lichsuchuyenbac)
        {
            QuanLyLuongEntities db = new QuanLyLuongEntities();

            try
            {
                LichSuChuyenBac lscb = new LichSuChuyenBac {
                    MaNV = lichsuchuyenbac.MaNV, MaHeSo = lichsuchuyenbac.MaHeSo, Mangach = lichsuchuyenbac.Mangach, NgayChuyen = lichsuchuyenbac.NgayChuyen
                };
                db.LichSuChuyenBacs.Add(lscb);
                db.SaveChanges();

                var nhanvien = from p in db.NhanViens
                               where p.MaNV == lichsuchuyenbac.MaNV
                               select p;
                foreach (NhanVien nv in nhanvien)
                {
                    nv.MaHeSo  = lichsuchuyenbac.MaHeSo;
                    nv.MaNgach = lichsuchuyenbac.Mangach;
                }
                db.SaveChanges();
            }
            catch
            {
                return(false);
            }
            return(true);
        }
        public bool themchuyenbac(LichSuChuyenBac lichsuchuyenbac)
        {
            QuanLyLuongEntities db = new QuanLyLuongEntities();
            try
            {
                LichSuChuyenBac lscb = new LichSuChuyenBac { MaNV = lichsuchuyenbac.MaNV, MaHeSo = lichsuchuyenbac.MaHeSo, Mangach = lichsuchuyenbac.Mangach, NgayChuyen = lichsuchuyenbac.NgayChuyen };
                db.LichSuChuyenBacs.Add(lscb);
                db.SaveChanges();

                var nhanvien = from p in db.NhanViens
                               where p.MaNV == lichsuchuyenbac.MaNV
                               select p;
                foreach (NhanVien nv in nhanvien)
                {
                    nv.MaHeSo = lichsuchuyenbac.MaHeSo;
                    nv.MaNgach = lichsuchuyenbac.Mangach;
                }
                db.SaveChanges();
            }
            catch
            {
                return false;
            }
            return true;
        }
 public bool ThemLichSu(LichSuChuyenBac lscb)
 {
     return _dallscb.themchuyenbac(lscb);
 }
 public bool SuaLichSu(LichSuChuyenBac lichsuchuyenbac)
 {
     return _dallscb.suachuyenbac(lichsuchuyenbac);
 }
 public bool SuaLichSu(LichSuChuyenBac lichsuchuyenbac)
 {
     return(_dallscb.suachuyenbac(lichsuchuyenbac));
 }
 public bool ThemLichSu(LichSuChuyenBac lscb)
 {
     return(_dallscb.themchuyenbac(lscb));
 }