Exemplo n.º 1
0
        public static BHXH.Data.ListChucVu New(string MaChucVu, string TenChucVu)

        {
            if (MaChucVu == "" || TenChucVu == "")
            {
                return(null);
            }
            if (IsExisted(MaChucVu, TenChucVu) != null)
            {
                return(IsExisted(MaChucVu, TenChucVu));
            }
            BHXH.Data.BHXHEntities ctx = new Data.BHXHEntities();
            BHXH.Data.ListChucVu   n   = new Data.ListChucVu();
            n.MaChucVu  = MaChucVu;
            n.TenChucVu = TenChucVu;
            ctx.ListChucVu.Add(n);

            try
            {
                ctx.SaveChanges();
                ctx.Dispose();
                return(n);
            }
            catch (Exception)
            {
                return(null);
            }

            finally
            { }
        }
Exemplo n.º 2
0
        public static BHXH.Data.ListHonNhan New(string MaHonNhan, string TenHonNhan)

        {
            if (MaHonNhan == "" || TenHonNhan == "")
            {
                return(null);
            }
            if (IsExisted(MaHonNhan, TenHonNhan) != null)
            {
                return(IsExisted(MaHonNhan, TenHonNhan));
            }
            BHXH.Data.BHXHEntities ctx = new Data.BHXHEntities();
            BHXH.Data.ListHonNhan  n   = new Data.ListHonNhan();
            n.MaHonNhan  = MaHonNhan;
            n.TenHonNhan = TenHonNhan;
            ctx.ListHonNhan.Add(n);

            try
            {
                ctx.SaveChanges();
                return(n);
            }
            catch (Exception)
            {
                return(null);
            }

            finally
            { }
        }
Exemplo n.º 3
0
        public static void Delete(string MaNoiKCB)
        {
            BHXH.Data.BHXHEntities ctx = new Data.BHXHEntities();
            Data.ListNoiKCB        obj = GetNoiKCB(MaNoiKCB);

            ctx.ListNoiKCB.Attach(obj);
            ctx.ListNoiKCB.Remove(obj);

            ctx.SaveChanges();
        }
Exemplo n.º 4
0
        public static void Delete(string MaCMDaoTao)
        {
            BHXH.Data.BHXHEntities ctx = new Data.BHXHEntities();
            Data.ListCMDaoTao      obj = GetData(MaCMDaoTao);

            ctx.ListCMDaoTao.Attach(obj);
            ctx.ListCMDaoTao.Remove(obj);

            ctx.SaveChanges();
        }
Exemplo n.º 5
0
        public static void Delete(string MaNhanVien)
        {
            BHXH.Data.BHXHEntities ctx = new Data.BHXHEntities();
            var DeleteNV = (from c in ctx.HrNhanVien
                            where c.MaNhanVien.ToString() == MaNhanVien
                            select c).SingleOrDefault();

            //I am trying to delete the record like below
            ctx.HrNhanVien.Remove(DeleteNV);
            ctx.SaveChanges();
        }
Exemplo n.º 6
0
        public static void Delete(string MaTDLLCT)
        {
            BHXH.Data.BHXHEntities ctx = new Data.BHXHEntities();

            var obj = new Data.ListTDLLCT { MaTDLLCT = MaTDLLCT };
            ctx.ListTDLLCT.Attach(obj);
            ctx.ListTDLLCT.Remove(obj);

            ctx.SaveChanges();


        }
Exemplo n.º 7
0
        public static void Delete(string MaChucVu)
        {
            BHXH.Data.BHXHEntities ctx = new Data.BHXHEntities();

            var obj = new Data.ListChucVuDang {
                MaChucVu = MaChucVu
            };

            ctx.ListChucVuDang.Attach(obj);
            ctx.ListChucVuDang.Remove(obj);

            ctx.SaveChanges();
        }
Exemplo n.º 8
0
        public static void Delete(string MaDienCS)
        {
            BHXH.Data.BHXHEntities ctx = new Data.BHXHEntities();

            var obj = new Data.ListDienCS {
                MaDienCS = MaDienCS
            };

            ctx.ListDienCS.Attach(obj);
            ctx.ListDienCS.Remove(obj);

            ctx.SaveChanges();
        }
Exemplo n.º 9
0
        public static void Delete(string MaQuocGia)
        {
            BHXH.Data.BHXHEntities ctx = new Data.BHXHEntities();

            var obj = new Data.ListQuocGia {
                MaQuocGia = MaQuocGia
            };

            ctx.ListQuocGia.Attach(obj);
            ctx.ListQuocGia.Remove(obj);

            ctx.SaveChanges();
        }
Exemplo n.º 10
0
        public static void Delete(string MaBangCap)
        {
            BHXH.Data.BHXHEntities ctx = new Data.BHXHEntities();
            var obj = new Data.ListBangCap {
                MaBangCap = MaBangCap
            };

            ctx.ListBangCap.Attach(obj);
            ctx.ListBangCap.Remove(obj);


            ctx.SaveChanges();
        }
Exemplo n.º 11
0
        public static void Delete(string MaLoaiTB)
        {
            BHXH.Data.BHXHEntities ctx = new Data.BHXHEntities();

            var obj = new Data.ListLoaiTB {
                MaLoaiTB = MaLoaiTB
            };

            ctx.ListLoaiTB.Attach(obj);
            ctx.ListLoaiTB.Remove(obj);

            ctx.SaveChanges();
        }
Exemplo n.º 12
0
        public static void Delete(string MaNghiepVu)
        {
            BHXH.Data.BHXHEntities ctx = new Data.BHXHEntities();

            var obj = new Data.ListNghiepVu {
                MaNghiepVu = MaNghiepVu
            };

            ctx.ListNghiepVu.Attach(obj);
            ctx.ListNghiepVu.Remove(obj);

            ctx.SaveChanges();
        }
Exemplo n.º 13
0
        public static void Delete(string MaTDNgoaiNgu)
        {
            BHXH.Data.BHXHEntities ctx = new Data.BHXHEntities();

            var obj = new Data.ListTDNgoaiNgu {
                MaTDNgoaiNgu = MaTDNgoaiNgu
            };

            ctx.ListTDNgoaiNgu.Attach(obj);
            ctx.ListTDNgoaiNgu.Remove(obj);

            ctx.SaveChanges();
        }
Exemplo n.º 14
0
        public static void Delete(string MaTDVanHoa)
        {
            BHXH.Data.BHXHEntities ctx = new Data.BHXHEntities();

            var obj = new Data.ListTDVanHoa {
                MaTDVanHoa = MaTDVanHoa
            };

            ctx.ListTDVanHoa.Attach(obj);
            ctx.ListTDVanHoa.Remove(obj);

            ctx.SaveChanges();
        }
Exemplo n.º 15
0
        public static void Delete(string MaTinh)
        {
            BHXH.Data.BHXHEntities ctx = new Data.BHXHEntities();

            var obj = new Data.ListTinh {
                MaTinh = MaTinh
            };

            ctx.ListTinh.Attach(obj);
            ctx.ListTinh.Remove(obj);

            ctx.SaveChanges();
        }
Exemplo n.º 16
0
        public static void Delete(string MaLHDaoTao)
        {
            BHXH.Data.BHXHEntities ctx = new Data.BHXHEntities();

            var obj = new Data.ListLHDaoTao {
                MaLHDaoTao = MaLHDaoTao
            };

            ctx.ListLHDaoTao.Attach(obj);
            ctx.ListLHDaoTao.Remove(obj);

            ctx.SaveChanges();
        }
Exemplo n.º 17
0
        public static void Delete(string MaQuanHeGD)
        {
            BHXH.Data.BHXHEntities ctx = new Data.BHXHEntities();

            var obj = new Data.ListQuanHeGD {
                MaQuanHeGD = MaQuanHeGD
            };

            ctx.ListQuanHeGD.Attach(obj);
            ctx.ListQuanHeGD.Remove(obj);

            ctx.SaveChanges();
        }
Exemplo n.º 18
0
        public static void Delete(string MaKTKL)
        {
            BHXH.Data.BHXHEntities ctx = new Data.BHXHEntities();

            var obj = new Data.ListKTKL {
                MaKTKL = MaKTKL
            };

            ctx.ListKTKL.Attach(obj);
            ctx.ListKTKL.Remove(obj);

            ctx.SaveChanges();
        }
Exemplo n.º 19
0
        public static void Delete(decimal QuanHuyenID)
        {
            BHXH.Data.BHXHEntities ctx = new Data.BHXHEntities();

            var obj = new Data.ListQuanHuyen {
                QuanHuyenID = QuanHuyenID
            };

            ctx.ListQuanHuyen.Attach(obj);
            ctx.ListQuanHuyen.Remove(obj);

            ctx.SaveChanges();
        }
Exemplo n.º 20
0
        public static void Delete(string MaHopDong)
        {
            BHXH.Data.BHXHEntities ctx = new Data.BHXHEntities();

            var obj = new Data.ListHopDong {
                MaHopDong = MaHopDong
            };

            ctx.ListHopDong.Attach(obj);
            ctx.ListHopDong.Remove(obj);

            ctx.SaveChanges();
        }
Exemplo n.º 21
0
        public static void Delete(string MaDanToc)
        {
            BHXH.Data.BHXHEntities ctx = new Data.BHXHEntities();

            var obj = new Data.ListDanToc {
                MaDanToc = MaDanToc
            };

            ctx.ListDanToc.Attach(obj);
            ctx.ListDanToc.Remove(obj);

            ctx.SaveChanges();
        }
Exemplo n.º 22
0
        public static void Delete(string MaTDQLNN)
        {
            BHXH.Data.BHXHEntities ctx = new Data.BHXHEntities();

            var obj = new Data.ListTDQLNN {
                MaTDQLNN = MaTDQLNN
            };

            ctx.ListTDQLNN.Attach(obj);
            ctx.ListTDQLNN.Remove(obj);

            ctx.SaveChanges();
        }
Exemplo n.º 23
0
        public static void Delete(string MaPhongBan)
        {
            BHXH.Data.BHXHEntities ctx = new Data.BHXHEntities();

            var obj = new Data.ListPhongBan {
                MaPhongBan = MaPhongBan
            };

            ctx.ListPhongBan.Attach(obj);
            ctx.ListPhongBan.Remove(obj);

            ctx.SaveChanges();
        }
Exemplo n.º 24
0
        public static void Delete(string QuaTrinhCongTacID)
        {
            BHXH.Data.BHXHEntities ctx = new Data.BHXHEntities();

            var obj = new Data.HrQuaTrinhCongTac {
                QuaTrinhCongTacID = new Guid(QuaTrinhCongTacID)
            };

            ctx.HrQuaTrinhCongTac.Attach(obj);
            ctx.HrQuaTrinhCongTac.Remove(obj);

            ctx.SaveChanges();
            ctx.Dispose();
        }
Exemplo n.º 25
0
        //public static Data.HrChiTietDaoTao IsExisted(string MaChucVu, string TenChucVu)
        //{
        //    BHXH.Data.BHXHEntities ctx = new Data.BHXHEntities();
        //    var query = from c in ctx.HrChiTietDaoTao
        //                where c.MaChucVu == MaChucVu && c.TenChucVu == TenChucVu
        //                select c;
        //    if (query.Count() > 0)
        //    {
        //        ctx.Dispose();
        //        return query.First();

        //    }
        //    else
        //        return null;



        //}
        public static void Delete(string QuaTrinhDaoTaoID)
        {
            BHXH.Data.BHXHEntities ctx = new Data.BHXHEntities();

            var obj = new Data.HrChiTietDaoTao  {
                QuaTrinhDaoTaoID = new Guid(QuaTrinhDaoTaoID)
            };

            ctx.HrChiTietDaoTao.Attach(obj);
            ctx.HrChiTietDaoTao.Remove(obj);

            ctx.SaveChanges();
            ctx.Dispose();
        }
Exemplo n.º 26
0
        public static void Delete(string MaChiBo)
        {
            BHXH.Data.BHXHEntities ctx = new Data.BHXHEntities();

            var obj = new Data.ListChiBo {
                MaChiBo = MaChiBo
            };

            ctx.ListChiBo.Attach(obj);
            ctx.ListChiBo.Remove(obj);

            ctx.SaveChanges();
            ctx.Dispose();
        }
Exemplo n.º 27
0
        public static void Edit(string MaTDLLCT, string TenTDLLCT)
        {
            BHXH.Data.BHXHEntities ctx = new Data.BHXHEntities();
            var query = from c in ctx.ListTDLLCT
                        where c.MaTDLLCT == MaTDLLCT
                        select c;
            BHXH.Data.ListTDLLCT n = query.First();
            n.MaTDLLCT = MaTDLLCT;
            n.TenTDLLCT = TenTDLLCT;

            try
            {
                ctx.SaveChanges();
            }
            finally
            { }
        }
Exemplo n.º 28
0
        public static void Edit(string MaTinh, string TenTinh)
        {
            BHXH.Data.BHXHEntities ctx = new Data.BHXHEntities();
            var query = from c in ctx.ListTinh
                        where c.MaTinh == MaTinh
                        select c;

            BHXH.Data.ListTinh n = query.First();
            n.MaTinh  = MaTinh;
            n.TenTinh = TenTinh;

            try
            {
                ctx.SaveChanges();
            }
            finally
            { ctx.Dispose(); }
        }
Exemplo n.º 29
0
        public static void Edit(string MaLHDaoTao, string TenLHDaoTao)
        {
            BHXH.Data.BHXHEntities ctx = new Data.BHXHEntities();
            var query = from c in ctx.ListLHDaoTao
                        where c.MaLHDaoTao == MaLHDaoTao
                        select c;

            BHXH.Data.ListLHDaoTao n = query.First();
            n.MaLHDaoTao  = MaLHDaoTao;
            n.TenLHDaoTao = TenLHDaoTao;

            try
            {
                ctx.SaveChanges();
            }
            finally
            { }
        }
Exemplo n.º 30
0
        public static void Edit(string MaQuocGia, string TenQuocGia)
        {
            BHXH.Data.BHXHEntities ctx = new Data.BHXHEntities();
            var query = from c in ctx.ListQuocGia
                        where c.MaQuocGia == MaQuocGia
                        select c;

            BHXH.Data.ListQuocGia n = query.First();
            n.MaQuocGia  = MaQuocGia;
            n.TenQuocGia = TenQuocGia;

            try
            {
                ctx.SaveChanges();
            }
            finally
            { ctx.Dispose(); }
        }