Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
        public bool xoaThiSinh(string ma)
        {
            ThongTinCaNhan tt = tnth.ThongTinCaNhans.Where(t => t.MaTS == Convert.ToInt32(ma)).FirstOrDefault();

            try
            {
                tnth.ThongTinCaNhans.DeleteOnSubmit(tt);
                tnth.SubmitChanges();
                return(true);
            }
            catch
            {
                return(false);
            }
        }
Ejemplo n.º 3
0
        public bool suaThiSinh(int ma, string hoTen, string email, string sdt, string cmnd, string matkhau, string ngaysinh)
        {
            ThongTinCaNhan tt = tnth.ThongTinCaNhans.Where(t => t.MaTS == ma).FirstOrDefault();

            tt.HoVaTenTS = hoTen;
            tt.Email     = email;
            tt.SDT       = sdt;
            tt.CMND      = cmnd;
            tt.MatKhau   = matkhau;
            tt.NgaySinh  = DateTime.Parse(ngaysinh);
            try
            {
                tnth.SubmitChanges();
                return(true);
            }
            catch { return(false); }
        }
Ejemplo n.º 4
0
        public int xoaKT(string kt)
        {
            KyThi k = tnth.KyThis.Where(t => t.MaKT == kt).FirstOrDefault();

            if (k != null)
            {
                ThongTinCaNhan ttcn = tnth.ThongTinCaNhans.Where(c => c.MaKyThi == k.MaKT).FirstOrDefault();
                if (ttcn != null)
                {
                    tnth.ThongTinCaNhans.DeleteOnSubmit(ttcn);
                    tnth.SubmitChanges();
                }
                tnth.KyThis.DeleteOnSubmit(k);
                tnth.SubmitChanges();
                return(1);
            }
            else
            {
                return(2);
            }
        }
Ejemplo n.º 5
0
        public int saveDangKy(string hovaten, string email, string sdt, string cmnd, string mk, DateTime ngaysinh, string maloaiTK, string maKyThi)
        {
            ThongTinCaNhan tt = new ThongTinCaNhan();

            tt.HoVaTenTS = hovaten;
            tt.Email     = email;
            tt.NgaySinh  = ngaysinh;
            tt.SDT       = sdt;
            tt.CMND      = cmnd;
            tt.MatKhau   = mk;
            tt.MaLoaiTK  = maloaiTK;
            tt.MaKyThi   = maKyThi;
            try
            {
                tnth.ThongTinCaNhans.InsertOnSubmit(tt);

                tnth.SubmitChanges();
                return(1);
            }
            catch { }
            return(0);
        }
Ejemplo n.º 6
0
 partial void DeleteThongTinCaNhan(ThongTinCaNhan instance);
Ejemplo n.º 7
0
 partial void UpdateThongTinCaNhan(ThongTinCaNhan instance);
Ejemplo n.º 8
0
 partial void InsertThongTinCaNhan(ThongTinCaNhan instance);
Ejemplo n.º 9
0
 private void detach_ThongTinCaNhans(ThongTinCaNhan entity)
 {
     this.SendPropertyChanging();
     entity.PhanQuyen = null;
 }
Ejemplo n.º 10
0
 private void attach_ThongTinCaNhans(ThongTinCaNhan entity)
 {
     this.SendPropertyChanging();
     entity.KyThi = this;
 }