Ejemplo n.º 1
0
        protected void cmbFamilyDocNo_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cmbFamilyDocNo.SelectedIndex == -1)
            {
                // MessageBox.Show("Please select vaild District name");
                //cmbVillage.Select();
            }
            else
            {
                cmbDocumentNo.Items.Clear();
                string selectedVillage = cmbVillage.SelectedValue.ToString().Trim();
                string selectDocNo     = cmbFamilyDocNo.SelectedValue.ToString().Trim();

                //RSD Populate Grid
                lblLinkCL.Text  = "";
                lbllinkFT.Text  = "";
                dsFamilyDetails = dbFamilyDetailsData.getFamilyDetailsOnDocument(selectedVillage, selectDocNo);
                if (dsFamilyDetails.Tables[0].Rows.Count > 0)
                {
                    grdHolderName.DataSource = dsFamilyDetails;
                    grdHolderName.DataBind();

                    FillCheckListGrid();
                    ShowCheckListGrid();
                    //Select File Name from Document if Exist

                    dsDocumentExitsIN = dbDocumentStatusData.DocumentExistDocNoRO(cmbVillage.SelectedValue.ToString().Trim(), cmbFamilyDocNo.SelectedValue.ToString().Trim());
                    if (dsDocumentExitsIN.Tables[0].Rows.Count > 0)
                    {
                        string DocType = "";
                        for (int i = 0; i < dsDocumentExitsIN.Tables[0].Rows.Count; i++)
                        {
                            DocType = dsDocumentExitsIN.Tables[0].Rows[i]["documentcode"].ToString();
                            if (DocType == "FT")
                            {
                                lbllinkFT.Text = dsDocumentExitsIN.Tables[0].Rows[i]["documentname"].ToString();
                                lbllinkFT.Text = dsDocumentExitsIN.Tables[0].Rows[i]["documentname"].ToString();
                            }
                            if (DocType == "CL")
                            {
                                lblLinkCL.Text = dsDocumentExitsIN.Tables[0].Rows[i]["documentname"].ToString();
                            }
                            if (DocType == "LN")
                            {
                                lblLinkLN.Text = dsDocumentExitsIN.Tables[0].Rows[i]["documentname"].ToString();
                            }
                            if (DocType == "LE")
                            {
                                lblLinkLE.Text = dsDocumentExitsIN.Tables[0].Rows[i]["documentname"].ToString();
                            }
                        }
                    }
                }
                else
                {
                    grdHolderName.DataSource = null;
                    grdHolderName.DataBind();
                }
            }
        }