protected void DdlStatus_SelectedIndexChanged(object sender, EventArgs e) { if (Session["emp"] != null) { Employee emp = (Employee)Session["emp"]; string selectedStatus = ddlStatus.SelectedValue; if (ddlStatus.SelectedItem.Text == "Select Status") { gvRequisitionList.DataSource = RequisitionControl.getRequisitionListByID(emp.EmpID); gvRequisitionList.DataBind(); ViewState["DataSource"] = "displayAll"; showEmptyLabel(); } else { gvRequisitionList.DataSource = RequisitionControl.getRequisitionListByEmpIDAndStatus(emp.EmpID, selectedStatus); gvRequisitionList.DataBind(); ViewState["DataSource"] = "displayStatusSearch"; showEmptyLabel(); } } else { Utility.logout(); } }
protected void BtnDisplay_Click(object sender, EventArgs e) { if (Session["emp"] != null) { Employee emp = (Employee)Session["emp"]; gvRequisitionList.DataSource = RequisitionControl.getRequisitionListByID(emp.EmpID); gvRequisitionList.DataBind(); ViewState["DataSource"] = "displayAll"; showEmptyLabel(); } else { Utility.logout(); } }
protected void GVRequisitionList_PageIndexChanging(object sender, GridViewPageEventArgs e) { Employee emp = (Employee)Session["emp"]; gvRequisitionList.PageIndex = e.NewPageIndex; if (((string)ViewState["DataSource"]).Equals("displayAll")) { gvRequisitionList.DataSource = RequisitionControl.getRequisitionListByID(emp.EmpID); } else if (((string)ViewState["DataSource"]).Equals("displayStatusSearch")) { gvRequisitionList.DataSource = RequisitionControl.getRequisitionListByEmpIDAndStatus(emp.EmpID, ddlStatus.SelectedItem.ToString()); } else if (((string)ViewState["DataSource"]).Equals("displaySearch")) { gvRequisitionList.DataSource = RequisitionControl.SearchForRepRequisitionWithoutStatus(((string)ViewState["searchWord"]).Trim(), emp.EmpID); } else { gvRequisitionList.DataSource = RequisitionControl.SearchForRepRequisitionWithStatus(((string)ViewState["searchWord"]).Trim(), emp.EmpID, ddlStatus.SelectedItem.ToString()); } gvRequisitionList.DataBind(); }