Exemple #1
0
 protected void DdlStatus_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (Session["emp"] != null)
     {
         Employee emp = (Employee)Session["emp"];
         if (ddlStatus.SelectedItem.ToString() == "Select Status")
         {
             gvRequisitionForm.DataSource = RequisitionControl.DisplayAllByDeptCode(emp.DeptCode);
             gvRequisitionForm.DataBind();
             ViewState["DataSource"] = "displayAll";
             showEmptyLabel();
         }
         else
         {
             string selectedStatus = ddlStatus.SelectedItem.ToString();
             gvRequisitionForm.DataSource = RequisitionControl.getRequisitionListByStatusAndDepCode(ddlStatus.SelectedItem.ToString(), emp.DeptCode);
             gvRequisitionForm.DataBind();
             ViewState["DataSource"] = "displayStatusSearch";
             showEmptyLabel();
         }
     }
     else
     {
         Utility.logout();
     }
 }
Exemple #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Session["emp"] != null)
            {
                Employee emp = (Employee)Session["emp"];

                //Dep Head
                gvRequisitionForm.DataSource = RequisitionControl.DisplayAllByDeptCode(emp.DeptCode);
                gvRequisitionForm.DataBind();
                ViewState["DataSource"] = "displayAll";
                showEmptyLabel();
                //Dep Representative

                int count = RequisitionControl.CountPending(emp.DeptCode);

                lblPendingCount.Text = "Total Pendings: " + count.ToString();
            }
            else
            {
                Utility.logout();
            }
        }
    }
Exemple #3
0
    protected void BtnDisplayAll_Click(object sender, EventArgs e)
    {
        Employee emp = (Employee)Session["emp"];

        gvRequisitionForm.DataSource = RequisitionControl.DisplayAllByDeptCode(emp.DeptCode);
        gvRequisitionForm.DataBind();
        ViewState["DataSource"] = "displayAll";
        showEmptyLabel();
    }
Exemple #4
0
    protected void GvRequisitionForm_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        Employee emp = (Employee)Session["emp"];

        gvRequisitionForm.PageIndex = e.NewPageIndex;
        if (((string)ViewState["DataSource"]).Equals("displayAll"))
        {
            gvRequisitionForm.DataSource = RequisitionControl.DisplayAllByDeptCode(emp.DeptCode);
        }
        else if (((string)ViewState["DataSource"]).Equals("displayStatusSearch"))
        {
            gvRequisitionForm.DataSource = RequisitionControl.getRequisitionListByStatusAndDepCode(ddlStatus.SelectedItem.ToString(), emp.DeptCode);
        }
        else if (((string)ViewState["DataSource"]).Equals("displaySearch"))
        {
            gvRequisitionForm.DataSource = RequisitionControl.HeadSearchWithoutStatus(((string)ViewState["searchString"]).Trim(), emp.DeptCode);
        }
        else if (((string)ViewState["DataSource"]).Equals("displaySearchStatus"))
        {
            gvRequisitionForm.DataSource = RequisitionControl.HeadSearchWithStatus(((string)ViewState["searchString"]).Trim(), emp.DeptCode, ddlStatus.SelectedItem.ToString());
        }
        gvRequisitionForm.DataBind();
    }