protected void AddSection(object sender, EventArgs e) { Page.ClientScript.RegisterStartupScript(GetType(), "id", "toggle_forms('AddSections')", true); if (Page.IsValid) { DBHandler.DBHandler db = new DBHandler.DBHandler(con); Entities.Section t1 = new Entities.Section() { sectionName = SectionName.Value, }; db.InsertSection(t1); SSections.DataBind(); GSections.DataBind(); UpdatePanel3.Update(); AddClassSection1.UpdateSection(); TecherSection1.UpdateSection(); StudentSection1.UpdateSection(); ExamDate1.UpdateSection(); SectionLabel.Text = "Section Added Successfully"; } }
protected void AddClass(object sender, EventArgs e) { Page.ClientScript.RegisterStartupScript(GetType(), "id", "toggle_forms('AddClasses')", true); if (Page.IsValid) { DBHandler.DBHandler db = new DBHandler.DBHandler(con); Entities.Class t1 = new Entities.Class() { classId = ClassId.Value, className = ClassName.Value, }; db.InsertClass(t1); SClasses.DataBind(); GClasses.DataBind(); UpdatePanel2.Update(); AddClassSection1.UpdateClass(); TecherSection1.UpdateClass(); StudentSection1.UpdateClass(); ExamDate1.UpdateClass(); ClassLabel.Text = "Class Added Successfully"; } }