Пример #1
0
        public bool themTho(Tho th)
        {
            var t = (from a in db.Thos where a.maTho == th.maTho select a).SingleOrDefault();

            if (t == null)
            {
                db.Thos.InsertOnSubmit(t);
                db.SubmitChanges();
                return(true);
            }
            return(false);
        }
Пример #2
0
        public bool suaTho(Tho th)
        {
            var t = (from a in db.Thos where a.maTho == th.maTho select a).SingleOrDefault();

            if (t != null)
            {
                t.maTho       = th.maTho;
                t.nhom        = th.nhom;
                t.nhom_Truong = th.nhom_Truong;
                t.tenTho      = th.tenTho;
                db.SubmitChanges();
                return(true);
            }
            return(false);
        }
 partial void UpdateTho(Tho instance);
 partial void DeleteTho(Tho instance);
 partial void InsertTho(Tho instance);