コード例 #1
0
    protected void lnkBtnDisapprove_Click(object sender, EventArgs e)
    {
        List<Entity.CompanyInfo> _objListCompanyInfo = new List<Entity.CompanyInfo>();
        foreach (GridViewRow gvRows in GVCompany.Rows)
        {
            CheckBox chkSelect = (CheckBox)gvRows.FindControl("chkSelect");
            if (chkSelect.Checked)
            {
                lblMsg.Text = string.Empty;
                Label lblCompanyId = (Label)gvRows.FindControl("lblCompanyId");
                if (lblCompanyId != null)
                {
                    oCompanyInfo = new Entity.CompanyInfo();
                    oCompanyInfo.IntCompanyId = Convert.ToInt32(lblCompanyId.Text);
                    oCompanyInfo.ChrIsApproved = 'N';
                    _objListCompanyInfo.Add(oCompanyInfo);
                    oCompanyInfo = null;
                }
            }

        }

        if (_objListCompanyInfo.Count > 0)
        {
            oCompanyManager = new BLL.CompanyManager();
            oCompanyManager.UpdateCompanyApprovedStatus(_objListCompanyInfo);
            oCompanyManager = null;

            lblMsg.Text = "Company(ies) has been disapproved successfully.";
            BindCompanies('Y');
        }
        else
        {
            lblMsg.Text = "Please select atleast one company for disapprove.";
        }
        //BindCompanies('Y');
    }