Ejemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["CustomerID"] == null)
     {
         logout.Visible      = false;
         Hype.Visible        = false;
         lnkRegister.Visible = true;
         lnksignIn.Visible   = true;
         lnkWelcome.Visible  = false;
         LinkButton3.Visible = false;
         Hypeacc.Visible     = false;
     }
     else
     {
         ManageUserSVC.ManageUserClient Cl = new ManageUserSVC.ManageUserClient();
         dsCus = Cl.GetCustomerInfo(Guid.Parse(Session["CustomerID"].ToString()));
         if (dsCus != null)
         {
             lnkWelcome.Text     = dsCus.Tables[0].Rows[0]["FirstName"].ToString();
             lnkWelcome.Visible  = true;
             LinkButton3.Visible = true;
         }
         signinli.Visible = false;
         string url = System.Configuration.ConfigurationManager.AppSettings["HostingPrefix"];
         logo.PostBackUrl       = url + "Home.aspx";
         HyperLink1.NavigateUrl = url + "Home.aspx";
         logout.Visible         = true;
         slash.Visible          = false;
         Hype.Visible           = true;
         lnksignIn.Visible      = false;
         lnkRegister.Visible    = false;
         Hypeacc.Visible        = true;
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["Userdata"] == null)
     {
         Response.Redirect("~/Admin/Login.aspx");
     }
     else
     {
         ManageUserSVC.ManageUserClient Client = new ManageUserSVC.ManageUserClient();
         if (Session["UserID"] != null)
         {
             Guid ID = Guid.Parse(Session["UserID"].ToString());
             ViewState["CustomerID"] = ID;
             BindCertificates(ID, Client);
             BindEvedences(Guid.Parse(ID.ToString()), Client);
         }
         if (!IsPostBack)
         {
             if (Session["UserID"] != null)
             {
                 Guid ID = Guid.Parse(Session["UserID"].ToString());
                 dsCus = Client.GetCustomerInfo(ID);
                 ViewState["CustomerInformamtion"] = dsCus;
             }
         }
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["CustomerID"] == null)
            {
                Response.Redirect("Login.aspx");
            }
            if (!IsPostBack)
            {
                //MKP
                //txtEventFrom_CalendarExtender.StartDate = DateTime.Now;
                //txtEventTo_CalendarExtender.StartDate = DateTime.Now.AddDays(1);
                if (Session["CustomerID"] != null)
                {
                    Guid ID = Guid.Parse(Session["CustomerID"].ToString());

                    using (ManageUserSVC.ManageUserClient client = new ManageUserSVC.ManageUserClient())
                    {
                        DataSet ds = new DataSet();
                        ds = client.GetCustomerInfo(ID);
                        if (ds != null && ds.Tables[0].Rows.Count > 0)
                        {
                            txtFirstName.Text           = ds.Tables[0].Rows[0]["FirstName"].ToString();
                            txtLastName.Text            = ds.Tables[0].Rows[0]["LastName"].ToString();
                            txtCompany.Text             = ds.Tables[0].Rows[0]["Company_Name"].ToString();
                            txtEmailID.Text             = ds.Tables[0].Rows[0]["EmailID"].ToString();
                            txtAddress.Text             = ds.Tables[0].Rows[0]["Address"].ToString();
                            txtphoneNo.Text             = ds.Tables[0].Rows[0]["PhoneNo"].ToString();
                            txtCity.Text                = ds.Tables[0].Rows[0]["City"].ToString();
                            drpStates.SelectedItem.Text = ds.Tables[0].Rows[0]["State"].ToString();
                            txtZipCode.Text             = ds.Tables[0].Rows[0]["ZipCode"].ToString();
                        }
                    }
                }
            }
        }
Ejemplo n.º 4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         AffilationBind();
         Guid    ID    = Guid.Parse(Session["CustomerID"].ToString());
         DataSet dsCus = new DataSet();
         ManageUserSVC.ManageUserClient Client = new ManageUserSVC.ManageUserClient();
         dsCus = Client.GetCustomerInfo(ID);
         ViewState["CustomerData"] = dsCus;
         if (dsCus != null && dsCus.Tables[0].Rows.Count > 0)
         {
             txtFname.Text                 = dsCus.Tables[0].Rows[0]["FirstName"].ToString();
             txtLname.Text                 = dsCus.Tables[0].Rows[0]["LastName"].ToString();
             txtCompany.Text               = dsCus.Tables[0].Rows[0]["Company_Name"].ToString();
             txtEmailID.Text               = dsCus.Tables[0].Rows[0]["EmailID"].ToString();
             txtAddress.Text               = dsCus.Tables[0].Rows[0]["Address"].ToString();
             txtCity.Text                  = dsCus.Tables[0].Rows[0]["City"].ToString();
             drpStates.SelectedItem.Text   = dsCus.Tables[0].Rows[0]["State"].ToString();
             ddlCompanyAffil.SelectedValue = dsCus.Tables[0].Rows[0]["CompAffilationID"].ToString();
             txtZipCode.Text               = dsCus.Tables[0].Rows[0]["ZipCode"].ToString();
             txtPhone.Text                 = dsCus.Tables[0].Rows[0]["PhoneNo"].ToString();
             txtPersonalID.Text            = dsCus.Tables[0].Rows[0]["PersonalID"].ToString();
         }
     }
 }
Ejemplo n.º 5
0
        private void BindInfo(string CusID)
        {
            Guid    ID    = Guid.Parse(CusID);
            DataSet dsCus = new DataSet();

            ManageUserSVC.ManageUserClient Client = new ManageUserSVC.ManageUserClient();
            dsCus = Client.GetCustomerInfo(ID);
            ViewState["CustomerData"] = dsCus;
        }
Ejemplo n.º 6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Page.Form.DefaultButton = btnSave.UniqueID;
            if (Session["Userdata"] == null)
            {
                Response.Redirect("Login.aspx");
            }
            else
            {
                if (!IsPostBack)
                {
                    AffilationBind();

                    if (Session["UserID"] != null)
                    {
                        Guid ID = Guid.Parse(Session["UserID"].ToString());
                        ManageUserSVC.ManageUserClient Client = new ManageUserSVC.ManageUserClient();
                        DataSet dsCus = new DataSet();
                        dsCus = Client.GetCustomerInfo(ID);
                        if (dsCus != null && dsCus.Tables[0].Rows.Count > 0)
                        {
                            txtFirstName.Text            = dsCus.Tables[0].Rows[0]["FirstName"].ToString();
                            txtCompany.Text              = dsCus.Tables[0].Rows[0]["Company_Name"].ToString();
                            txtLastName.Text             = dsCus.Tables[0].Rows[0]["LastName"].ToString();
                            txtCustomerID.Text           = dsCus.Tables[0].Rows[0]["YID"].ToString();
                            txtEmailID.Text              = dsCus.Tables[0].Rows[0]["EmailID"].ToString();
                            txtAddress.Text              = dsCus.Tables[0].Rows[0]["Address"].ToString();
                            txtCity.Text                 = dsCus.Tables[0].Rows[0]["City"].ToString();
                            drpStates.SelectedValue      = dsCus.Tables[0].Rows[0]["State"].ToString();
                            txtZipCode.Text              = dsCus.Tables[0].Rows[0]["ZipCode"].ToString();
                            txtCountry.Text              = dsCus.Tables[0].Rows[0]["Country"].ToString();
                            txtphoneNo.Text              = dsCus.Tables[0].Rows[0]["PhoneNo"].ToString();
                            drpCompnyAffil.SelectedValue = dsCus.Tables[0].Rows[0]["CompAffilationID"].ToString();
                            txtSecCode.Text              = dsCus.Tables[0].Rows[0]["SecurityCode"].ToString();
                            txtApplicationNo.Text        = dsCus.Tables[0].Rows[0]["ApplicationNo"].ToString();
                            chkIsActivePolicy.Checked    = bool.Parse(dsCus.Tables[0].Rows[0]["IsActivePolicy"].ToString());
                            txtpersonalid.Text           = dsCus.Tables[0].Rows[0]["PersonalID"].ToString();
                            chkIsActive.Checked          = bool.Parse(dsCus.Tables[0].Rows[0]["IsActive"].ToString());
                            txtPayment.Text              = dsCus.Tables[0].Rows[0]["Payment"].ToString();
                            txtSignup.Text               = dsCus.Tables[0].Rows[0]["SignUp_Date"].ToString();
                            if (dsCus.Tables[0].Rows[0]["IsSecCodeSent"].ToString() != "")
                            {
                                chkIscedeSent.Checked = bool.Parse(dsCus.Tables[0].Rows[0]["IsSecCodeSent"].ToString());
                            }
                            if (dsCus.Tables[0].Rows[0]["VerifyEmail"].ToString() != "")
                            {
                                chkVerify.Checked = bool.Parse(dsCus.Tables[0].Rows[0]["VerifyEmail"].ToString());
                            }
                            Session["payment"] = txtPayment.Text;
                        }
                    }
                }
            }
        }
        private void SendEmailForProofOfEvidnce(ManageUserSVC.ManageUserClient Client, Guid CustID, string Local)
        {
            lblCerty.Visible = false;
            lblEve.Visible   = false;
            DataSet dsCus = new DataSet();

            dsCus = Client.GetCustomerInfo(CustID);

            StringBuilder strMailBody = new StringBuilder();

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

            //header
            strMailBody.Append("<p>&nbsp;</p>");
            strMailBody.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 + ">");
            strMailBody.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/>");

            strMailBody.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'>");
            strMailBody.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;'>");
            strMailBody.Append("<br/>" + dsCus.Tables[0].Rows[0]["FirstName"].ToString() + " " + dsCus.Tables[0].Rows[0]["LastName"].ToString() + "," + "<br /><br />");
            strMailBody.Append("Your Evidence of Coverage has been generated.<br /><br />");
            strMailBody.Append("To view your Evidence of Coverage please click <a href='" + url + "ViewDoc.ashx?" + Crypto.ArgumentEncrypt("ching") + "=" + Crypto.Encrypt(CustID.ToString(), true) + "&" + Crypto.ArgumentEncrypt("type") + "=" + Crypto.Encrypt("eve", true) + "' target='dscoverageview'>here</a><br/><br/>");
            strMailBody.Append("Sincerely,<br/>");
            strMailBody.Append("dscoverage.ca<br/>");
            strMailBody.Append("</tr></tbody></table>");
            strMailBody.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 pSubject = ConfigurationManager.AppSettings["SendingProofOfEvedence"].ToString();

            CommonFunction.SendEmail(dsCus.Tables[0].Rows[0]["EmailID"].ToString().Trim(), strMailBody.ToString(), pSubject);

            List <usp_GetEvedenceResult> DsCus = new List <usp_GetEvedenceResult>();

            DsCus = Client.GetEvedenceInfoByCusID(CustID);

            if (DsCus != null && DsCus.Count > 0)
            {
                //MKP
                //Guid EVEID = Guid.Parse(DsCus.ToList()[0].EvidenceID.ToString());
                foreach (usp_GetEvedenceResult item in DsCus)
                {
                    if (item.IsActive == true)
                    {
                        Guid EVEID   = Guid.Parse(item.EvidenceID.ToString());
                        bool Updated = Client.Update_Evidence(CustID, DateTime.Now, true, EVEID, true);
                    }
                }
            }
        }
Ejemplo n.º 8
0
        private bool IsValidcoverage()
        {
            ManageUserSVC.ManageUserClient client = new ManageUserSVC.ManageUserClient();
            DataSet ds = new DataSet();

            ds = client.GetCustomerInfo(Guid.Parse(Session["CustomerID"].ToString()));
            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["VerifyEmail"].ToString() == "")
                {
                    coverageInformation.LabelEmailValidate.Visible = true;
                    return(false);
                }
            }

            return(true);
        }
Ejemplo n.º 9
0
        private bool VerifyEmail(Guid CusID)
        {
            bool verified = true;

            ManageUserSVC.ManageUserClient client = new ManageUserSVC.ManageUserClient();
            DataSet ds = new DataSet();

            ds = client.GetCustomerInfo(CusID);
            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["EmailID"].ToString() == "")
                {
                    verified = false;
                }
            }

            return(verified);
        }
Ejemplo n.º 10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (Session["CustomerID"] == null)
                {
                    string errmessage = "Gate 1";
                    LogWritter.LogFileWrite(errmessage);
                    Response.Redirect("Login.aspx");
                    errmessage = "Gate 2";
                    LogWritter.LogFileWrite(errmessage);
                }
                Session["value"] = Crypto.Encrypt(Session["CustomerID"].ToString(), true);
                Session["pnl"]   = "3";
                ManageUserSVC.ManageUserClient Cl = new ManageUserSVC.ManageUserClient();
                Guid CustID = Guid.Parse(Session["CustomerID"].ToString());
                if (!IsPostBack)
                {
                    DataSet dsCus = new DataSet();


                    //Guid CusID = Guid.Parse(Crypto.Decrypt(Request.QueryString["GeneKey"].ToString(), true));
                    Guid CusID = Guid.Parse(Session["CustomerID"].ToString());
                    ManageUserSVC.ManageUserClient Userinfo = new ManageUserSVC.ManageUserClient();
                    DataSet Data = new DataSet();
                    Data = Userinfo.GetCustomerInfo(CusID);


                    ViewState["CustomerID"] = CustID;
                    dsCus = new DataSet();
                    dsCus = Cl.CreateEvedenceInfoByCusID(CustID);

                    if (dsCus != null && dsCus.Tables[0].Rows.Count > 0)
                    {
                        DateTime CoverageDate;
                        DateTime EndDate = DateTime.Now;

                        if (dsCus.Tables[0].Rows[0]["CoverDate"].ToString() != "")
                        {
                            CoverageDate = Convert.ToDateTime(dsCus.Tables[0].Rows[0]["CoverDate"].ToString());
                            EndDate      = CoverageDate.AddMonths(12);
                            Session["TEMPCoverageEndDate"] = EndDate;
                            if (DateTime.Now < EndDate)
                            {
                                if (Session["tryRenewAccount"] != null)
                                {
                                    lblRemain.Text             = (EndDate - DateTime.Now).Days.ToString();
                                    Renewnote.Visible          = true;
                                    Session["tryRenewAccount"] = null;
                                    Main.Visible = false;
                                    return;
                                }
                                Main.Visible = true;
                                int numberOfDayRemaining = (EndDate - DateTime.Now).Days;
                                if (numberOfDayRemaining <= 30)
                                {
                                    string thirtyDayPrior = string.Format("Your Account is about to Expire in {0} days ", numberOfDayRemaining);
                                    lblMessageOneMonthAdvance.Text = thirtyDayPrior;
                                    pnlRenewBeforeOneMonth.Visible = true;
                                }

                                imgCerty.Visible     = true;
                                imgCerty.Style.Value = "padding-top:15px";
                                //Label1.Visible = true;
                                Imageevedence.Visible = false;
                                //Label2.Visible = false;
                            }
                            else
                            {
                                //Label2.Visible = false;
                                lblWarn.Text      = "Your Account is Expired. Thanks for using our service. You need to Renew your Account.";
                                lblWarn.Visible   = true;
                                Main.Visible      = false;
                                Renewspan.Visible = true;

                                List <usp_GetEvedenceResult> ListEvedences = new List <usp_GetEvedenceResult>();
                                ListEvedences = Cl.GetEvedenceInfoByCusID(CustID);
                                if (ListEvedences != null && ListEvedences.Count > 0)
                                {
                                    foreach (usp_GetEvedenceResult item in ListEvedences)
                                    {
                                        if (item.IsActive.Value)
                                        {
                                            Cl.Update_Evidence(CustID, DateTime.Now, false, item.EvidenceID, true);
                                            Cl.Update_Payment(CustID, 1, false);
                                        }
                                    }
                                }
                            }
                        }
                        else if (Data.Tables[0].Rows[0]["Payment"].ToString() == "0.0000")
                        {
                            //Covarage set first time
                            Imageevedence.Visible = true;
                            //Label2.Visible = true;
                            imgCerty.Visible = false;
                            //Label1.Visible = false;
                        }
                    }
                    else
                    {
                        //Covarage set first time
                        Imageevedence.Visible = true;
                        //Label2.Visible = true;
                        imgCerty.Visible = false;
                        //Label1.Visible = false;
                    }
                }
                BindCertificates(CustID, Cl);
                BindEvedences(CustID, Cl);
            }
            catch (Exception exx)
            {
                string errmessage = LogWritter.CreateErrorMessage(exx);
                LogWritter.LogFileWrite(errmessage);
                throw;
            }
        }
Ejemplo n.º 11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString[Crypto.ArgumentEncrypt("ching")] != null)
            {
                ManageUserSVC.ManageUserClient Cl = new ManageUserSVC.ManageUserClient();
                Guid CertyID = Guid.Parse(Crypto.Decrypt(Request.QueryString[Crypto.ArgumentEncrypt("ching")].ToString(), true));
                //Get info From CertyID...
                List <usp_GetCertificateByIDResult> ds = new List <usp_GetCertificateByIDResult>();
                ds = Cl.GetCertificateInfoByCertyID(CertyID);
                if (ds != null && ds.Count > 0)
                {
                    //Assign Values...
                    Guid CustomerID = ds.ToList()[0].Cust_ID;

                    DataSet dsCus = new DataSet();
                    dsCus = Cl.GetCustomerInfo(CustomerID);
                    if (dsCus != null && dsCus.Tables[0].Rows.Count > 0)
                    {
                        string InsuredDetail = dsCus.Tables[0].Rows[0]["FirstName"].ToString() + " " + dsCus.Tables[0].Rows[0]["LastName"].ToString() + "\n\r" +
                                               dsCus.Tables[0].Rows[0]["Address"].ToString() + ", " + dsCus.Tables[0].Rows[0]["City"].ToString() + ", " +
                                               dsCus.Tables[0].Rows[0]["State"].ToString() + ", " + dsCus.Tables[0].Rows[0]["ZipCode"].ToString() + ".";



                        lblDate.Text           = ds.ToList()[0].CertiDate.ToString("MM/dd/yyyy", CultureInfo.InvariantCulture);
                        lblInsuredDetails.Text = InsuredDetail;
                        lblCertificateNo.Text  = ds.ToList()[0].CretiNo.ToUpper();
                        lblCertyNo.Text        = ds.ToList()[0].CretiNo.ToUpper();
                        lblCertyNopage2.Text   = ds.ToList()[0].CretiNo.ToUpper();
                        lblEffectDate.Text     = ds.ToList()[0].CertiDate.ToString("MM/dd/yyyy", CultureInfo.InvariantCulture);

                        if (ds.ToList()[0].AdditionalLang != "")
                        {
                            chkAddInsur.Visible = false;
                            imgAddInsur.Visible = true;
                        }
                        if (bool.Parse(ds.ToList()[0].Waiver.ToString()))
                        {
                            chkSubgrtion.Visible = false;
                            imgSubgrtion.Visible = true;
                        }

                        dsCus = new DataSet();
                        dsCus = Cl.CreateEvedenceInfoByCusID(CustomerID);
                        if (dsCus != null && dsCus.Tables[0].Rows.Count > 0)
                        {
                            DateTime CovStartDate = Convert.ToDateTime(dsCus.Tables[0].Rows[0]["CoverDate"].ToString());
                            DateTime CovEndDate   = CovStartDate.AddMonths(12);
                            lblPolicyStartDate.Text = CovStartDate.ToString("MM/dd/yyyy", CultureInfo.InvariantCulture);
                            lblPolicyEndDate.Text   = CovEndDate.ToString("MM/dd/yyyy", CultureInfo.InvariantCulture);
                        }

                        lblCertiHolderDetails.Text = ds.ToList()[0].HoldrName.ToString() + "\n\r " +
                                                     ds.ToList()[0].HoldrAdd.ToString();

                        lbl2nameInsured.Text  = InsuredDetail;
                        lbl2nameInsured0.Text = InsuredDetail;
                        //lblAdditionalinsuredpage3.Text = InsuredDetail;
                        lblEventFrom.Text = ds.ToList()[0].EventFrom.ToString("MM/dd/yyyy", CultureInfo.InvariantCulture);
                        lblEventTo.Text   = ds.ToList()[0].EventTo.ToString("MM/dd/yyyy", CultureInfo.InvariantCulture);

                        lblAdditionallang.Text = ds.ToList()[0].AdditionalLang;

                        if (ds.ToList()[0].Data.Bytes.Length != 0)
                        {
                            Byte[] bytee = ds.ToList()[0].Data.Bytes;
                            download(bytee);
                        }
                    }
                }
            }
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            lblCerty.Visible = false;
            lblEve.Visible   = false;
            Guid CustID = Guid.Parse(Session["UserID"].ToString());

            ManageUserSVC.ManageUserClient Cl = new ManageUserSVC.ManageUserClient();
            DataSet dsCus = new DataSet();

            dsCus = Cl.GetCustomerInfo(CustID);
            bool    isactive = false;
            decimal payment  = 0;
            string  email    = "";


            if (dsCus != null && dsCus.Tables[0].Rows.Count > 0)
            {
                payment = Convert.ToDecimal(dsCus.Tables[0].Rows[0]["Payment"].ToString());
                email   = dsCus.Tables[0].Rows[0]["EmailID"].ToString();
                string emailvarify = Convert.ToString(dsCus.Tables[0].Rows[0]["VerifyEmail"].ToString());
                isactive = Convert.ToBoolean(dsCus.Tables[0].Rows[0]["IsActivePolicy"].ToString());

                ManageUserSVC.ManageUserCustomerData User = new ManageUserSVC.ManageUserCustomerData();
                if (emailvarify != "")
                {
                    if (isactive == true)
                    {
                        DataSet dsCus2 = new DataSet();
                        dsCus2 = Cl.GetCoveragebyCustomerId(CustID);
                        ManageUserSVC.ManageUserCoverageData Coverage = new ManageUserSVC.ManageUserCoverageData();
                        if (dsCus2 != null && dsCus2.Tables[0].Rows.Count > 0)
                        {
                            DateTime Coverdate = Convert.ToDateTime(dsCus2.Tables[0].Rows[0]["CoverDate"].ToString());
                            string   fiveyrs   = Convert.ToString(dsCus2.Tables[0].Rows[0]["_5YrClaim"].ToString());
                            string   threeyrs  = Convert.ToString(dsCus2.Tables[0].Rows[0]["_3YrLoss"].ToString());
                            string   custid    = Convert.ToString(dsCus2.Tables[0].Rows[0]["Cust_ID"].ToString());
                            string   insurance = Convert.ToString(dsCus2.Tables[0].Rows[0]["InsuranceType"].ToString());


                            DataSet CovData = new DataSet();
                            CovData = Cl.CreateEvedenceInfoByCusID(CustID);
                            if (CovData != null && CovData.Tables[0].Rows.Count > 0)
                            {
                                Coverage.CoverageID = Guid.Parse(CovData.Tables[0].Rows[0]["CoverID"].ToString());
                            }
                            else
                            {
                                Coverage.CoverageID = Guid.NewGuid();
                            }
                            Coverage.CoverageDate         = Coverdate;
                            Coverage.CustID               = Guid.Parse(dsCus2.Tables[0].Rows[0]["Cust_ID"].ToString());
                            Session["CustomerIDForAdmin"] = CustID;
                            Coverage.yr3Loss              = Convert.ToBoolean(threeyrs);
                            Coverage.yr5Loss              = Convert.ToBoolean(fiveyrs);
                            Coverage.Status               = "True";
                            Session["CoverageInfo"]       = Coverage;
                        }
                        if (Session["CoverageInfo"] != null)
                        {
                            if (payment == 0)
                            {
                                if (email != "")
                                {
                                    string Memres = CheckMember(email);
                                    if (Memres == "Y")
                                    {
                                        User.Payment = Convert.ToDecimal(System.Configuration.ConfigurationManager.AppSettings["Membership"]);
                                    }
                                    else
                                    {
                                        User.Payment = Convert.ToDecimal(System.Configuration.ConfigurationManager.AppSettings["Non-Membership"]);
                                    }
                                }

                                decimal pay      = User.Payment * 100;
                                bool    property = false;
                                Cl.Update_Payment(CustID, pay, property);
                            }

                            if (Chkmail.Checked == true)
                            {
                                ManageUserSVC.ManageUserCoverageData Coverage2 = (ManageUserSVC.ManageUserCoverageData)Session["CoverageInfo"];
                                Cl.InsertCoverageData(Coverage2);
                                string Local = System.Configuration.ConfigurationManager.AppSettings["HostingPrefix"];
                                dowload(Local.Replace("https://", "http://") + "ProofEvidence.aspx?" + Crypto.ArgumentEncrypt("sss") + "=" + Crypto.Encrypt(CustID.ToString(), true), Coverage2);
                                SendEmailForProofOfEvidnce(Cl, CustID, Local);
                                BindEvedences(CustID, Cl);
                                lblEve.Visible = true;
                                lblEve.Text    = "Evidence Regenerated Successfully";
                            }
                            else
                            {
                                ManageUserSVC.ManageUserCoverageData Coverage2 = (ManageUserSVC.ManageUserCoverageData)Session["CoverageInfo"];
                                Cl.InsertCoverageData(Coverage2);
                                string Local = System.Configuration.ConfigurationManager.AppSettings["HostingPrefix"];
                                dowload(Local.Replace("https://", "http://") + "ProofEvidence.aspx?" + Crypto.ArgumentEncrypt("sss") + "=" + Crypto.Encrypt(CustID.ToString(), true), Coverage2);
                                BindEvedences(CustID, Cl);
                                lblEve.Visible = true;
                                lblEve.Text    = "Evidence Regenerated Successfully";
                            }
                        }
                        else
                        {
                            lblEve.Visible = true;
                            lblEve.Text    = "Coverage Data is not present!";
                        }
                    }
                    else
                    {
                        BindEvedences(CustID, Cl);
                        lblEve.Visible = true;
                        lblEve.Text    = "Policy is not active,Please activate the policy!";
                    }
                }
                else
                {
                    lblEve.Visible = true;
                    lblEve.Text    = "Email Address is not verified!";
                }
            }
        }
Ejemplo n.º 13
0
        protected void btn3Next_Click(object sender, EventArgs e)
        {
            coverageInformation.LabelEmailValidate.Visible = false;
            coverageInformation.LabelPayment.Visible       = false;
            string EmailAdd = "";

            if (IsValidcoverage())
            {
                string Date = coverageInformation.CoverageDate.Text;
                ManageUserSVC.ManageUserCoverageData Coverage = new ManageUserSVC.ManageUserCoverageData();
                ManageUserSVC.ManageUserClient       client   = new ManageUserSVC.ManageUserClient();

                if (ViewState["RenewCustomer"] != null)
                {
                    DataSet Data = ViewState["RenewCustomer"] as DataSet;
                    if (Data != null && Data.Tables[0].Rows.Count > 0)
                    {
                        DataSet CovData    = new DataSet();
                        Guid    CustomerID = Guid.Parse(Data.Tables[0].Rows[0]["Cust_ID"].ToString());
                        if (VerifyEmail(CustomerID))
                        {
                            if (!coverageInformation.ThreeYearCheck.Checked && !coverageInformation.FiveYearCheck.Checked)
                            {
                                Coverage.CoverageID = Guid.NewGuid();
                                DateTime CoverageDate = DateTime.ParseExact(Date, "MM/dd/yyyy", System.Globalization.CultureInfo.GetCultureInfo("en-US"));
                                Coverage.CoverageDate                 = CoverageDate;
                                Coverage.CustID                       = Guid.Parse(Data.Tables[0].Rows[0]["Cust_ID"].ToString());
                                Coverage.yr3Loss                      = coverageInformation.ThreeYearCheck.Checked;
                                Coverage.yr5Loss                      = coverageInformation.FiveYearCheck.Checked;
                                Coverage.Status                       = "True";
                                Session["RenewCoverageInfo"]          = Coverage;
                                multiViewRegistration.ActiveViewIndex = 3;

                                this.Page.Form.DefaultButton = btn4AutoRize.UniqueID;
                            }
                            else
                            {
                                Response.Redirect("Reason.aspx");
                            }

                            DataSet ds = new DataSet();
                            ds = client.GetCustomerInfo(CustomerID);
                            if (ds != null && ds.Tables[0].Rows.Count > 0)
                            {
                                EmailAdd = ds.Tables[0].Rows[0]["EmailID"].ToString();
                            }
                        }
                        else
                        {
                            coverageInformation.LabelEmailValidate.Visible = true;
                            coverageInformation.LabelEmailValidate.Focus();
                        }
                    }
                }
                else
                {
                    if (VerifyEmail(Guid.Parse(ViewState["custID"].ToString())))
                    {
                        if (!coverageInformation.ThreeYearCheck.Checked && !coverageInformation.FiveYearCheck.Checked)
                        {
                            Coverage.CoverageID   = Guid.NewGuid();
                            Session["CustomerID"] = ViewState["custID"].ToString();
                            Session["CustomerID"] = ViewState["custID"].ToString();
                            DateTime CoverageDate = DateTime.ParseExact(Date, "MM/dd/yyyy", System.Globalization.CultureInfo.GetCultureInfo("en-US"));
                            Coverage.CoverageDate   = CoverageDate;
                            Coverage.CustID         = Guid.Parse(ViewState["custID"].ToString());
                            Coverage.yr3Loss        = coverageInformation.ThreeYearCheck.Checked;
                            Coverage.yr5Loss        = coverageInformation.FiveYearCheck.Checked;
                            Coverage.Status         = "True";
                            Session["CoverageInfo"] = Coverage;
                            //pnl3Coverage.Visible = false;
                            //pnl4Payment.Visible = true;
                            //pnlPropay.Visible = true;
                            multiViewRegistration.ActiveViewIndex = 3;
                        }
                        else
                        {
                            Response.Redirect("Reason.aspx");
                        }

                        DataSet ds = new DataSet();
                        ds = client.GetCustomerInfo(Guid.Parse(ViewState["custID"].ToString()));
                        if (ds != null && ds.Tables[0].Rows.Count > 0)
                        {
                            EmailAdd = ds.Tables[0].Rows[0]["EmailID"].ToString();
                        }
                    }
                    else
                    {
                        coverageInformation.LabelEmailValidate.Visible = true;
                        coverageInformation.LabelEmailValidate.Focus();
                    }
                }

                creditCardInformation.LabelAmount.Text = System.Configuration.ConfigurationManager.AppSettings["Non-Membership"];
                if (EmailAdd != "")
                {
                    string Memres = CheckMember(EmailAdd);
                    if (Memres == "Y")
                    {
                        creditCardInformation.LabelAmount.Text = System.Configuration.ConfigurationManager.AppSettings["Membership"];
                    }
                    else
                    {
                        creditCardInformation.LabelAmount.Text = System.Configuration.ConfigurationManager.AppSettings["Non-Membership"];
                    }
                }
            }


            this.Page.Form.DefaultButton = btn4AutoRize.UniqueID;
            Response.Cookies.Clear();
        }
Ejemplo n.º 14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //disable button after click...
            string strProcessScript = "this.value='Processing...';this.disabled=true;";

            btn4AutoRize.Attributes.Add("onclick", strProcessScript + ClientScript.GetPostBackEventReference(btn4AutoRize, "").ToString());


            customerEnrollment.LabelError.Visible = false;
            if (!IsPostBack)
            {
                //MKP
                //coverageInformation.CoverageInformationDate.StartDate = DateTime.Now;

                if (Session["RenewBeforeOneMonthCoverageEndDate"] != null)
                {
                    coverageInformation.CoverageInformationDate.SelectedDate = (DateTime?)Session["RenewBeforeOneMonthCoverageEndDate"];
                }
                else
                {
                    coverageInformation.CoverageInformationDate.SelectedDate = DateTime.Now.AddDays(1);
                }

                coverageInformation.LabelCoverageDate.Text = "Your Coverage Date will start from " + coverageInformation.CoverageInformationDate.SelectedDate.Value.ToString("MM/dd/yyyy").Replace("-", "/") + ".";

                coverageInformation.CoverageDate.Text = coverageInformation.CoverageInformationDate.SelectedDate.Value.ToString("MM/dd/yyyy").Replace("-", "/");


                multiViewRegistration.ActiveViewIndex = 0;
                OtherSVC.OtherClient client = new OtherSVC.OtherClient();
                DataSet ds = client.GetCompany_List();
                if (ds != null && ds.Tables[0].Rows.Count > 0)
                {
                    customerEnrollment.CompnyAffilation.DataSource     = ds;
                    customerEnrollment.CompnyAffilation.DataTextField  = "Description";
                    customerEnrollment.CompnyAffilation.DataValueField = "CompAffilationID";
                    customerEnrollment.CompnyAffilation.DataBind();
                    customerEnrollment.CompnyAffilation.Items.Insert(0, new ListItem("--Select--", "select"));
                }

                string[] Month = new string[] { "Month", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12" };
                creditCardInformation.Month.DataSource = Month;
                creditCardInformation.Month.DataBind();
                //pre-select one for testing
                creditCardInformation.Month.SelectedIndex = 0;

                //populate year
                creditCardInformation.Year.Items.Add("Year");
                int Year = DateTime.Now.Year;
                for (int i = 0; i < 10; i++)
                {
                    creditCardInformation.Year.Items.Add((Year + i).ToString());
                }
                //pre-select one for testing
                creditCardInformation.Year.SelectedIndex = 0;

                string EmailAdd = "";
                #region coverage start
                if (Session["value"] != null && Session["pnl"] != null)
                {
                    int    Value = Convert.ToInt32(Session["pnl"].ToString());
                    string str   = Session["value"].ToString();
                    Guid   CusID = Guid.Parse(Crypto.Decrypt(str, true));
                    ManageUserSVC.ManageUserClient Userinfo = new ManageUserSVC.ManageUserClient();
                    DataSet Data = new DataSet();
                    Data = Userinfo.GetCustomerInfo(CusID);

                    if (Request.QueryString[Crypto.ArgumentEncrypt("time")] != null && str != null)
                    {
                        string val = Crypto.Decrypt(Request.QueryString[Crypto.ArgumentEncrypt("time")].ToString(), true);
                        enrollDescription.LabelRenew.Visible = true;

                        if (val.ToLower().Equals("renew") && Data != null && Data.Tables[0].Rows.Count > 0)
                        {
                            ViewState["RenewCustomer"] = Data;
                            Session["RenewCustomer"]   = Data;

                            ViewState["custID"]   = Data.Tables[0].Rows[0]["Cust_ID"].ToString();
                            Session["CustomerID"] = Data.Tables[0].Rows[0]["Cust_ID"].ToString();
                            ViewState["EmailID"]  = Data.Tables[0].Rows[0]["EmailID"].ToString();
                            EmailAdd = Data.Tables[0].Rows[0]["EmailID"].ToString();
                            Session["CustomerInfo"] = Data.Tables[0].Rows[0]["FirstName"].ToString() + " " + Data.Tables[0].Rows[0]["LastName"].ToString();
                            multiViewRegistration.ActiveViewIndex = 1;
                            PopulateCustomerInformation();
                            return;
                        }
                    }
                    if (Data.Tables[0].Rows[0]["Payment"].ToString() == "0.0000")
                    {
                        if (Value == 3 && Data != null && Data.Tables[0].Rows.Count > 0)
                        {
                            ViewState["custID"]   = Data.Tables[0].Rows[0]["Cust_ID"].ToString();
                            Session["CustomerID"] = Data.Tables[0].Rows[0]["Cust_ID"].ToString();
                            ViewState["EmailID"]  = Data.Tables[0].Rows[0]["EmailID"].ToString();
                            EmailAdd = Data.Tables[0].Rows[0]["EmailID"].ToString();
                            Session["CustomerInfo"] = Data.Tables[0].Rows[0]["FirstName"].ToString() + " " + Data.Tables[0].Rows[0]["LastName"].ToString();
                            multiViewRegistration.ActiveViewIndex = 2;
                        }
                    }
                    else if (Data.Tables[0].Rows[0]["Payment"].ToString() != "50.0000")
                    {
                        coverageInformation.LBL.Visible       = true;
                        multiViewRegistration.ActiveViewIndex = 2;
                    }
                }

                #endregion

                #region Retry Payment

                if (Request.QueryString[Crypto.ArgumentEncrypt("retrypayment")] != null)
                {
                    multiViewRegistration.ActiveViewIndex = 3;

                    creditCardInformation.LabelAmount.Text = System.Configuration.ConfigurationManager.AppSettings["Non-Membership"];
                    if (EmailAdd != "")
                    {
                        string Memres = CheckMember(EmailAdd);
                        if (Memres == "Y")
                        {
                            creditCardInformation.LabelAmount.Text = System.Configuration.ConfigurationManager.AppSettings["Membership"];
                        }
                        else
                        {
                            creditCardInformation.LabelAmount.Text = System.Configuration.ConfigurationManager.AppSettings["Non-Membership"];
                        }
                    }
                }

                #endregion
            }
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            if (Page.IsValid && IsValidate())
            {
                if (chkAgree.Checked)
                {
                    Response.Cookies.Clear();
                    ManageUserSVC.ManageUserClient Client = new ManageUserSVC.ManageUserClient();

                    DataSet Dscus = Client.GetCustomerInfo(Guid.Parse(Session["CustomerID"].ToString()));
                    if (Dscus != null && Dscus.Tables[0].Rows.Count > 0)
                    {
                        if (Dscus.Tables[0].Rows[0]["SecurityCode"].ToString().Equals(txtSecCode.Text) && Dscus.Tables[0].Rows[0]["EmailID"].ToString().Equals(txtEmailID.Text))
                        {
                            Guid   CertyID   = Guid.NewGuid();
                            String Encrypted = Crypto.Encrypt(CertyID.ToString(), true);
                            string CertyNo   = "CE" + Guid.NewGuid().ToString().GetHashCode().ToString("x");

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

                            strMailBody.Append("<p>&nbsp;</p>");
                            strMailBody.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 + ">");
                            strMailBody.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/>");

                            //body
                            strMailBody.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'>");
                            strMailBody.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'>");
                            strMailBody.Append(Dscus.Tables[0].Rows[0]["FirstName"].ToString() + " " + Dscus.Tables[0].Rows[0]["LastName"].ToString() + ",<br/><br/>");

                            strMailBody.Append("Your Certificate of Insurance has been generated.<br /><br />");
                            //strMailBody.Append("<b>" + "To view your Certificate of Insurance please click <a href='" + url + "iwed1eamrqqgvxybdda1ed4g.pdf?ching=" + Encrypted + "' target='_blank'>here</a><br /><br />");
                            strMailBody.Append("To view your Certificate of Insurance please click <a href='" + url + "ViewDoc.ashx?" + Crypto.ArgumentEncrypt("ching") + "=" + Encrypted + "&" + Crypto.ArgumentEncrypt("type") + "=" + Crypto.Encrypt("certy", true) + "' target='_blank'>here</a><br /><br />");
                            //strMailBody.Append("If you are having trouble with the above link please copy and paste the following link into your browser:<br /><br />");
                            //strMailBody.Append(url + "ViewDoc.ashx?" + Crypto.ArgumentEncrypt("ching") + "=" + Encrypted + "&" + Crypto.ArgumentEncrypt("type") + "=" + Crypto.Encrypt("certy",true) + "<br/><br/>");
                            strMailBody.Append("Sincerely,<br/>");
                            strMailBody.Append("dscoverage.ca<br/>");

                            strMailBody.Append("</tr></tbody></table>");
                            //footer

                            strMailBody.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>");
                            DateTime Eventfrom = DateTime.ParseExact(txtEventFrom.Text, "MM/dd/yyyy", System.Globalization.CultureInfo.GetCultureInfo("en-US"));
                            DateTime Eventto   = DateTime.ParseExact(txtEventTo.Text, "MM/dd/yyyy", System.Globalization.CultureInfo.GetCultureInfo("en-US"));
                            //DateTime Eventfrom = Convert.ToDateTime(txtEventFrom.Text);
                            //DateTime Eventto = Convert.ToDateTime(txtEventTo.Text);

                            Client.InsertCertificate(CertyID, DateTime.Now, CertyNo, Eventfrom, Eventto, txtAdditional.Text, txtHodrName.Text, txtHodrAddress.Text,
                                                     Guid.Parse(Session["CustomerID"].ToString()), null, chkWaiver.Checked);

                            byte[] buffer = dowload(url.Replace("https://", "http://") + "Certificate.aspx?" + Crypto.ArgumentEncrypt("ching") + "=" + Encrypted);

                            string Subject = ConfigurationManager.AppSettings["GenerateCerificate"].ToString();
                            bool   Sent    = CommonFunction.SendEmail(txtEmailID.Text.Trim(), strMailBody.ToString(), Subject);
                            Session["sent"] = Sent;
                            if (Sent)
                            {
                                //File.WriteAllBytes("D:\\Testssss.pdf", buffer);
                                Client.UpdateCertificate(CertyID, buffer);
                                Response.Redirect("Home.aspx?" + Crypto.ArgumentEncrypt("get") + "=" + Crypto.ArgumentEncrypt("yes"));
                            }
                        }
                        else
                        {
                            lblError.Text = "Invalid Email or Password! Please Enter valid Email Id and Password.";
                        }
                    }
                }
                else
                {
                    lblError.Text = "Please Read Terms And Conditions.";
                }
            }
        }
Ejemplo n.º 16
0
        protected void btn4AutoRize_Click(object sender, EventArgs e)
        {
            bool Completed = false;

            if (creditCardInformation.Is4Valid())
            {
                string enterFunctionLogger = "Enter :: btn4AutoRize_Click";
                LogWritter.LogFileWrite(enterFunctionLogger);
                try
                {
                    if (ViewState["custID"] != null)
                    {
                        Session["CustomerID"] = ViewState["custID"].ToString();
                    }

                    ManageUserSVC.ManageUserClient Userinfo = new ManageUserSVC.ManageUserClient();
                    DataSet Data = new DataSet();
                    Data = Userinfo.GetCustomerInfo(Guid.Parse(Session["CustomerID"].ToString()));
                    if (Data != null && Data.Tables[0].Rows.Count > 0)
                    {
                        string EmailAdd = Data.Tables[0].Rows[0]["EmailID"].ToString();
                        if (EmailAdd.Trim().Equals(creditCardInformation.EmailID.Text.Trim()))
                        {
                            SPSServiceSVC.SPSServiceClient service = new SPSServiceSVC.SPSServiceClient();

                            SPSServiceSVC.ID identityinfo = new SPSServiceSVC.ID();
                            identityinfo.AuthenticationToken = ConfigurationManager.AppSettings["AuthenticationToken"].ToString();
                            identityinfo.BillerAccountId     = ConfigurationManager.AppSettings["BillerID"].ToString();

                            SPSServiceSVC.TempTokenRequest tokn = new SPSServiceSVC.TempTokenRequest();
                            tokn.PayerInfo      = new SPSServiceSVC.PayerInformation();
                            tokn.PayerInfo.Name = "Insurance";
                            tokn.Identification = identityinfo;
                            SPSServiceSVC.TempTokenResult toknres = service.GetTempToken(tokn);

                            SPSServiceSVC.Transaction trans = new SPSServiceSVC.Transaction();
                            trans.CurrencyCode = "USD";

                            double val    = Convert.ToDouble(creditCardInformation.LabelAmount.Text);
                            double amount = val * 100;
                            trans.Amount         = Convert.ToDouble(amount).ToString();
                            Session["Amount"]    = trans.Amount;
                            trans.PayerAccountId = toknres.PayerId;

                            /////////////////////////////////////////////////////////////////////////////////////////////////////////
                            //Code Added By Mohit Paliwal
                            //As suggested Merchant Profile Id need to pass
                            trans.MerchantProfileId = ConfigurationManager.AppSettings["MerchantProfileId"].ToString();

                            /////////////////////////////////////////////////////////////////////////////////////////////////////////

                            SPSServiceSVC.PaymentMethodAdd payadd = new SPSServiceSVC.PaymentMethodAdd();
                            payadd.AccountNumber     = creditCardInformation.CardNumber.Text.Trim();      //credit card no.
                            payadd.Description       = ConfigurationManager.AppSettings["AccountDescription"].ToString();
                            payadd.PayerAccountId    = toknres.PayerId;
                            payadd.PaymentMethodType = creditCardInformation.CardType.SelectedValue.Trim();

                            SPSServiceSVC.CreatePaymentMethodResult paymethodres = service.CreatePaymentMethod(identityinfo, payadd);

                            SPSServiceSVC.PaymentInfoOverrides payereriditinfo = new SPSServiceSVC.PaymentInfoOverrides();
                            payereriditinfo.CreditCard = new SPSServiceSVC.CreditCardOverrides();
                            payereriditinfo.CreditCard.ExpirationDate  = creditCardInformation.Month.SelectedItem.Text.Trim() + creditCardInformation.Year.SelectedItem.Text.Trim().Substring(2, 3 - 1);
                            payereriditinfo.CreditCard.Billing         = new SPSServiceSVC.Billing();
                            payereriditinfo.CreditCard.Billing.City    = creditCardInformation.City.Text.Trim();
                            payereriditinfo.CreditCard.Billing.Country = "CA";
                            payereriditinfo.CreditCard.Billing.Email   = creditCardInformation.EmailID.Text.Trim();
                            payereriditinfo.CreditCard.Billing.ZipCode = creditCardInformation.Zip.Text.Trim();
                            payereriditinfo.CreditCard.FullName        = creditCardInformation.CardHolderFirstName.Text.Trim() + " " + creditCardInformation.CardHolderLastName.Text.Trim();


                            if (string.IsNullOrEmpty(paymethodres.PaymentMethodId))
                            {
                                string paymentMethodIdLogger = "Payment Not succed becuase of PaymentMethodId is null";
                                LogWritter.LogFileWrite(paymentMethodIdLogger);
                            }
                            SPSServiceSVC.TransactionResult MainRes = service.ProcessPaymentMethodTransaction(identityinfo, trans, Guid.Parse(paymethodres.PaymentMethodId), payereriditinfo);

                            SPSServiceSVC.Result delres = service.DeletePaymentMethod(identityinfo, toknres.PayerId, paymethodres.PaymentMethodId);

                            if (MainRes.RequestResult.ResultCode.Equals("00"))
                            {
                                Completed = true;
                                Response.Redirect("PaymentSucced.aspx?" + Crypto.ArgumentEncrypt("Resp") + "=" + Crypto.Encrypt("approved", true), false);
                            }
                            else
                            {
                                string resultCode = "Payment Not succed becuase of ResultCode :: " + MainRes.RequestResult.ResultCode;
                                LogWritter.LogFileWrite(resultCode);
                                Response.Redirect("PaymentSucced.aspx?" + Crypto.ArgumentEncrypt("Resp") + "=" + Crypto.Encrypt("notapproved", true), false);
                            }
                        }
                        else
                        {
                            creditCardInformation.LBL6.Visible     = true;
                            creditCardInformation.LBL6.Text        = "Your entered Email doesn't match to registered Email.";
                            creditCardInformation.LBL6.Style.Value = "margin-left:28px;";
                        }
                    }
                    string exitFunctionLogger = "Exit :: btn4AutoRize_Click";
                    LogWritter.LogFileWrite(exitFunctionLogger);

                    Response.Cookies.Clear();
                }
                catch (Exception ex)
                {
                    string errmessage = LogWritter.CreateErrorMessage(ex);
                    LogWritter.LogFileWrite(errmessage);

                    if (!Completed)
                    {
                        Response.Redirect("PaymentSucced.aspx?" + Crypto.ArgumentEncrypt("Resp") + "=" + Crypto.Encrypt("notapproved", true), false);
                    }
                }
            }
        }
Ejemplo n.º 17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString[Crypto.ArgumentEncrypt("ressult")] != null)
            {
                string res = Crypto.Decrypt(Request.QueryString[Crypto.ArgumentEncrypt("ressult")].ToString(), true);
                if (res.Equals("sucess"))
                {
                    lblSuccess.Text = "Thank you for registering. A confirmation email has been sent to your registered email address. Please follow the instructions in the email to complete the registration process.";
                    Session.Clear();
                }
                else
                {
                    lblSuccess.Text = "Some error Occured while sending confirmation email to your registered email address. Please check your email address and try again.";
                    Session.Clear();
                }
            }
            if (Request.QueryString[Crypto.ArgumentEncrypt("repaswrd")] != null)
            {
                lblSuccess.Text = "Your current password has been sent to your registered Email Address. Please check Your Email.";
            }
            if (Request.QueryString[Crypto.ArgumentEncrypt("renewaccnt")] != null)
            {
                lblSuccess.Text = "Your Account is renewed successfully.";
            }

            if (Request.QueryString[Crypto.ArgumentEncrypt("change")] != null && Request.QueryString[Crypto.ArgumentEncrypt("your")] != null)
            {
                string NewEmailID = Crypto.Decrypt(Request.QueryString[Crypto.ArgumentEncrypt("your")].ToString(), true);
                Guid   Userid     = Guid.Parse(Crypto.Decrypt(Request.QueryString[Crypto.ArgumentEncrypt("veryid")].ToString(), true));
                ManageUserSVC.ManageUserClient Client = new ManageUserSVC.ManageUserClient();
                string url = System.Configuration.ConfigurationManager.AppSettings["HostingPrefix"];
                ManageUserSVC.ManageUserCustomerData User = new ManageUserSVC.ManageUserCustomerData();

                DataSet dsCus = Client.GetCustomerInfo(Userid);
                if (dsCus != null && dsCus.Tables[0].Rows.Count > 0)
                {
                    User.ApplicationNo  = dsCus.Tables[0].Rows[0]["ApplicationNo"].ToString();
                    User.CompanyAffilID = Guid.Parse(dsCus.Tables[0].Rows[0]["CompAffilationID"].ToString());
                    User.Country        = dsCus.Tables[0].Rows[0]["Country"].ToString();
                    User.SecurityCode   = dsCus.Tables[0].Rows[0]["SecurityCode"].ToString();
                    User.IsActive       = Convert.ToBoolean(dsCus.Tables[0].Rows[0]["IsActive"].ToString());
                    User.IsActivePolicy = Convert.ToBoolean(dsCus.Tables[0].Rows[0]["IsActivePolicy"].ToString());

                    User.YourID        = dsCus.Tables[0].Rows[0]["YID"].ToString();
                    User.ZipCode       = dsCus.Tables[0].Rows[0]["ZipCode"].ToString();
                    User.SignUpDate    = Convert.ToDateTime(dsCus.Tables[0].Rows[0]["SignUp_Date"].ToString());
                    User.Payment       = decimal.Parse(dsCus.Tables[0].Rows[0]["Payment"].ToString());
                    User.IsSecCodeSent = Convert.ToBoolean(dsCus.Tables[0].Rows[0]["IsSecCodeSent"].ToString());
                    User.VerifyEmail   = Convert.ToBoolean(dsCus.Tables[0].Rows[0]["VerifyEmail"].ToString());

                    User.Address     = dsCus.Tables[0].Rows[0]["Address"].ToString();
                    User.City        = dsCus.Tables[0].Rows[0]["City"].ToString();
                    User.CompanyName = dsCus.Tables[0].Rows[0]["Company_Name"].ToString();
                    User.EmailID     = dsCus.Tables[0].Rows[0]["EmailID"].ToString();
                    User.FirstName   = dsCus.Tables[0].Rows[0]["FirstName"].ToString();
                    User.LastName    = dsCus.Tables[0].Rows[0]["LastName"].ToString();

                    User.PhoneNo    = dsCus.Tables[0].Rows[0]["PhoneNo"].ToString();
                    User.ZipCode    = dsCus.Tables[0].Rows[0]["ZipCode"].ToString();
                    User.State      = dsCus.Tables[0].Rows[0]["State"].ToString();
                    User.PersonalID = dsCus.Tables[0].Rows[0]["PersonalID"].ToString();
                }


                User.CustID      = Userid;
                User.EmailID     = NewEmailID;
                User.LastUpdated = DateTime.Now;
                Client.InsertUser(User);

                //Send Email to inform email ID changed...
                char          c           = '"';
                StringBuilder strMailBody = new StringBuilder();
                //header
                strMailBody.Append("<p>&nbsp;</p>");
                strMailBody.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 + ">");
                strMailBody.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/>");


                //body
                strMailBody.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'>");
                strMailBody.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;'>");
                strMailBody.Append("<br/>" + dsCus.Tables[0].Rows[0]["FirstName"].ToString() + "  " + dsCus.Tables[0].Rows[0]["LastName"].ToString() + "," + "<br /><br/>");
                strMailBody.Append("Your Email Address is changed.<br /><br/>");
                strMailBody.Append("Here is your Sign In information for your records:<br /><br/>");
                strMailBody.Append("Email: " + NewEmailID + "<br />");
                //strMailBody.Append("<b>" + "Secure Password: "******"SecurityCode"].ToString() + "<br /><br/>");
                strMailBody.Append("To start using dscoverage.com please click <a href='" + url + "Login.aspx' target='_blank'>here</a> <br/><br/>");
                strMailBody.Append("If you are having trouble with the above link please copy and paste the following link into your browser:<br/><br/>");
                strMailBody.Append("<span style='color:rgb(99,135,175)'>" + url + "Login.aspx </span><br/><br/>");
                strMailBody.Append("Sincerely,<br/>");
                strMailBody.Append("dscoverage.com<br/>");
                strMailBody.Append("</tr></tbody></table><p>&nbsp;</p>");

                //footer
                strMailBody.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.com' target='_blank' style='color:white;font-weight: bolder;'>dscoverage.com</a>, Inc. All Rights Reserved.</p></div>");

                string Subject = ConfigurationManager.AppSettings["ConfirmEmailSubject"].ToString();
                bool   Sent    = CommonFunction.SendEmail(NewEmailID, strMailBody.ToString(), Subject);

                lblSuccess.Text  = "Thank you for visiting our site.";
                lblsuccess1.Text = "You have successfully changed your Email Address. Please visit the Website";
                Session.Clear();
            }
            if (Request.QueryString[Crypto.ArgumentEncrypt("veryid")] != null && Request.QueryString[Crypto.ArgumentEncrypt("your")] == null)
            {
                Guid Userid = Guid.Parse(Crypto.Decrypt(Request.QueryString[Crypto.ArgumentEncrypt("veryid")].ToString(), true));
                ManageUserSVC.ManageUserClient Client = new ManageUserSVC.ManageUserClient();
                string  url   = System.Configuration.ConfigurationManager.AppSettings["HostingPrefix"];
                DataSet Dscus = Client.GetCustomerInfo(Userid);
                if (Dscus != null && Dscus.Tables[0].Rows.Count > 0)
                {
                    if (Dscus.Tables[0].Rows[0]["VerifyEmail"].ToString() == "" || !bool.Parse((Dscus.Tables[0].Rows[0]["VerifyEmail"].ToString())))
                    {
                        char c = '"';
                        //Sending Security code and information...
                        StringBuilder strMailBody = new StringBuilder();
                        //header
                        strMailBody.Append("<p>&nbsp;</p>");
                        strMailBody.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 + ">");
                        strMailBody.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/>");


                        //body
                        strMailBody.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'>");
                        strMailBody.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;'>");
                        strMailBody.Append("<br/>" + Dscus.Tables[0].Rows[0]["FirstName"].ToString() + "  " + Dscus.Tables[0].Rows[0]["LastName"].ToString() + "," + "<br /><br/>");
                        strMailBody.Append("Your registration is complete.<br /><br/>");
                        strMailBody.Append("Here is your Sign In information for your records:<br /><br/>");
                        strMailBody.Append("Email: " + Dscus.Tables[0].Rows[0]["EmailID"].ToString() + "<br />");
                        strMailBody.Append("Secure Password: "******"SecurityCode"].ToString() + "<br /><br/>");
                        //strMailBody.Append("<b><span style='font-size:14px'>Your Application ID Is: " + Dscus.Tables[0].Rows[0]["ApplicationNo"].ToString() + "</span></b><br />");
                        //strMailBody.Append("<b><span style='font-size:14px'>Your User ID Is: " + Dscus.Tables[0].Rows[0]["YID"].ToString() + "</span></b><br />");
                        strMailBody.Append("To start using dscoverage.com please click <a href='" + url + "Login.aspx' target='_blank'>here</a> <br/><br/>");
                        strMailBody.Append("If you are having trouble with the above link please copy and paste the following link into your browser:<br/><br/>");
                        strMailBody.Append("<span style='color:rgb(99,135,175)'>" + url + "Login.aspx</span><br/><br/>");
                        strMailBody.Append("Sincerely,<br/>");
                        strMailBody.Append("dscoverage.com<br/>");
                        strMailBody.Append("</tr></tbody></table><p>&nbsp;</p>");

                        //footer
                        strMailBody.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.com' target='_blank' style='color:white;font-weight: bolder;'>dscoverage.com</a>, Inc. All Rights Reserved.</p></div>");

                        string Subject = ConfigurationManager.AppSettings["SendingSecCodeToUser"].ToString();
                        bool   Sent    = CommonFunction.SendEmail(Dscus.Tables[0].Rows[0]["EmailID"].ToString().Trim(), strMailBody.ToString(), Subject);
                        Client.Update_VerificationStatus(Userid, true, Sent);

                        lblSuccess.Text  = "Thank you for verifying Email Address.";
                        lblsuccess1.Text = "You can now log into your account. Please check your email for your secure password.";
                    }
                    else
                    {
                        lblSuccess.Text = "You have verified your account already. Please visit on Website";
                    }
                }
            }
        }