Пример #1
0
        public int xoaDT(string madt)
        {
            DotThi dt = tnth.DotThis.Where(d => d.MaNgayThi == madt).FirstOrDefault();

            if (dt != null)
            {
                KyThi kt = tnth.KyThis.Where(k => k.MaNgayThi == dt.MaNgayThi).FirstOrDefault();
                if (kt != null)
                {
                    ThongTinCaNhan tcn = tnth.ThongTinCaNhans.Where(tc => tc.MaKyThi == kt.MaKT).FirstOrDefault();
                    if (tcn != null)
                    {
                        KetQua k = tnth.KetQuas.Where(kq => kq.MaTS == tcn.MaTS && kq.MaKT == kt.MaKT).FirstOrDefault();
                        if (k != null)
                        {
                            tnth.KetQuas.DeleteOnSubmit(k);
                            tnth.SubmitChanges();
                        }
                        tnth.ThongTinCaNhans.DeleteOnSubmit(tcn);
                        tnth.SubmitChanges();
                    }
                    tnth.KyThis.DeleteOnSubmit(kt);
                    tnth.SubmitChanges();
                }
                tnth.DotThis.DeleteOnSubmit(dt);
                tnth.SubmitChanges();
                return(1);
            }
            return(0);
        }
Пример #2
0
        public int suaDT(string madt, DateTime ngaythi, int sldk)
        {
            DotThi dt = tnth.DotThis.Where(d => d.MaNgayThi == madt).FirstOrDefault();

            if (dt != null)
            {
                dt.NgayThi   = ngaythi;
                dt.SoLuongDK = sldk;
                tnth.SubmitChanges();
                return(1);
            }
            else
            {
                return(0);
            }
        }
Пример #3
0
        public int themDT(string madt, DateTime ngaythi, int sldk)
        {
            //DotThi dt = tnth.DotThis.Where(dot => dot.MaNgayThi == madt).FirstOrDefault();
            DotThi d = new DotThi();

            d.MaNgayThi = madt;
            d.NgayThi   = ngaythi;
            d.SoLuongDK = sldk;
            //if (dt == null)


            try
            {
                tnth.DotThis.InsertOnSubmit(d);
                tnth.SubmitChanges();
                return(1);
            }
            catch { return(0); }
            //}
            //else
            //    return 0;
        }
Пример #4
0
 partial void DeleteDotThi(DotThi instance);
Пример #5
0
 partial void UpdateDotThi(DotThi instance);
Пример #6
0
 partial void InsertDotThi(DotThi instance);