public static void InsertSinhVien(SinhVien_DTO sv) { using (QuanLiSinhVienEntities db = new QuanLiSinhVienEntities()) { db.SinhViens.Add(ReturnSV(sv)); db.SaveChanges(); } }
public static void DeleteSinhVien(string Mssv) { using (QuanLiSinhVienEntities db = new QuanLiSinhVienEntities()) { var sv = db.SinhViens.FirstOrDefault(x => x.mssv == Mssv); if (sv != null) { db.SinhViens.Remove(sv); db.SaveChanges(); } } }