public void CreateEmailDesign(string[] ArrDesign, string[] ArrTo)
        {
            try
            {
                if (ArrTo.Length > 0 && ArrDesign.Length > 0)
                {
                    string strHtml = "";
                    strHtml += " <html xmlns='http://www.w3.org/1999/xhtml'> ";
                    strHtml += " <head> ";
                    strHtml += " <meta http-equiv='Content-Type' content='text/html; charset=utf-8' /> ";
                    strHtml += " <title></title> ";
                    strHtml += " <link href='https://fonts.googleapis.com/css?family=Lato:400,500,600,700' rel='stylesheet' /> ";
                    strHtml += " </head> ";
                    strHtml += " <body style='font-family: ' lato',=Lato', sans-serif;background-color=sans-serif;background-color #ffffff;margin=#ffffff;margin 0px;padding=0px;padding 0px;width=0px;width 100%;font-size=100%;font-size 15px;font-weight=15px;font-weight 400;color=400;color #323232;line-height=#323232;line-height 18px;text-align:left;'=18px;text-align:left;'> ";

                    strHtml += " <table width='700px' border='0' align='center' cellpadding='0' cellspacing='0' class='contentbg'> ";
                    strHtml += " <tr><td valign='top'><table width='100%' border='0' cellspacing='0' cellpadding='0'><tr> ";
                    strHtml += " <td valign='top' bgcolor='#FFFFFF'><table width='800' border='0' align='center' cellpadding='0' cellspacing='0'> ";
                    strHtml += " <tr><td width='800' height='105' align='left' valign='top'><table width='800' border='0' cellspacing='0' cellpadding='0'> ";
                    strHtml += " <tr><td valign='top' bgcolor='#ca3b3b' style='padding:35px;'><a href='#'><img src='http://www.anantmatrimony.com/images/logo.png' width='349' height='107' alt='logo' style='margin-left: auto;margin-right: auto;' /></a></td> ";
                    strHtml += " </tr></table><table width='800' border='0' cellspacing='0' cellpadding='0'> ";
                    strHtml += " <tr><td width='800' valign='top' style='padding:35px;text-align:center;font-size: 24px;font-weight: 600;color: #ca3b3b;'>Match with your profile</td> ";
                    strHtml += " </tr></table></td></tr></table></td></tr></table></td></tr><tr><td> ";
                    strHtml += " <table width='100%' border='0' cellspacing='0' cellpadding='0'><tr> <td valign='top' bgcolor='#ffffff'> ";
                    strHtml += " <table width='540px' style='margin-left:160px;' border='0' align='center' cellpadding='0' cellspacing='0'> ";
                    for (int cnt = 0; cnt < ArrDesign.Length; cnt++)
                    {
                        //<!--Loop Start-->
                        tbl_MemberMasterBAL objtbl_MemberMasterBAL = new tbl_MemberMasterBAL();
                        DataSet             dsdata = objtbl_MemberMasterBAL.Load_ProfileList_New(ArrDesign[cnt]);
                        if (dsdata.Tables[0].Rows.Count > 0)
                        {
                            strHtml += " <tr> ";
                            strHtml += " <td width='200' valign='top'> ";
                            strHtml += " <table width='100%' border='0' cellspacing='0' cellpadding='0'> ";
                            strHtml += " <tr> ";
                            strHtml += " <td valign='top' width='100' style='color:#ca3b3b;line-height:24px;'>" + dsdata.Tables[0].Rows[0]["ProfileId"] + "</td> ";
                            strHtml += " </tr>   </table>  </td>  </tr>  <tr> ";
                            strHtml += " <td width='800' valign='top'> ";
                            strHtml += " <table width='100%' border='0' cellspacing='0' cellpadding='0'>  <tr> ";
                            strHtml += " <td valign='top' width='100'><img src='http://www.anantmatrimony.com/MemberPhoto/" + Convert.ToString(dsdata.Tables[0].Rows[0]["PhotoFileName"]) + "' width='166' height='166' alt='sub image' style='display:block;' /></td> ";
                            strHtml += " <td width='700' valign='top'> ";

                            strHtml += " <table width='100%' border='0' cellspacing='0' cellpadding='0'> ";
                            strHtml += " <tr> ";
                            strHtml += " <td valign='top' width='300'> ";
                            strHtml += " <table width='100%' border='0' cellspacing='0' cellpadding='0'> ";

                            strHtml += " <tr> ";
                            strHtml += " <td> ";
                            strHtml += " <ul> ";
                            strHtml += " <li style='list-style-type: none;line-height: 26px;'>Birth Year: " + Convert.ToString(dsdata.Tables[0].Rows[0]["BirthYear"]) + "</li> ";
                            strHtml += " <li style='list-style-type: none;line-height: 26px;'>Caste: " + Convert.ToString(dsdata.Tables[0].Rows[0]["Caste"]) + "</li> ";
                            strHtml += " <li style='list-style-type: none;line-height: 26px;'>Height: " + Convert.ToString(dsdata.Tables[0].Rows[0]["Height"]) + "</li> ";
                            strHtml += " <li style='list-style-type: none;line-height: 26px;'>Weight: " + Convert.ToString(dsdata.Tables[0].Rows[0]["Weight"]) + "</li> ";
                            strHtml += " <li style='list-style-type: none;line-height: 26px;'>Marital Status : " + Convert.ToString(dsdata.Tables[0].Rows[0]["MaritalStatus"]) + "</li> ";

                            strHtml += " </ul> ";
                            strHtml += " </td> ";
                            strHtml += " <td width='400' valign='top'> ";

                            strHtml += " <table width='100%' border='0' cellspacing='0' cellpadding='0'> ";
                            strHtml += " <tr> ";
                            strHtml += " <td valign='top' style='padding-left:30px;'> ";
                            strHtml += " <table width='100%' border='0' cellspacing='0' cellpadding='0'> ";

                            strHtml += " <tr> ";
                            strHtml += " <td> ";
                            strHtml += " <ul> ";
                            strHtml += " <li style='list-style-type: none;line-height: 26px;'>Education: " + Convert.ToString(dsdata.Tables[0].Rows[0]["Education"]) + "</li> ";
                            strHtml += " <li style='list-style-type: none;line-height: 26px;'>Degree: " + Convert.ToString(dsdata.Tables[0].Rows[0]["Degree"]) + "</li> ";
                            strHtml += " <li style='list-style-type: none;line-height: 26px;'>State / City: " + Convert.ToString(dsdata.Tables[0].Rows[0]["StateCity"]) + "</li> ";
                            strHtml += " <li style='list-style-type: none;line-height: 26px;'>Visa Status: " + Convert.ToString(dsdata.Tables[0].Rows[0]["VisaStatus"]) + "</li> ";
                            strHtml += " <li style='list-style-type: none;line-height: 26px;'>Visa Country: " + Convert.ToString(dsdata.Tables[0].Rows[0]["VisaCountry"]) + "</li> ";
                            strHtml += " </ul> ";
                            strHtml += " </td> ";
                            strHtml += " </tr>  ";
                            strHtml += " </table> ";
                            strHtml += " </td> ";
                            strHtml += " </tr> ";
                            strHtml += " </table> ";
                            strHtml += " </td> ";
                            strHtml += " </tr>  ";
                            strHtml += " </table> ";
                            strHtml += " </td> ";
                            strHtml += " </tr> ";
                            strHtml += " </table> ";
                            //<!--Promotion End-->

                            strHtml += " </td> ";
                            strHtml += " </tr> ";
                            strHtml += " </table> ";
                            strHtml += " </td> ";
                            strHtml += " </tr> ";
                            //<!--Loop END-->
                            //<!--Browse All-->
                        }
                    }
                    strHtml            += " <tr><td width='800' valign='top'><table width='650' border='0' cellspacing='0' cellpadding='0' style='padding-top:20px;'> ";
                    strHtml            += " <tr><td valign='top' width='500' style='color:#ca3b3b;line-height:24px;text-align:center;font-size:18px;padding-left:50px;'><b><a href='http://www.anantmatrimony.com' target='_blank' style='color:#ca3b3b;'>BROWSE ALL >></a></b></td> ";
                    strHtml            += " </tr></table></td></tr><tr> <td valign='top'> <table width='100%' border='0' cellspacing='0' cellpadding='0'> ";
                    strHtml            += " <tr> <td valign='top'> <table width='600' border='0' align='center' cellpadding='0' cellspacing='0'> <tr> <td valign='top' style='padding:20px 0px;'> ";
                    strHtml            += " <table width='500px' border='0' cellspacing='0' cellpadding='0'> <tr>  <td width='800' valign='top'> <table width='100%' border='0' cellspacing='0' cellpadding='0'> ";
                    strHtml            += " <tr> <td class='footerheading' width='800' valign='top' style='padding-bottom:16px;text-align:center;font-size: 22px;font-weight: 600;color: #323232;line-height: 44px;'>For More Details, Call Us!</td>  ";
                    strHtml            += " </tr> <tr> <td width='800' valign='top' style='padding-bottom:16px;border-bottom:1px solid #e8e8e8;font-size: 35px;font-weight: 600;color: #f54d56;line-height: 24px;text-align:center;'>9428412065/9998489093</td> ";
                    strHtml            += " </tr> </table> </td> </tr> </table> </td> </tr> </table> </td> </tr> <tr> <td valign='top'> <table width='800' border='0' align='center' cellpadding='0' cellspacing='0'> ";
                    strHtml            += " <tr> <td valign='top' style='padding-bottom:33px;'> <table width='100%' border='0' cellspacing='0' cellpadding='0'> <tr> <td width='800' valign='top'> ";
                    strHtml            += " <table width='800' border='0' cellspacing='0' cellpadding='0'> <tr> <td valign='top' style='padding-top:21px; padding-bottom:17px;'> ";
                    strHtml            += " <table width='100%' border='0' cellspacing='0' cellpadding='0'></table> </td> </tr> <tr>  ";
                    strHtml            += " <td valign='top' style='font-size:13px;color:#989797;text-align:center; padding-right:84px;'>  ";
                    strHtml            += "  © 2003 - 2019 AnantMatrimony.com & Kankukanya.com. All Rights Reserved.<br /> </td> </tr> </table> </td> </tr> <tr> <td width='150' valign='top'> ";
                    strHtml            += "  <table width='100%' border='0' cellspacing='0' cellpadding='0'></table> </td> <td width='150' valign='top'> <table width='100%' border='0' cellspacing='0' cellpadding='0'></table> ";
                    strHtml            += "  </td></tr></table></td></tr></table></td></tr></table></td></tr> </table></td></tr></table></td></tr></table></body></html> ";
                    txtMessageLog.Text  = "Design Ready";
                    txtMessageLog.Text += Environment.NewLine;
                    txtMessageLog.Text += "Total " + ArrTo.Length + " email going to send";
                    for (int cnt1 = 0; cnt1 < ArrTo.Length; cnt1++)
                    {
                        tbl_MemberMasterBAL objtbl_MemberMasterBAL = new tbl_MemberMasterBAL();
                        DataSet             dsdata = objtbl_MemberMasterBAL.Load_ProfileList_New(ArrTo[cnt1]);
                        objGlobal.SendMail(Convert.ToString(dsdata.Tables[0].Rows[0]["EmailId"]), "AnantMatrimony : Match with your profile", strHtml, true, "*****@*****.**", "Changeme@123");
                        txtMessageLog.Text += " >> Mail Number (" + (cnt1 + 1) + ") >> Mail sent on " + Convert.ToString(dsdata.Tables[0].Rows[0]["EmailId"]);
                        txtMessageLog.Text += Environment.NewLine;
                    }
                }
                MessageBox.Show("Mail Send", "Mail send", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
        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);
            }
        }