private void btnSearch_Click(object sender, EventArgs e)
        {
            try
            {
                Cursor = Cursors.WaitCursor;
                string strCode = "";
                if (txtProfileId.Text == "")
                {
                    MessageBox.Show("Please Enter Profile Id", "Profile Id Validation", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    txtProfileId.Focus();
                    return;
                }
                if (txtProfileId.Text != "")
                {
                    string    strSQl = "select * from tbl_Membermaster where ProfileId='" + txtProfileId.Text.Trim() + "' ";
                    DataTable dt     = objDb.GetDataTable(strSQl);
                    if (dt.Rows.Count > 0)
                    {
                        strCode = Convert.ToString(dt.Rows[0]["MemberCode"]);
                    }
                    else
                    {
                        MessageBox.Show("Please Enter valid Profile Id", "Valid Profile Id", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        txtProfileId.Focus();
                        return;
                    }
                }
                tbl_MemberMasterProp Objtbl_MemberMasterProp = new tbl_MemberMasterProp();
                Objtbl_MemberMasterProp.MemberCode = Convert.ToInt32(strCode);
                Objtbl_MemberMasterProp.ProfileID  = ""; // ProfileID;
                Objtbl_MemberMasterProp.isLogedin  = true;
                Objtbl_MemberMasterProp.LoginCode  = 0;

                tbl_MemberMasterBAL Objtbl_MemberMasterBAL = new tbl_MemberMasterBAL();
                DataSet             dsMemberMaster         = Objtbl_MemberMasterBAL.Load_MemberDetails(Objtbl_MemberMasterProp);

                dsMemberMaster.Tables[0].TableName = "dsMemberMaster";

                tbl_SibblingDetailsProp Objtbl_SibblingDetailsProp = new tbl_SibblingDetailsProp();
                Objtbl_SibblingDetailsProp.MemberCode = Convert.ToInt32(dsMemberMaster.Tables[0].Rows[0]["MemberCode"]);

                tbl_SibblingDetailsBAL Objtbl_SibblingDetailsBAL = new tbl_SibblingDetailsBAL();
                DataSet dsSibbling = Objtbl_SibblingDetailsBAL.Select_Data(Objtbl_SibblingDetailsProp);
                dsSibbling.Tables[0].TableName = "dsSibblingDtl";

                tbl_MemberPhotosBAL  objtbl_MemberPhotosBAL  = new tbl_MemberPhotosBAL();
                tbl_MemberPhotosProp objtbl_MemberPhotosProp = new tbl_MemberPhotosProp();
                objtbl_MemberPhotosProp.MemberCode = Convert.ToInt32(strCode);
                DataSet dsMemberPhotos = objtbl_MemberPhotosBAL.Select_Data(objtbl_MemberPhotosProp);
                dsMemberPhotos.Tables[0].TableName = "dsMemberPhotos";

                // dsMemberMaster.Tables.Add(dsSibbling.Tables[0]);
                //dsMemberMaster.Tables.Add(dsMemberPhotos.Tables[0]);
                frmReportViewer objReportViewer = new frmReportViewer();
                ReportDocument  cryRpt          = new ReportDocument();
                string          strPath         = Application.StartupPath + @"\REPORTS\MemberMaster.rpt";
                cryRpt.Load(strPath);
                DataSet dstest = new DataSet();

                dstest.Tables.Add(dsMemberMaster.Tables[0].Copy());
                //dstest.Tables.Add(dsMemberPhotos.Tables[0].Copy());
                cryRpt.Subreports["Sibbling"].SetDataSource(dsSibbling.Tables[0]);
                //cryRpt.Subreports["MemberPhotos"].SetDataSource(dsMemberPhotos.Tables[0]);

                cryRpt.SetDataSource(dstest);

                objReportViewer.RptViewer.ReportSource = cryRpt;
                objReportViewer.RptViewer.Refresh();
                objReportViewer.ShowDialog();
                objReportViewer.Focus();
                Cursor = Cursors.Default;
            }
            catch (Exception ex)
            {
                MessageBox.Show(Convert.ToString(ex.Message));
                this.objEventLoging.AppErrlog("Error In AnantMatrimony.rfrmQuickReport.btnSearch_Click() " + ex.ToString());
            }
        }
        private void dgvDetails_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                int    intRowNo  = e.RowIndex;
                string strCode   = Convert.ToString(dgvDetails[(int)CI.MemberCode, e.RowIndex].Value);
                string ProfileId = Convert.ToString(dgvDetails[(int)CI.ProfileId, e.RowIndex].Value);

                if (e.ColumnIndex == (int)CI.Edit)
                {
                    this.objEventLoging.AppClickLog("Search", "Edit", ProfileId, strCode, "");
                    //Global.strMemberCode = strCode;
                    frmMemberMaster objMember = new frmMemberMaster();
                    if (Convert.ToString(dgvDetails[(int)CI.Status, e.RowIndex].Value) == "Active")
                    {
                        frmMemberMaster.isActiveStatus = 1;
                    }
                    else if (Convert.ToString(dgvDetails[(int)CI.Status, e.RowIndex].Value) == "Updated")
                    {
                        frmMemberMaster.isActiveStatus = 2;
                    }
                    frmMemberMaster.strMemberCode = strCode;
                    objMember.ShowDialog();
                    txtCurPage.Text = "1";
                    FillData("");
                    ddlSearchBy.SelectedIndex = 0;
                    txtSearchValue.Text       = "";
                }
                else if (e.ColumnIndex == (int)CI.Print)
                {
                    this.objEventLoging.AppClickLog("Search", "Print", ProfileId, strCode, "");
                    //DataTable dsData = new DataTable();
                    //int PageCount = 0;
                    //string strSql = "select MemberCode,ProfileID,ProfileCreatedBy,MemberName,Gender,DateofBirth,TimeofBirth,BirthPlace,MaritalStatus ";
                    //strSql += " from tbl_membermaster where MemberCode=" + strCode;
                    //dsData = objDb.GetDataTable(strSql);

                    tbl_MemberMasterProp Objtbl_MemberMasterProp = new tbl_MemberMasterProp();
                    Objtbl_MemberMasterProp.MemberCode = 0;
                    Objtbl_MemberMasterProp.ProfileID  = ProfileId; // ProfileID;
                    Objtbl_MemberMasterProp.isLogedin  = true;
                    Objtbl_MemberMasterProp.LoginCode  = 0;

                    tbl_MemberMasterBAL Objtbl_MemberMasterBAL = new tbl_MemberMasterBAL();
                    DataSet             dsMemberMaster         = Objtbl_MemberMasterBAL.Load_MemberDetails(Objtbl_MemberMasterProp);

                    dsMemberMaster.Tables[0].TableName = "dsMemberMaster";

                    tbl_SibblingDetailsProp Objtbl_SibblingDetailsProp = new tbl_SibblingDetailsProp();
                    Objtbl_SibblingDetailsProp.MemberCode = Convert.ToInt32(dsMemberMaster.Tables[0].Rows[0]["MemberCode"]);

                    tbl_SibblingDetailsBAL Objtbl_SibblingDetailsBAL = new tbl_SibblingDetailsBAL();
                    DataSet dsSibbling = Objtbl_SibblingDetailsBAL.Select_Data(Objtbl_SibblingDetailsProp);
                    dsSibbling.Tables[0].TableName = "dsSibblingDtl";


                    tbl_MemberPhotosBAL  objtbl_MemberPhotosBAL  = new tbl_MemberPhotosBAL();
                    tbl_MemberPhotosProp objtbl_MemberPhotosProp = new tbl_MemberPhotosProp();
                    objtbl_MemberPhotosProp.MemberCode = Convert.ToInt32(strCode);
                    DataSet dsMemberPhotos = objtbl_MemberPhotosBAL.Select_Data(objtbl_MemberPhotosProp);
                    dsMemberPhotos.Tables[0].TableName = "dsMemberPhotos";

                    // dsMemberMaster.Tables.Add(dsSibbling.Tables[0]);
                    //dsMemberMaster.Tables.Add(dsMemberPhotos.Tables[0]);
                    frmReportViewer objReportViewer = new frmReportViewer();
                    ReportDocument  cryRpt          = new ReportDocument();
                    string          strPath         = Application.StartupPath + @"\REPORTS\MemberMaster.rpt";
                    cryRpt.Load(strPath);
                    DataSet dstest = new DataSet();

                    dstest.Tables.Add(dsMemberMaster.Tables[0].Copy());
                    //dstest.Tables.Add(dsMemberPhotos.Tables[0].Copy());
                    cryRpt.Subreports["Sibbling"].SetDataSource(dsSibbling.Tables[0]);
                    //cryRpt.Subreports["MemberPhotos"].SetDataSource(dsMemberPhotos.Tables[0]);

                    cryRpt.SetDataSource(dstest);

                    objReportViewer.RptViewer.ReportSource = cryRpt;
                    objReportViewer.RptViewer.Refresh();
                    objReportViewer.ShowDialog();
                    objReportViewer.Focus();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }