protected void Page_Load(object sender, EventArgs e) { dbContext = new QLSinhVienEntities(); doAction = string.IsNullOrEmpty(Request["do"]) ? "" : Request["do"].ToLower(); dapDangKyHoc = new DangKyHocDAP(dbContext); itemID = Convert.ToInt32(Request["itemid"]); page = Convert.ToInt32(Request["page"]); switch (doAction) { case "add": Add(); break; case "edit": Update(); break; case "delete": Delete(); break; case "loaddata": LoadData(); break; case "search": Search(); break; default: break; } }
protected void Page_Load(object sender, EventArgs e) { QLSinhVienEntities dbContext = new QLSinhVienEntities(); DangKyHocDAP dapDangKyHoc = new DangKyHocDAP(dbContext); HocSinhDAP dapHocSinh = new HocSinhDAP(dbContext); GiaoVienDAP dapGiaoVien = new GiaoVienDAP(dbContext); MonHocDAP dapMonHoc = new MonHocDAP(dbContext); doAction = !string.IsNullOrEmpty(Request["do"]) ? Request["do"].ToString() : ""; itemID = !string.IsNullOrEmpty(Request["itemid"]) ? Convert.ToInt32(Request["itemid"]) : 0; if (itemID != 0) { dkh = dapDangKyHoc.getByID(itemID); } tbl_HocSinhs.AddRange(dapHocSinh.getData()); tbl_GiaoViens.AddRange(dapGiaoVien.getData()); tbl_MonHocs.AddRange(dapMonHoc.getData()); }