protected void Page_Load(object sender, EventArgs e) { dbContext = new QLSinhVienEntities(); doAction = string.IsNullOrEmpty(Request["do"]) ? "" : Request["do"].ToLower(); dapMonHoc = new MonHocDAP(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 "search": Search(); break; case "loaddata": LoadData(); break; default: break; } }
protected void Page_Load(object sender, EventArgs e) { QLSinhVienEntities dbContext = new QLSinhVienEntities(); 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) { mh = dapMonHoc.getByID(itemID); } tbl_MonHocs.AddRange(dapMonHoc.getData()); }