Ejemplo n.º 1
0
        public static BHXH.Data.HrQuaTrinhCongTac New(string MaNhanVien, int STT, string ThoiGian, string CongViec)

        {
            BHXH.Data.BHXHEntities      ctx = new Data.BHXHEntities();
            BHXH.Data.HrQuaTrinhCongTac n   = new Data.HrQuaTrinhCongTac();
            n.MaNhanVien        = new Guid(MaNhanVien);
            n.STT               = STT;
            n.ThoiGian          = ThoiGian;
            n.CongViec          = CongViec;
            n.QuaTrinhCongTacID = Guid.NewGuid();
            ctx.HrQuaTrinhCongTac.Add(n);

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

            finally
            { }
        }
Ejemplo n.º 2
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();
        }