コード例 #1
0
        private void BindGridView()
        {
            int customerTypeId = 0;

            if (customerVo.Type == "IND")
            {
                customerTypeId = 68;
            }
            else
            {
                customerTypeId = 69;
            }
            customerTypeId = 68;
            DataTable dtAddressProofList = customerBo.GetProofList(customerTypeId, 1, customerVo.CustomerId);
            DataTable dtIDProofList      = customerBo.GetProofList(customerTypeId, 2, customerVo.CustomerId);
            DataTable dtOtherProofList   = customerBo.GetProofList(customerTypeId, 7, customerVo.CustomerId);

            // ADDRESS PROOF LIST

            DataTable dt = new DataTable();

            dt.Columns.Add("ProofCode");
            dt.Columns.Add("Proof Name");

            DataRow drCustomerProof;

            for (int i = 0; i < dtAddressProofList.Rows.Count; i++)
            {
                drCustomerProof    = dt.NewRow();
                drCustomerProof[0] = dtAddressProofList.Rows[i]["XP_ProofCode"].ToString();
                drCustomerProof[1] = dtAddressProofList.Rows[i]["XP_ProofName"].ToString();
                dt.Rows.Add(drCustomerProof);
            }
            gvAddressProofList.DataSource = dt;
            gvAddressProofList.DataBind();
            gvAddressProofList.Visible = true;


            // ID PROOF LIST

            DataTable dtId = new DataTable();

            dtId.Columns.Add("ProofCode");
            dtId.Columns.Add("Proof Name");

            DataRow drIDProof;

            for (int i = 0; i < dtIDProofList.Rows.Count; i++)
            {
                drIDProof    = dtId.NewRow();
                drIDProof[0] = dtIDProofList.Rows[i]["XP_ProofCode"].ToString();
                drIDProof[1] = dtIDProofList.Rows[i]["XP_ProofName"].ToString();
                dtId.Rows.Add(drIDProof);
            }
            gvIDProofList.DataSource = dtId;
            gvIDProofList.DataBind();
            gvIDProofList.Visible = true;

            // FOR OTHER PROOF LIST


            DataTable dtOther = new DataTable();

            dtOther.Columns.Add("ProofCode");
            dtOther.Columns.Add("Proof Name");

            DataRow drOtherProof;

            for (int i = 0; i < dtOtherProofList.Rows.Count; i++)
            {
                drOtherProof    = dtOther.NewRow();
                drOtherProof[0] = dtOtherProofList.Rows[i]["XP_ProofCode"].ToString();
                drOtherProof[1] = dtOtherProofList.Rows[i]["XP_ProofName"].ToString();
                dtOther.Rows.Add(drOtherProof);
            }
            gvOtherProofList.DataSource = dtOther;
            gvOtherProofList.DataBind();
            gvOtherProofList.Visible = true;
        }