Exemple #1
0
        private bool EmailCrossCheck(string EmailID)
        {
            ManageUserSVC.ManageUserClient Client = new ManageUserSVC.ManageUserClient();
            string Chk = Client.CheckEmailID(EmailID);

            if (Chk.Equals("EXIST"))
            {
                lblEmailError.Visible   = true;
                lblEmailError.ForeColor = System.Drawing.Color.Red;
                lblEmailError.Text      = "The Email entered already exists in our database";
                return(false);
            }

            return(true);
        }
Exemple #2
0
        protected void btn2Next_Click(object sender, EventArgs e)
        {
            customerEnrollment.LabelError.Visible = false;
            ManageUserSVC.ManageUserClient       client    = new ManageUserSVC.ManageUserClient();
            ManageUserSVC.ManageUserCustomerData UserData  = new ManageUserSVC.ManageUserCustomerData();
            ManageUserSVC.ManageUserCoverageData CoverData = new ManageUserSVC.ManageUserCoverageData();
            customerEnrollment.LabelError.Text = "";
            //lblSuccess.Text = "";
            if (customerEnrollment.IsValidate())
            {
                if (customerEnrollment.Agree.Checked)
                {
                    if (ViewState["RenewCustomer"] == null)
                    {
                        string Chk = client.CheckEmailID(customerEnrollment.EmailID.Text);
                        if (Chk.Equals("EXIST"))
                        {
                            customerEnrollment.LavelGoToLogin.Visible = true;
                            customerEnrollment.linkLogin.Visible      = true;
                            customerEnrollment.LavelGoToLogin.Text    = "This Email Id is Already Exists, Please click on link for login";
                        }
                        else
                        {
                            UserData.PersonalID   = customerEnrollment.UserID.Text;
                            UserData.CustID       = Guid.NewGuid();
                            ViewState["custID"]   = UserData.CustID;
                            Session["CustomerID"] = UserData.CustID;

                            UserData.FirstName   = customerEnrollment.FirstName.Text;
                            UserData.CompanyName = customerEnrollment.CompanyName.Text;
                            UserData.Address     = customerEnrollment.Address.Text;
                            UserData.EmailID     = customerEnrollment.EmailID.Text;
                            ViewState["EmailID"] = UserData.EmailID;
                            UserData.PhoneNo     = customerEnrollment.PhoneNo.Text;
                            UserData.City        = customerEnrollment.City.Text;
                            if (!customerEnrollment.States.SelectedItem.Text.Equals("--Select--"))
                            {
                                UserData.State = customerEnrollment.States.SelectedItem.Text;
                            }

                            UserData.ZipCode = customerEnrollment.ZipCode.Text;
                            UserData.Country = "CA";
                            if (!customerEnrollment.CompnyAffilation.SelectedItem.Text.Equals("--Select--"))
                            {
                                UserData.CompanyAffilID = Guid.Parse(customerEnrollment.CompnyAffilation.SelectedItem.Value);
                            }
                            UserData.SignUpDate  = DateTime.Now;
                            UserData.LastUpdated = DateTime.Now;
                            UserData.LastName    = customerEnrollment.LastName.Text;

                            UserData.IsActivePolicy = false;
                            UserData.IsActive       = true;
                            UserData.IsPropertyBuy  = false;
                            UserData.InsuraceType   = "";
                            UserData.Payment        = 0;
                            UserData.YourID         = GetID(customerEnrollment.LastName.Text, customerEnrollment.PhoneNo.Text);
                            UserData.ApplicationNo  = DateTime.Now.Ticks.ToString("x").ToUpper();
                            UserData.SecurityCode   = Guid.NewGuid().ToString().GetHashCode().ToString("x");
                            Session["Paswrd"]       = UserData.SecurityCode;
                            UserData.VerifyEmail    = false;
                            Session["CustomerInfo"] = UserData.FirstName + " " + UserData.LastName;
                            UserData.IsSecCodeSent  = false;

                            string url = System.Configuration.ConfigurationManager.AppSettings["HostingPrefix"];


                            //Sending verify email...
                            //string VerifyString = url + "Validate.aspx?id=" + Guid.NewGuid().ToString();
                            StringBuilder strVerifyBody = new StringBuilder();
                            string        headurl       = url + "images/image.png";
                            //header
                            strVerifyBody.Append("<p>&nbsp;</p>");
                            strVerifyBody.Append("<div style=" + c + "margin-left: auto;height:500px;margin-right: auto;position: absolute;text-align: center;top: 0;width: 100%;z-index: 999;" + c + ">");
                            strVerifyBody.Append("<div style=" + c + "background: url('" + headurl + "') repeat-x scroll 0 0 transparent;height: 75px; width:798px;  position: relative;top: 0;z-index: 999;" + c + ">" + "<br/>");

                            //body
                            strVerifyBody.Append("<p>&nbsp;</p><table style='font-family: Tahoma;' border='0' cellpadding='0' cellspacing='0' width='600'><tbody><tr><td><table style='font-family: Tahoma;' border='0' cellpadding='0' cellspacing='0' width='600'>");
                            strVerifyBody.Append("<tbody><tr style='font-family: Tahoma; font-size: 15px; color: rgb(33, 33, 33); text-align: left; ' valign='top'><td style='padding:35px 20px;font-family: Tahoma;'>");

                            strVerifyBody.Append("<br/>" + UserData.FirstName + " " + UserData.LastName + "," + "<br/><br/>");
                            strVerifyBody.Append("Welcome to dscoverage.ca</b><br/><br/>");
                            strVerifyBody.Append("Please verify your email address by clicking <a href='" + url + "Validate.aspx?" + Crypto.ArgumentEncrypt("veryid") + "=" + Crypto.Encrypt(UserData.CustID.ToString(), true) + "' target='dscoveragemain'> here</a><br/><br/>");
                            strVerifyBody.Append("Sincerely,<br/>");
                            strVerifyBody.Append("dscoverage.ca<br/>");
                            strVerifyBody.Append("</tr></tbody></table>");
                            //footer
                            string footurl = url + "images/footer-b.jpg";
                            strVerifyBody.Append("<div style=" + c + "background: url('" + url + "images/footer-b.jpg') no-repeat scroll 0 0 transparent;color: #939393;font-size: 10px;height: 60px;line-height: 44px;overflow: hidden;padding: 0 20px;width: 760px;margin-top: 5px;" + c + ">" + "<p style='float: left;color: white;'>Copyright © " + DateTime.Now.Year.ToString() + " <a href='https://dscoverage.ca' target='_blank' style='color:white;font-weight: bolder;'>dscoverage.ca</a>, Inc. All Rights Reserved.</p></div>");
                            string Subject = ConfigurationManager.AppSettings["VerifyEmailSubject"].ToString();
                            bool   Sent1   = CommonFunction.SendEmail(customerEnrollment.EmailID.Text.Trim(), strVerifyBody.ToString(), Subject);

                            if (Sent1)
                            {
                                client.InsertUser(UserData);
                                Response.Redirect("Validate.aspx?" + Crypto.ArgumentEncrypt("ressult") + "=" + Crypto.Encrypt("sucess", true));
                            }
                            else
                            {
                                Response.Redirect("Validate.aspx?" + Crypto.ArgumentEncrypt("ressult") + "=" + Crypto.Encrypt("fail", true));
                            }
                            //pnl2Custmrinfo.Visible = false;
                        }
                    }
                    if (ViewState["RenewCustomer"] != null)
                    {
                        DataSet Data = ViewState["RenewCustomer"] as DataSet;
                        if (Data != null && Data.Tables[0].Rows.Count > 0)
                        {
                            UserData.CustID       = Guid.Parse(Data.Tables[0].Rows[0]["Cust_ID"].ToString());
                            Session["CustomerID"] = UserData.CustID;

                            UserData.PersonalID  = customerEnrollment.UserID.Text;
                            UserData.FirstName   = customerEnrollment.FirstName.Text;
                            UserData.CompanyName = customerEnrollment.CompanyName.Text;
                            UserData.Address     = customerEnrollment.Address.Text;
                            UserData.EmailID     = customerEnrollment.EmailID.Text;
                            UserData.PhoneNo     = customerEnrollment.PhoneNo.Text;
                            UserData.City        = customerEnrollment.City.Text;
                            if (!customerEnrollment.States.SelectedItem.Text.Equals("--Select--"))
                            {
                                UserData.State = customerEnrollment.States.SelectedItem.Text;
                            }

                            UserData.ZipCode = customerEnrollment.ZipCode.Text;
                            UserData.Country = "CA";
                            if (!customerEnrollment.CompnyAffilation.SelectedItem.Text.Equals("--Select--"))
                            {
                                UserData.CompanyAffilID = Guid.Parse(customerEnrollment.CompnyAffilation.SelectedItem.Value);
                            }
                            UserData.SignUpDate  = DateTime.Now;
                            UserData.LastUpdated = DateTime.Now;
                            UserData.LastName    = customerEnrollment.LastName.Text;

                            UserData.IsActivePolicy = false;
                            UserData.IsActive       = true;
                            UserData.IsPropertyBuy  = false;
                            UserData.InsuraceType   = "";
                            UserData.Payment        = 0;
                            Session["CustomerInfo"] = UserData.FirstName + " " + UserData.LastName;


                            //Added By MKP
                            UserData.YourID = Data.Tables[0].Rows[0]["YID"] != null?Convert.ToString(Data.Tables[0].Rows[0]["YID"]) : GetID(customerEnrollment.LastName.Text, customerEnrollment.PhoneNo.Text);

                            UserData.ApplicationNo = Data.Tables[0].Rows[0]["ApplicationNo"] != null?Convert.ToString(Data.Tables[0].Rows[0]["ApplicationNo"]) : DateTime.Now.Ticks.ToString("x").ToUpper();

                            UserData.SecurityCode = Data.Tables[0].Rows[0]["SecurityCode"] != null?Convert.ToString(Data.Tables[0].Rows[0]["SecurityCode"]) : Guid.NewGuid().ToString().GetHashCode().ToString("x");

                            UserData.VerifyEmail   = true;
                            UserData.IsSecCodeSent = Data.Tables[0].Rows[0]["IsSecCodeSent"] != null?Convert.ToBoolean(Data.Tables[0].Rows[0]["IsSecCodeSent"]) : false;

                            UserData.VerifyEmail = Data.Tables[0].Rows[0]["VerifyEmail"] != null?Convert.ToBoolean(Data.Tables[0].Rows[0]["VerifyEmail"]) : false;

                            //Code Commented By MKP
                            //UserData.IsSecCodeSent = false;
                            //UserData.YourID = GetID(customerEnrollment.LastName.Text, customerEnrollment.PhoneNo.Text);
                            //UserData.ApplicationNo = DateTime.Now.Ticks.ToString("x").ToUpper();
                            //UserData.SecurityCode = Guid.NewGuid().ToString().GetHashCode().ToString("x");
                            //Session["Paswrd"] = UserData.SecurityCode;
                            ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                            //Code Commented By MKP

                            //string url = System.Configuration.ConfigurationManager.AppSettings["HostingPrefix"];
                            //StringBuilder strVerifyBody = new StringBuilder();

                            ////header
                            //strVerifyBody.Append("<p>&nbsp;</p>");
                            //strVerifyBody.Append("<div style=" + c + "margin-left: auto;height:500px;margin-right: auto;position: absolute;text-align: center;top: 0;width: 100%;z-index: 999;" + c + ">");
                            //strVerifyBody.Append("<div style=" + c + "background: url('" + url + "images/image.png') repeat-x scroll 0 0 transparent;height: 75px; width:798px;  position: relative;top: 0;z-index: 999;" + c + ">" + "<br/>");
                            //// strVerifyBody.Append("<span style=" + c + "margin-left:661px; background color:white;" + c + ">" + "Welcome" + " " + UserData.FirstName + UserData.LastName + " </span>");

                            ////body
                            //strVerifyBody.Append("<html><body><p>&nbsp;</p><table style='font-family: Tahoma;' border='0' cellpadding='0' cellspacing='0' width='600'><tbody><tr><td><table style='font-family: Tahoma;' border='0' cellpadding='0' cellspacing='0' width='600'>");
                            //strVerifyBody.Append("<tbody><tr style='font-family: Tahoma; font-size: 15px; color: rgb(33, 33, 33); text-align: left; ' valign='top'><td style='padding:35px 20px;font-family: Tahoma;'>");
                            //strVerifyBody.Append("<br/>" + UserData.FirstName + " " + UserData.LastName + "," + "<br/><br/>");
                            //strVerifyBody.Append("Welcome to dscoverage.ca</b><br/><br/>");
                            //strVerifyBody.Append("Please verify your email address by clicking <a href='" + url + "Insurance/Validate.aspx?" + Crypto.ArgumentEncrypt("veryid") + "=" + Crypto.Encrypt(UserData.CustID.ToString(), true) + "' target='dscoveragemain'> here</a><br/><br/>");
                            //strVerifyBody.Append("Sincerely,<br/>");
                            //strVerifyBody.Append("dscoverage.ca<br/>");
                            //strVerifyBody.Append("</tr></tbody></table>");
                            ////footer

                            //strVerifyBody.Append("<div style=" + c + "background: url('" + url + "images/footer-b.jpg') no-repeat scroll 0 0 transparent;color: #939393;font-size: 10px;height: 60px;line-height: 44px;overflow: hidden;padding: 0 20px;width: 760px;margin-top: 5px;" + c + ">" + "<p style='float: left;color: white;'>Copyright © " + DateTime.Now.Year.ToString() + " <a href='https://dscoverage.ca' target='dscoveragemain' style='color:white;font-weight: bolder;'>dscoverage.ca</a>, Inc. All Rights Reserved.</p></div>");
                            //string Subject = ConfigurationManager.AppSettings["VerifyEmailSubject"].ToString();
                            //bool Sent1 = CommonFunction.SendEmail(customerEnrollment.EmailID.Text.Trim(), strVerifyBody.ToString(), Subject);
                            //client.Update_VerificationStatus(UserData.CustID, false, false);
                            ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


                            client.InsertUser(UserData);
                            //pnl2Custmrinfo.Visible = false;
                            //pnl3Coverage.Visible = true;
                            multiViewRegistration.ActiveViewIndex = 2;
                            if (!VerifyEmail(Guid.Parse(UserData.CustID.ToString())))
                            {
                                coverageInformation.LabelEmailValidate.Visible = true;
                            }
                            //Response.Redirect("Validate.aspx?" + Crypto.ArgumentEncrypt("renewaccnt") + "=" + Crypto.Encrypt("success", true));
                        }
                    }
                    this.Page.Form.DefaultButton = btn3Next.UniqueID;
                }
                else
                {
                    customerEnrollment.LavelAgreeError.Visible = true;
                    customerEnrollment.LavelAgreeError.Text    = "Please Read Terms And Conditions.";
                }
            }
        }