예제 #1
0
        private void lnkPrintBlank_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            frmReportViewer objReportViewer = new frmReportViewer();
            ReportDocument  cryRpt          = new ReportDocument();
            string          strPath         = Application.StartupPath + @"\REPORTS\MemberMaster_Blank.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();
        }
        private void btnPrint_Click(object sender, EventArgs e)
        {
            try
            {
                tbl_MemberMasterBAL Objtbl_MemberMasterBAL = new tbl_MemberMasterBAL();
                int MemberCode = Objtbl_MemberMasterBAL.GetMemberCode(txtSearchValue.Text);
                strSql  = " select mm.membercode,MM.ProfileID,MM.MemberName,convert(nvarchar,MM.DateofBirth,103) as DateofBirth,MM.MobileNo,MM.MobileNo1,MM.LandlineNo, ";
                strSql += " SM.StateCity,Convert(varchar(4),MM.DateOfBirth,111) as BornYear, Cas.Caste,CASE WHEN MM.Gender = 0 then 'MALE' else 'FEMALE' END AS Gender, ";
                strSql += " CASE WHEN dbo.isYetMember(mm.MemberCode, 0) <= 0 THEN 'FREE' ELSE 'PAID' END AS Membership";
                strSql += " from tbl_BookmarkList bm";
                strSql += " inner join tbl_MemberMaster mm on mm.membercode=bm.membercode ";
                strSql += " left join dbo.tbl_StateCity SM on SM.StateCityCode=MM.StateCity ";
                strSql += " LEFT OUTER JOIN dbo.tbl_Caste AS Cas ON MM.Caste = Cas.CasteCode ";
                strSql += " WHERE MM.isActive IN (1 ,2) and bm.BookmarkedProfile like '%" + MemberCode + "%'";
                DataTable dtDetails = objDb.GetDataTable(strSql);
                if (dtDetails.Rows.Count > 0)
                {
                    dtDetails.TableName = "dsBookmarklog";
                    frmReportViewer objReportViewer = new frmReportViewer();
                    ReportDocument  cryRpt          = new ReportDocument();
                    string          strPath         = "";

                    strPath = Application.StartupPath + @"\REPORTS\BookmarkLog.rpt";

                    cryRpt.Load(strPath);
                    cryRpt.SetDataSource(dtDetails);
                    objReportViewer.RptViewer.ReportSource = cryRpt;
                    objReportViewer.RptViewer.Refresh();
                    objReportViewer.ShowDialog();
                    objReportViewer.Focus();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
 private void btnPrint_Click(object sender, EventArgs e)
 {
     try
     {
         string strCondi = "";
         //strSql = "  SELECT TOP 1000 MemberCode,ProfileId,MobileNo,MobileNo_Rel,MobileNo1,MobileNo1_Rel,LandlineNo,MobileNo2_Rel,LandlineNo1,LandlineNo1_Rel FROM tbl_membermaster WHERE isnull(MobileNo_Rel,'')='' ";
         strCondi += " AND MM.Gender =" + (rdbtnMale.Checked == true ? "0" : "1");
         if (Convert.ToString(ddlPAgeFrom.SelectedValue) != Convert.ToString(ddlPAgeTo.SelectedValue))
         {
             strCondi += " AND Convert(varchar(4),MM.DateOfBirth,111) Between " + ddlPAgeFrom.Text + " AND " + ddlPAgeTo.Text + "";
         }
         if (Convert.ToInt32(ddlCaste.SelectedValue) > 0)
         {
             strCondi += " AND MM.Caste = " + ddlCaste.SelectedValue;
         }
         tbl_MemberMasterBAL objMembermaster = new tbl_MemberMasterBAL();
         DataSet             dtDetails       = objMembermaster.GET_UPLOAD_PHOTO_PENDING(strCondi);
         if (dtDetails.Tables[0].Rows.Count > 0)
         {
             frmReportViewer objReportViewer = new frmReportViewer();
             ReportDocument  cryRpt          = new ReportDocument();
             string          strPath         = "";
             strPath = Application.StartupPath + @"\REPORTS\PhotoUploadPending.rpt";
             cryRpt.Load(strPath);
             cryRpt.SetDataSource(dtDetails.Tables[0]);
             objReportViewer.RptViewer.ReportSource = cryRpt;
             objReportViewer.RptViewer.Refresh();
             objReportViewer.ShowDialog();
             objReportViewer.Focus();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
        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());
            }
        }
예제 #5
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                string Caste_Sel = "", Education_Sel = "", Country_Sel = "", State_Sel = "", MaritalStatus_Sel = "", strHeight = "", strWeight = "";
                tbl_MemberMasterSearchProp Objtbl_MemberMasterSearchProp = new tbl_MemberMasterSearchProp();
                Objtbl_MemberMasterSearchProp.sMemberCode   = -1;
                Objtbl_MemberMasterSearchProp.sGender       = (rdbtnMale.Checked == true ? "0" : "1");
                Objtbl_MemberMasterSearchProp.sAgeStart     = ddlPAgeFrom.Text;
                Objtbl_MemberMasterSearchProp.sAgeUpto      = ddlPAgeTo.Text;
                Objtbl_MemberMasterSearchProp.PageNo        = 0;
                Objtbl_MemberMasterSearchProp.RecordCount   = 0;
                Objtbl_MemberMasterSearchProp.sSqlCondition = true;
                for (int cnt = 0; cnt < LvwCaste.Items.Count; cnt++)
                {
                    if (LvwCaste.Items[cnt].Checked)
                    {
                        if (Caste_Sel == "")
                        {
                            Caste_Sel = LvwCaste.Items[cnt].SubItems[LvwCaste.Columns.Count - 1].Text;
                        }
                        else
                        {
                            Caste_Sel += "," + LvwCaste.Items[cnt].SubItems[LvwCaste.Columns.Count - 1].Text;
                        }
                    }
                }
                Objtbl_MemberMasterSearchProp.sCaste = Caste_Sel;
                if (Caste_Sel == "")
                {
                    MessageBox.Show("Please select any caste", "Caste Selection Validation", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                    return;
                }
                Country_Sel = "";
                for (int cnt = 0; cnt < LvwCountry.Items.Count; cnt++)
                {
                    if (LvwCountry.Items[cnt].SubItems[LvwCountry.Columns.Count - 1].Text != "-1")
                    {
                        if (LvwCountry.Items[cnt].Checked)
                        {
                            if (Country_Sel == "")
                            {
                                Country_Sel = LvwCountry.Items[cnt].SubItems[LvwCountry.Columns.Count - 1].Text;
                            }
                            else
                            {
                                Country_Sel += "," + LvwCountry.Items[cnt].SubItems[LvwCountry.Columns.Count - 1].Text;
                            }
                        }
                    }
                }
                Objtbl_MemberMasterSearchProp.sCountry = Country_Sel;
                //if (Country_Sel == "")
                //{
                //    MessageBox.Show("Please select any Country", "Country Selection Validation", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                //    return;
                //}
                for (int cnt = 0; cnt < LvwEducation.Items.Count; cnt++)
                {
                    if (LvwEducation.Items[cnt].SubItems[LvwEducation.Columns.Count - 1].Text != "-1")
                    {
                        if (LvwEducation.Items[cnt].Checked)
                        {
                            if (Education_Sel == "")
                            {
                                Education_Sel = LvwEducation.Items[cnt].SubItems[LvwEducation.Columns.Count - 1].Text;
                            }
                            else
                            {
                                Education_Sel += "," + LvwEducation.Items[cnt].SubItems[LvwEducation.Columns.Count - 1].Text;
                            }
                        }
                    }
                }
                Objtbl_MemberMasterSearchProp.sEducation = Education_Sel;
                //if (Education_Sel == "")
                //{
                //    MessageBox.Show("Please select any Education", "Education Selection Validation", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                //    return;
                //}
                for (int cnt = 0; cnt < LvwMaritalStatus.Items.Count; cnt++)
                {
                    if (LvwMaritalStatus.Items[cnt].SubItems[LvwMaritalStatus.Columns.Count - 1].Text != "-1")
                    {
                        if (LvwMaritalStatus.Items[cnt].Checked)
                        {
                            if (MaritalStatus_Sel == "")
                            {
                                MaritalStatus_Sel = LvwMaritalStatus.Items[cnt].SubItems[LvwMaritalStatus.Columns.Count - 1].Text;
                            }
                            else
                            {
                                MaritalStatus_Sel += "," + LvwMaritalStatus.Items[cnt].SubItems[LvwMaritalStatus.Columns.Count - 1].Text;
                            }
                        }
                    }
                }
                Objtbl_MemberMasterSearchProp.sMaritalStatus = MaritalStatus_Sel;
                //if (MaritalStatus_Sel == "")
                //{
                //    MessageBox.Show("Please select any Marital Status", "Marital Status Selection Validation", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                //    return;
                //}
                for (int cnt = 0; cnt < LvwState.Items.Count; cnt++)
                {
                    if (LvwState.Items[cnt].SubItems[LvwState.Columns.Count - 1].Text != "-1")
                    {
                        if (LvwState.Items[cnt].Checked)
                        {
                            if (State_Sel == "")
                            {
                                State_Sel = LvwState.Items[cnt].SubItems[LvwState.Columns.Count - 1].Text;
                            }
                            else
                            {
                                State_Sel += "," + LvwState.Items[cnt].SubItems[LvwState.Columns.Count - 1].Text;
                            }
                        }
                    }
                }
                Objtbl_MemberMasterSearchProp.sStateCity = State_Sel;
                //Objtbl_MemberMasterSearchProp.sSqlCondition

                //if (State_Sel == "")
                //{
                //    MessageBox.Show("Please select any State", "State Selection Validation", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                //    return;
                //}
                int PageCount = 0, RecordCount = 0;
                tbl_MemberMasterBAL objtbl_MemberMasterBAL = new tbl_MemberMasterBAL();
                DataSet             dsdata = objtbl_MemberMasterBAL.Load_ProfileList(Objtbl_MemberMasterSearchProp, ref PageCount, ref RecordCount);
                dsdata.Tables[0].TableName = "dsMainReport";
                frmReportViewer objReportViewer            = new frmReportViewer();
                ReportDocument  cryRpt  = new ReportDocument();
                string          strPath = "";
                if (rbtnFirstPage.Checked)
                {
                    strPath = Application.StartupPath + @"\REPORTS\ProfileReport.rpt";
                }
                else if (rbtnEmail.Checked)
                {
                    strPath = Application.StartupPath + @"\REPORTS\MemberEmailList.rpt";
                }
                else if (rbtnPhoneNumber.Checked)
                {
                    strPath = Application.StartupPath + @"\REPORTS\MemberPhoneNumber.rpt";
                }
                cryRpt.Load(strPath);
                cryRpt.SetDataSource(dsdata.Tables[0]);
                objReportViewer.RptViewer.ReportSource = cryRpt;
                objReportViewer.RptViewer.Refresh();
                objReportViewer.ShowDialog();
                objReportViewer.Focus();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                return;
            }
        }
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                string Caste_Sel = "", Education_Sel = "", Country_Sel = "", State_Sel = "", MaritalStatus_Sel = "", Height_Sel = "", strWeight_Sel = "", StrManglik = "", Incom_Sel = "";

                for (int cnt = 0; cnt < LvwCaste.Items.Count; cnt++)
                {
                    if (LvwCaste.Items[cnt].Checked)
                    {
                        if (Caste_Sel == "")
                        {
                            Caste_Sel = LvwCaste.Items[cnt].SubItems[LvwCaste.Columns.Count - 1].Text;
                        }
                        else
                        {
                            Caste_Sel += "," + LvwCaste.Items[cnt].SubItems[LvwCaste.Columns.Count - 1].Text;
                        }
                    }
                }
                if (Caste_Sel == "")
                {
                    MessageBox.Show("Please select any caste", "Caste Selection Validation", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                    return;
                }
                Country_Sel = "";
                for (int cnt = 0; cnt < LvwCountry.Items.Count; cnt++)
                {
                    if (LvwCountry.Items[cnt].SubItems[LvwCountry.Columns.Count - 1].Text != "-1")
                    {
                        if (LvwCountry.Items[cnt].Checked)
                        {
                            if (Country_Sel == "")
                            {
                                Country_Sel = LvwCountry.Items[cnt].SubItems[LvwCountry.Columns.Count - 1].Text;
                            }
                            else
                            {
                                Country_Sel += "," + LvwCountry.Items[cnt].SubItems[LvwCountry.Columns.Count - 1].Text;
                            }
                        }
                    }
                }
                for (int cnt = 0; cnt < LvwEducation.Items.Count; cnt++)
                {
                    if (LvwEducation.Items[cnt].SubItems[LvwEducation.Columns.Count - 1].Text != "-1")
                    {
                        if (LvwEducation.Items[cnt].Checked)
                        {
                            if (Education_Sel == "")
                            {
                                Education_Sel = LvwEducation.Items[cnt].SubItems[LvwEducation.Columns.Count - 1].Text;
                            }
                            else
                            {
                                Education_Sel += "," + LvwEducation.Items[cnt].SubItems[LvwEducation.Columns.Count - 1].Text;
                            }
                        }
                    }
                }
                for (int cnt = 0; cnt < LvwMaritalStatus.Items.Count; cnt++)
                {
                    if (LvwMaritalStatus.Items[cnt].SubItems[LvwMaritalStatus.Columns.Count - 1].Text != "-1")
                    {
                        if (LvwMaritalStatus.Items[cnt].Checked)
                        {
                            if (MaritalStatus_Sel == "")
                            {
                                MaritalStatus_Sel = LvwMaritalStatus.Items[cnt].SubItems[LvwMaritalStatus.Columns.Count - 1].Text;
                            }
                            else
                            {
                                MaritalStatus_Sel += "," + LvwMaritalStatus.Items[cnt].SubItems[LvwMaritalStatus.Columns.Count - 1].Text;
                            }
                        }
                    }
                }
                for (int cnt = 0; cnt < LvwState.Items.Count; cnt++)
                {
                    if (LvwState.Items[cnt].SubItems[LvwState.Columns.Count - 1].Text != "-1")
                    {
                        if (LvwState.Items[cnt].Checked)
                        {
                            if (State_Sel == "")
                            {
                                State_Sel = LvwState.Items[cnt].SubItems[LvwState.Columns.Count - 1].Text;
                            }
                            else
                            {
                                State_Sel += "," + LvwState.Items[cnt].SubItems[LvwState.Columns.Count - 1].Text;
                            }
                        }
                    }
                }
                for (int cnt = 0; cnt < LvwHeight.Items.Count; cnt++)
                {
                    if (LvwHeight.Items[cnt].SubItems[LvwHeight.Columns.Count - 1].Text != "-1")
                    {
                        if (LvwHeight.Items[cnt].Checked)
                        {
                            if (Height_Sel == "")
                            {
                                Height_Sel = LvwHeight.Items[cnt].SubItems[LvwHeight.Columns.Count - 1].Text;
                            }
                            else
                            {
                                Height_Sel += "," + LvwHeight.Items[cnt].SubItems[LvwHeight.Columns.Count - 1].Text;
                            }
                        }
                    }
                }
                for (int cnt = 0; cnt < LvwManglic.Items.Count; cnt++)
                {
                    if (LvwManglic.Items[cnt].SubItems[LvwManglic.Columns.Count - 1].Text != "-1")
                    {
                        if (LvwManglic.Items[cnt].Checked)
                        {
                            if (StrManglik == "")
                            {
                                StrManglik = LvwManglic.Items[cnt].SubItems[LvwManglic.Columns.Count - 1].Text;
                            }
                            else
                            {
                                StrManglik += "," + LvwManglic.Items[cnt].SubItems[LvwManglic.Columns.Count - 1].Text;
                            }
                        }
                    }
                }
                for (int cnt = 0; cnt < LvwIncome.Items.Count; cnt++)
                {
                    if (LvwIncome.Items[cnt].SubItems[LvwIncome.Columns.Count - 1].Text != "-1")
                    {
                        if (LvwIncome.Items[cnt].Checked)
                        {
                            if (Incom_Sel == "")
                            {
                                Incom_Sel = LvwIncome.Items[cnt].SubItems[LvwIncome.Columns.Count - 1].Text;
                            }
                            else
                            {
                                Incom_Sel += "," + LvwIncome.Items[cnt].SubItems[LvwIncome.Columns.Count - 1].Text;
                            }
                        }
                    }
                }
                string strSql = "";
                strSql  = " Select MemberCode from tbl_MemberMaster MM where MM.isActive IN (1 ,2)  AND MM.Gender =" + (rdbtnMale.Checked == true ? "0" : "1");
                strSql += " AND Convert(varchar(4),MM.DateOfBirth,111) Between " + ddlPAgeFrom.Text + " AND " + ddlPAgeTo.Text + "";
                if (State_Sel != "")
                {
                    strSql += " AND MM.StateCity IN (" + State_Sel + ")";
                }
                if (MaritalStatus_Sel != "")
                {
                    strSql += " AND MM.MaritalStatus IN (" + MaritalStatus_Sel + ") ";
                }
                if (Education_Sel != "")
                {
                    strSql += " AND MM.Education IN (" + Education_Sel + ")";
                }
                if (Country_Sel != "")
                {
                    strSql += " AND MM.VisaCountry IN (" + Country_Sel + ")";
                }
                if (Caste_Sel != "")
                {
                    strSql += " AND MM.Caste IN (" + Caste_Sel + ")";
                }
                if (Height_Sel != "")
                {
                    strSql += " AND MM.Height IN (" + Height_Sel + ")";
                }
                if (strWeight_Sel != "")
                {
                    strSql += " AND MM.Weight IN (" + strWeight_Sel + ")";
                }
                if (StrManglik != "")
                {
                    strSql += " AND MM.Manglik IN (" + StrManglik + ")";
                }
                if (txtFromWeight.Text != "" && txtToWeight.Text != "")
                {
                    strSql += " AND Weight BETWEEN " + txtFromWeight.Text + " AND " + txtToWeight.Text + "";
                }
                if (Incom_Sel != "")
                {
                    strSql += " AND AnnualIncome IN (" + Incom_Sel + ")";
                }
                if (txtFromDate.Text != txtToDate.Text)
                {
                    strSql += " AND RegisterDate between '" + txtFromDate.Value.ToString("dd/MMM/yyyy") + "' and '" + txtToDate.Value.ToString("dd/MMM/yyyy") + "'";
                }
                strSql += " ORDER BY MemberCode DESC";
                //if (State_Sel == "")
                //{
                //    MessageBox.Show("Please select any State", "State Selection Validation", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                //    return;
                //}
                string    strMemberCode = "";
                DataTable dt            = objDb.GetDataTable(strSql);
                if (dt.Rows.Count > 0)
                {
                    for (int cnt = 0; cnt < dt.Rows.Count; cnt++)
                    {
                        if (strMemberCode == "")
                        {
                            strMemberCode = Convert.ToString(dt.Rows[cnt]["MemberCode"]);
                        }
                        else
                        {
                            strMemberCode += "," + Convert.ToString(dt.Rows[cnt]["MemberCode"]);
                        }
                    }
                }
                int PageCount = 0, RecordCount = 0;
                tbl_MemberMasterBAL objtbl_MemberMasterBAL = new tbl_MemberMasterBAL();
                DataSet             dsdata = objtbl_MemberMasterBAL.Load_ProfileList_New(strMemberCode);
                dsdata.Tables[0].TableName = "dsMainReport";
                frmReportViewer objReportViewer = new frmReportViewer();
                ReportDocument  cryRpt     = new ReportDocument();
                string          strPath    = "";
                if (rbtnFirstPage.Checked)
                {
                    strPath = Application.StartupPath + @"\REPORTS\ProfileReport.rpt";
                }
                else if (rbtnPhoneNumber.Checked)
                {
                    strPath = Application.StartupPath + @"\REPORTS\MemberPhoneNumber.rpt";
                }
                else if (rbtnEmail.Checked)
                {
                    strPath = Application.StartupPath + @"\REPORTS\MemberEmailList.rpt";
                }

                cryRpt.Load(strPath);
                cryRpt.SetDataSource(dsdata.Tables[0]);
                objReportViewer.RptViewer.ReportSource = cryRpt;
                objReportViewer.RptViewer.Refresh();
                objReportViewer.ShowDialog();
                objReportViewer.Focus();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
        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);
            }
        }
예제 #8
0
 private void btnSubmit_Click(object sender, EventArgs e)
 {
     try
     {
         string strCond = "", Caste_Sel = "", Country_Sel = "", State_Sel = "", MaritalStatus_Sel = "";
         if (rdbtnMale.Checked)
         {
             strCond += " AND MM.Gender=0 ";
         }
         else if (rdbtnFemale.Checked)
         {
             strCond += " AND MM.Gender=1 ";
         }
         for (int cnt = 0; cnt < LvwCaste.Items.Count; cnt++)
         {
             if (LvwCaste.Items[cnt].Checked)
             {
                 if (Caste_Sel == "")
                 {
                     Caste_Sel = LvwCaste.Items[cnt].SubItems[LvwCaste.Columns.Count - 1].Text;
                 }
                 else
                 {
                     Caste_Sel += "," + LvwCaste.Items[cnt].SubItems[LvwCaste.Columns.Count - 1].Text;
                 }
             }
         }
         if (Caste_Sel != "")
         {
             strCond += " AND MM.Caste in (" + Caste_Sel + ")";
         }
         if (Convert.ToString(ddlPAgeFrom.SelectedValue) != Convert.ToString(ddlPAgeTo.SelectedValue))
         {
             strCond += " AND Convert(varchar(4),MM.DateOfBirth,111) Between " + ddlPAgeFrom.SelectedValue + " AND " + ddlPAgeTo.SelectedValue + " ";
         }
         for (int cnt = 1; cnt < LvwCountry.Items.Count; cnt++)
         {
             if (LvwCountry.Items[cnt].Checked)
             {
                 if (Country_Sel == "")
                 {
                     Country_Sel = LvwCountry.Items[cnt].SubItems[LvwCountry.Columns.Count - 1].Text;
                 }
                 else
                 {
                     Country_Sel += "," + LvwCountry.Items[cnt].SubItems[LvwCountry.Columns.Count - 1].Text;
                 }
             }
         }
         if (Country_Sel != "")
         {
             strCond += " AND MM.Country in (" + Country_Sel + ")";
         }
         for (int cnt = 1; cnt < LvwState.Items.Count; cnt++)
         {
             if (LvwState.Items[cnt].Checked)
             {
                 if (State_Sel == "")
                 {
                     State_Sel = LvwState.Items[cnt].SubItems[LvwState.Columns.Count - 1].Text;
                 }
                 else
                 {
                     State_Sel += "," + LvwState.Items[cnt].SubItems[LvwState.Columns.Count - 1].Text;
                 }
             }
         }
         if (State_Sel != "")
         {
             strCond += " AND MM.StateCity in (" + State_Sel + ")";
         }
         for (int cnt = 1; cnt < LvwMaritalStatus.Items.Count; cnt++)
         {
             if (LvwMaritalStatus.Items[cnt].Checked)
             {
                 if (MaritalStatus_Sel == "")
                 {
                     MaritalStatus_Sel = LvwMaritalStatus.Items[cnt].SubItems[LvwMaritalStatus.Columns.Count - 1].Text;
                 }
                 else
                 {
                     MaritalStatus_Sel += "," + LvwMaritalStatus.Items[cnt].SubItems[LvwMaritalStatus.Columns.Count - 1].Text;
                 }
             }
         }
         if (MaritalStatus_Sel != "")
         {
             strCond += " AND MM.MaritalStatus in (" + MaritalStatus_Sel + ")";
         }
         if (dtpFromDate.Value.ToShortDateString() != dtpToDate.Value.ToShortDateString())
         {
             strCond += " AND MM.RegisterDate BETWEEN '" + dtpFromDate.Value.ToString("dd/MMM/yyyy") + "' AND '" + dtpToDate.Value.ToString("dd/MMM/yyyy") + "'";
         }
         if (strCond == "")
         {
             MessageBox.Show("Please select Something", "Selection Validation", MessageBoxButtons.OK, MessageBoxIcon.Hand);
             return;
         }
         tbl_MemberMasterBAL objtbl_MemberMasterBAL = new tbl_MemberMasterBAL();
         DataSet             dsdata = objtbl_MemberMasterBAL.GET_REGISTERED_MEMBER(strCond);
         if (dsdata.Tables[0].Rows.Count > 0)
         {
             frmReportViewer objReportViewer = new frmReportViewer();
             ReportDocument  cryRpt          = new ReportDocument();
             string          strPath         = "";
             strPath = Application.StartupPath + @"\REPORTS\RegisterReport.rpt";
             cryRpt.Load(strPath);
             cryRpt.SetDataSource(dsdata.Tables[0]);
             objReportViewer.RptViewer.ReportSource = cryRpt;
             objReportViewer.RptViewer.Refresh();
             objReportViewer.ShowDialog();
             objReportViewer.Focus();
         }
         else
         {
             MessageBox.Show("No data found", "Data not found", MessageBoxButtons.OK, MessageBoxIcon.Hand);
             return;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }