示例#1
0
        public int insertPc(ePhanCong pc)
        {
            List <ePhanCong> p = new List <ePhanCong>();
            var rpc            = (from a in db.PhanCongs
                                  select new ePhanCong
            {
                MAPB = a.MAPB,
                MACT = a.MACT,
                MANV = a.MANV,
                SLNGAYCONG = a.SLNGAYCONG,
            });

            p = rpc.ToList();
            foreach (ePhanCong e in p)
            {
                if (e.MANV == pc.MANV && e.MAPB == pc.MAPB && e.MACT == pc.MACT)
                {
                    return(0);
                }
            }
            PhanCong b = new PhanCong();

            b.MACT       = pc.MACT;
            b.MANV       = pc.MANV;
            b.MAPB       = pc.MAPB;
            b.SLNGAYCONG = pc.SLNGAYCONG;
            db.PhanCongs.InsertOnSubmit(b);
            db.SubmitChanges();
            return(1);
        }
示例#2
0
        public int change1PhanCong(ePhanCong pc)
        {
            var tmp = db.PhanCongs.Where(x => (x.MANV == pc.MANV && x.MAPB == pc.MAPB && x.MACT == pc.MACT)).FirstOrDefault();

            if (tmp == null)
            {
                return(0);
            }
            db.PhanCongs.DeleteOnSubmit(tmp);
            PhanCong b = new PhanCong();

            b.MACT       = pc.MACT;
            b.MANV       = pc.MANV;
            b.MAPB       = pc.MAPB;
            b.SLNGAYCONG = pc.SLNGAYCONG;
            db.PhanCongs.InsertOnSubmit(b);
            db.SubmitChanges();
            return(1);
        }
示例#3
0
 private void attach_PhanCongs(PhanCong entity)
 {
     this.SendPropertyChanging();
     entity.NhanVien = this;
 }
示例#4
0
 private void detach_PhanCongs(PhanCong entity)
 {
     this.SendPropertyChanging();
     entity.NhanVien = null;
 }
示例#5
0
 partial void DeletePhanCong(PhanCong instance);
示例#6
0
 partial void UpdatePhanCong(PhanCong instance);
示例#7
0
 partial void InsertPhanCong(PhanCong instance);
示例#8
0
 private void detach_PhanCongs(PhanCong entity)
 {
     this.SendPropertyChanging();
     entity.CongTrinh = null;
 }
示例#9
0
 private void attach_PhanCongs(PhanCong entity)
 {
     this.SendPropertyChanging();
     entity.CongTrinh = this;
 }