Пример #1
0
 public static void ResetMK(string maND)
 {
     using (SQL_QLHSDataContext db = new SQL_QLHSDataContext())
     {
         NGUOIDUNG nd = db.NGUOIDUNGs.Where(a => a.MAND == maND).FirstOrDefault();
         nd.MATKHAU = "123456789";
         db.SubmitChanges();
     }
 }
Пример #2
0
 // Xóa người dùng
 public static void delete(string maND)
 {
     using (SQL_QLHSDataContext db = new SQL_QLHSDataContext())
     {
         NGUOIDUNG nd = db.NGUOIDUNGs.Where(a => a.MAND == maND).FirstOrDefault();
         db.NGUOIDUNGs.DeleteOnSubmit(nd);
         db.SubmitChanges();
     }
 }
Пример #3
0
 // Sửa môn học
 public static void update(string maMH, string tenMH)
 {
     using (SQL_QLHSDataContext db = new SQL_QLHSDataContext())
     {
         MONHOC mh = db.MONHOCs.Where(a => a.MAMONHOC == maMH).FirstOrDefault();
         mh.TENMONHOC = tenMH;
         db.SubmitChanges();
     }
 }
Пример #4
0
 // Sửa hệ số học kỳ
 public static void Update(string maHK, int heSo)
 {
     using (SQL_QLHSDataContext db = new SQL_QLHSDataContext())
     {
         HOCKY hk = db.HOCKies.Where(a => a.MAHK == maHK).FirstOrDefault();
         hk.HESO = heSo;
         db.SubmitChanges();
     }
 }
Пример #5
0
 // Sửa người dùng
 public static void update(string maND, string tenNguoiDung, string maLND)
 {
     using (SQL_QLHSDataContext db = new SQL_QLHSDataContext())
     {
         NGUOIDUNG nd = db.NGUOIDUNGs.Where(a => a.MAND == maND).FirstOrDefault();
         nd.TENNGUOIDUNG = tenNguoiDung;
         nd.MALND        = maLND;
         db.SubmitChanges();
     }
 }
Пример #6
0
 // Sửa lớp
 public static void Update(string maLop, string tenLop, string maKhoi)
 {
     using (SQL_QLHSDataContext db = new SQL_QLHSDataContext())
     {
         LOP l = db.LOPs.Where(a => a.MALOP == maLop).FirstOrDefault();
         l.TENLOP = tenLop;
         l.MAKHOI = maKhoi;
         db.SubmitChanges();
     }
 }
Пример #7
0
        // Thêm môn học
        public static void insert(string maMH, string tenMH)
        {
            using (SQL_QLHSDataContext db = new SQL_QLHSDataContext())
            {
                MONHOC mh = new MONHOC();
                mh.MAMONHOC  = maMH;
                mh.TENMONHOC = tenMH;

                db.MONHOCs.InsertOnSubmit(mh);
                db.SubmitChanges();
            }
        }
Пример #8
0
 // Sửa học sinh
 public static void Update(string maHS, string hoTen, string gioiTinh, DateTime ngaySinh, string diaChi, string email)
 {
     using (SQL_QLHSDataContext db = new SQL_QLHSDataContext())
     {
         HOCSINH hs = db.HOCSINHs.Where(a => a.MAHS == maHS).FirstOrDefault();
         hs.HOTEN    = hoTen;
         hs.GIOITINH = gioiTinh;
         hs.NGAYSINH = ngaySinh;
         hs.DIACHI   = diaChi;
         hs.EMAIL    = email;
         db.SubmitChanges();
     }
 }
Пример #9
0
        // Thêm Lớp
        public static void Insert(string maLop, string tenLop, string maKhoi)
        {
            using (SQL_QLHSDataContext db = new SQL_QLHSDataContext())
            {
                LOP l = new LOP();
                l.MALOP  = maLop;
                l.TENLOP = tenLop;
                l.MAKHOI = maKhoi;
                l.SISO   = null;

                db.LOPs.InsertOnSubmit(l);
                db.SubmitChanges();
            }
        }
Пример #10
0
        // Thêm người dùng
        public static void insert(string maND, string tenNguoiDung, string maLND, string tenDangNhap)
        {
            using (SQL_QLHSDataContext db = new SQL_QLHSDataContext())
            {
                NGUOIDUNG nd = new NGUOIDUNG();
                nd.MAND         = maND;
                nd.TENNGUOIDUNG = tenNguoiDung;
                nd.MALND        = maLND;
                nd.TENDANGNHAP  = tenDangNhap;
                nd.MATKHAU      = "123456789";

                db.NGUOIDUNGs.InsertOnSubmit(nd);
                db.SubmitChanges();
            }
        }
Пример #11
0
 // Thêm học sinh
 public static void Insert(string maHS, string hoTen, string gioiTinh, DateTime ngaySinh, string diaChi, string email)
 {
     using (SQL_QLHSDataContext db = new SQL_QLHSDataContext())
     {
         HOCSINH hs = new HOCSINH();
         hs.MAHS     = maHS;
         hs.HOTEN    = hoTen;
         hs.GIOITINH = gioiTinh;
         hs.NGAYSINH = ngaySinh;
         hs.DIACHI   = diaChi;
         hs.EMAIL    = email;
         db.HOCSINHs.InsertOnSubmit(hs);
         db.SubmitChanges();
     }
 }