protected void AddClassButton_Click(object sender, EventArgs e)
 {
     int classId = Convert.ToInt16(Request.QueryString["ClassId"]);
     EditClass edit = new EditClass();
     bool editSuccess;
     if (classId == 0)
     {
         editSuccess = edit.EditClasses(AddClassCancel.Checked, DropDownAddTeacher.SelectedValue, DropDownAddCourse.SelectedValue.ToString(), AddClassNote.Text, AddClassDate.Text);
     }
     else
     {
         editSuccess = edit.EditClasses(classId.ToString(), AddClassCancel.Checked, DropDownAddTeacher.SelectedValue, DropDownAddCourse.SelectedValue.ToString(), AddClassNote.Text, AddClassDate.Text);
     }
     if (editSuccess)
     {
         // Reload the page.
         Response.Redirect("/Admin/Class/Class_Display.aspx");
     }
 }
 protected void AddClassButton_Click(object sender, EventArgs e)
 {
     int classId = Convert.ToInt16(Request.QueryString["ClassId"]);
     EditClass edit = new EditClass();
     bool editSuccess;
     var db = new WebApplication1.HalonModels.HalonContext();
     IQueryable<WebApplication1.HalonModels.Firefighter> ffquery = db.Firefighters;
     string firefighter_UName = Page.User.Identity.Name;
     ffquery = ffquery.Where(f => f.Firefighter_Account_Username.Equals(firefighter_UName));
     string firefighter_ID = ffquery.First().Firefighter_ID.ToString();
     if (classId == 0)
     {
         editSuccess = edit.EditClasses(AddClassCancel.Checked, firefighter_ID, DropDownAddCourse.SelectedValue.ToString(), AddClassNote.Text, AddClassDate.Text);
     }
     else
     {
         editSuccess = edit.EditClasses(classId.ToString(), AddClassCancel.Checked, firefighter_ID, DropDownAddCourse.SelectedValue.ToString(), AddClassNote.Text, AddClassDate.Text);
     }
     if (editSuccess)
     {
         // Reload the page.
         Response.Redirect("/Instructor/Class/Class_Display.aspx");
     }
 }