Ejemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //
        lblCheckBoxValidation.Text = "";
        //
        if (RequisitionControl.DisplayAll().Count == 0)
        {
            btnGenerate.Visible        = false;
            btnSearch.Visible          = false;
            btnDisplay.Visible         = false;
            ddlStatus.Visible          = false;
            txtSearchBox.Visible       = false;
            lblCheckBoxValidation.Text = "There is no pending requisition!";
        }
        else
        {
            if (!IsPostBack)
            {
                gvReq.DataSource = RequisitionControl.DisplayAll();
                gvReq.DataBind();
            }

            if (ddlStatus.Text == "Priority")
            {
                ddlStatus.Text = "Select Status";

                gvReq.DataSource = null;
                gvReq.DataSource = RequisitionControl.DisplayPriority();
                gvReq.DataBind();
            }

            if (ddlStatus.Text == "Approved")
            {
                ddlStatus.Text = "Select Status";

                gvReq.DataSource = null;
                gvReq.DataSource = RequisitionControl.DisplayApproved();
                gvReq.DataBind();
            }
        }
    }