protected void AffordabilityFilterDropDown_SelectedIndexChanged(object sender, EventArgs e) { FeedbackFormDAO tdDAO = new FeedbackFormDAO(); List <FeedbackForm> tdList = new List <FeedbackForm>(); DateTime startD = DateTime.Parse("1-1-1753"); DateTime endD = DateTime.Parse("1-1-9999"); try { startD = DateTime.Parse(txtDateCheckStart.Text); endD = DateTime.Parse(txtDateCheckEnd.Text); } catch (Exception) { startD = DateTime.Parse("1-1-1753"); endD = DateTime.Parse("1-1-9999"); } try { tdList = tdDAO.GetFilteredFeedBacks(CountryFilterDropDown.SelectedValue.ToString(), AffordabilityFilterDropDown.SelectedValue.ToString(), FreedomFilterDropDown.SelectedValue.ToString(), startD, endD); } catch (Exception) { tdList = tdDAO.GetFilteredFeedBacks(CountryFilterDropDown.SelectedValue.ToString(), AffordabilityFilterDropDown.SelectedValue.ToString(), FreedomFilterDropDown.SelectedValue.ToString(), DateTime.Parse("1-1-1753"), DateTime.Parse("1-1-9999")); } GridView_GetFB.DataSource = tdList; GridView_GetFB.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { try { if ((Session["role"].ToString() == "Teacher") || (Session["role"].ToString() == "Incharge")) { if (!IsPostBack) { FeedbackFormDAO tdDAO = new FeedbackFormDAO(); List <FeedbackForm> tdList = new List <FeedbackForm>(); tdList = tdDAO.GetAllFeedBack(); GridView_GetFB.DataSource = tdList; GridView_GetFB.DataBind(); TripDAO tripDao = new TripDAO(); List <String> countryList = tripDao.getCountry(); CountryFilterDropDown.DataSource = countryList; CountryFilterDropDown.DataBind(); CountryFilterDropDown.Items.Insert(0, new ListItem("All", "All")); } } else { Response.Redirect("./Oops.aspx"); } } catch (Exception) { Response.Redirect("./Oops.aspx"); } }