/// <summary> /// Displays all request records on the page /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { RegistrationRequestDAO requestDAO = new RegistrationRequestDAO( ConfigurationManager.ConnectionStrings["flexiLearn"].ConnectionString); allRequests = requestDAO.ReadAll(); if (!IsPostBack) { GVRegistrationRequests.DataSource = allRequests; GVRegistrationRequests.DataBind(); } }
/// <summary> /// Rejects all selected requests /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void BtnReject_Click(object sender, EventArgs e) { List <int> selectedIDs = GetSelectedIDs(); RegistrationRequestDAO requestDAO = new RegistrationRequestDAO( ConfigurationManager.ConnectionStrings["flexiLearn"].ConnectionString); CourseDAO courseDAO = new CourseDAO( ConfigurationManager.ConnectionStrings["flexiLearn"].ConnectionString); foreach (int id in selectedIDs) { RegistrationRequest request = requestDAO.SearchByRegistrationID(id); request.RegistrationStatus = Status.REJECTED; requestDAO.ModifyStatus(request); } allRequests = requestDAO.ReadAll(); GVRegistrationRequests.DataSource = allRequests; GVRegistrationRequests.DataBind(); }