Exemplo n.º 1
0
    protected void BtnGenerate_Click(object sender, EventArgs e)
    {
        bool check = false;

        List <int> requisitionNo = new List <int>();

        foreach (GridViewRow row in gvReq.Rows)
        {
            if (((CheckBox)row.FindControl("cbxCheckBox")).Checked == false)
            {
                lblCheckBoxValidation.Text = "Please select at least one requisition!";
            }
            else if (((CheckBox)row.FindControl("cbxCheckBox")).Checked)
            {
                check = true;
                requisitionNo.Add(Convert.ToInt32((row.FindControl("lblrequisitionNo") as Label).Text));
            }
        }

        if (check)
        {
            int empId       = (int)Session["empID"];//////////
            int retrievalId = EFBroker_Disbursement.AddNewRetrieval(empId);
            Session["RetrievalID"] = retrievalId;
            reqCon.AddDisbursement(retrievalId, requisitionNo);
            Response.Redirect("~/Store/RetrievalListDetail.aspx");
        }
    }