public bool themCTHD(Chitiet_HD th)
        {
            var t = (from a in db.Chitiet_HDs where a.maCV == th.maCV && a.soHD == th.soHD select a).SingleOrDefault();

            if (t == null)
            {
                db.Chitiet_HDs.InsertOnSubmit(t);
                db.SubmitChanges();
                return(true);
            }
            return(false);
        }
        public bool suaCTHD(Chitiet_HD th)
        {
            var t = (from a in db.Chitiet_HDs where a.maCV == th.maCV && a.soHD == th.soHD select a).SingleOrDefault();

            if (t != null)
            {
                t.maCV      = th.maCV;
                t.soHD      = th.soHD;
                t.khoanTho  = th.khoanTho;
                t.maTho     = th.maTho;
                t.triGia_CV = th.triGia_CV;
                db.SubmitChanges();
                return(true);
            }
            return(false);
        }
 private void detach_Chitiet_HDs(Chitiet_HD entity)
 {
     this.SendPropertyChanging();
     entity.Hop_Dong = null;
 }
 private void detach_Chitiet_HDs(Chitiet_HD entity)
 {
     this.SendPropertyChanging();
     entity.Cong_Viec = null;
 }
 private void attach_Chitiet_HDs(Chitiet_HD entity)
 {
     this.SendPropertyChanging();
     entity.Tho = this;
 }
 partial void DeleteChitiet_HD(Chitiet_HD instance);
 partial void UpdateChitiet_HD(Chitiet_HD instance);
 partial void InsertChitiet_HD(Chitiet_HD instance);