protected void lnkDelete_Click(object sender, EventArgs e) { int indexid = ((GridViewRow)((LinkButton)sender).Parent.Parent).RowIndex; string ID = grddocumentdata.Rows[indexid].Cells[3].Text; string Filename = grddocumentdata.Rows[indexid].Cells[0].Text; ManageUserSVC.ManageUserClient Client = new ManageUserSVC.ManageUserClient(); Client.DeleteDocument(Convert.ToInt32(ID)); if (File.Exists(Request.PhysicalApplicationPath + "Downloads//" + Filename)) { File.Delete(Request.PhysicalApplicationPath + "Downloads//" + Filename); } DocumentBind(); }
public void AffilationBind() { ManageUserSVC.ManageUserClient Client = new ManageUserSVC.ManageUserClient(); DataSet Data = new DataSet(); Data = Client.GetCompanyAffilations(); if (Data != null && Data.Tables[0].Rows.Count > 0) { drpCompnyAffil.DataSource = Data; drpCompnyAffil.DataTextField = "Description"; drpCompnyAffil.DataValueField = "CompAffilationID"; drpCompnyAffil.DataBind(); drpCompnyAffil.Items.Insert(0, new ListItem("--Select--", "Select")); } }
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> </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> </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); } } } }
public void LoadTimer() { object obj = new object(); lock (obj) { //string WkFilePath = Request.PhysicalApplicationPath + @"WkHtml\wkhtmltopdf.exe"; //string EXEFileName = @"C:\Program Files\wkhtmltopdf\wkhtmltopdf.exe"; string url = System.Configuration.ConfigurationManager.AppSettings["HostingPrefix"]; //string args = string.Format("\"{0}\" - ", url + "ProofEvidence.aspx?" + this.Page.ClientQueryString.ToString()); string args = string.Format("\"{0}\" - ", Request.Url.AbsoluteUri); var startInfo = new ProcessStartInfo("wkhtmltopdf.exe", args) { UseShellExecute = false, RedirectStandardOutput = true }; using (ManageUserSVC.ManageUserClient Cl = new ManageUserSVC.ManageUserClient()) { if (!Valid) { var proc = new Process { StartInfo = startInfo }; proc.Start(); string output = proc.StandardOutput.ReadToEnd(); byte[] buffer = proc.StandardOutput.CurrentEncoding.GetBytes(output); proc.WaitForExit(); proc.Close(); Valid = StoreinDB(buffer, Cl); if (Valid) { Response.ContentType = "application/pdf"; Response.AddHeader("content-disposition", "attachment;filename=Evedence.pdf"); Response.BinaryWrite(buffer); Response.End(); } else { tblEvedence.Visible = false; //lnkDownload.Visible = false; lblSuccess.Text = "Your Account get expired, Please Renew your Account."; } } } } }
protected void lnkDelete_Click(object sender, EventArgs e) { if (!ddlCompanyAffil.SelectedItem.Text.Equals("--Select--")) { Guid Val = Guid.Parse(ddlCompanyAffil.SelectedItem.Value); ManageUserSVC.ManageUserClient Client = new ManageUserSVC.ManageUserClient(); Client.DeleteCompanyAffilation(Val); AffilationBind(); lblSuccess.Visible = false; } else { pnlCompantyAffil.Visible = false; lblSuccess.Text = "Please Select Company Name to Delete"; } }
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); }
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); }
protected void lnkDownload_Click(object sender, EventArgs e) { object obj = new object(); lock (obj) { string WkFilePath = Request.PhysicalApplicationPath + @"WkHtml\wkhtmltopdf.exe"; //string EXEFileName = @"C:\Program Files\wkhtmltopdf\wkhtmltopdf.exe"; string args = string.Format("\"{0}\" - ", Request.Url.AbsoluteUri); var startInfo = new ProcessStartInfo(WkFilePath, args) { UseShellExecute = false, RedirectStandardOutput = true }; using (ManageUserSVC.ManageUserClient Cl = new ManageUserSVC.ManageUserClient()) { var proc = new Process { StartInfo = startInfo }; proc.Start(); string output = proc.StandardOutput.ReadToEnd(); byte[] buffer = proc.StandardOutput.CurrentEncoding.GetBytes(output); proc.WaitForExit(); proc.Close(); bool Valid = StoreinDB(buffer, Cl); if (Valid) { Response.ContentType = "application/pdf"; Response.AddHeader("content-disposition", "attachment;filename=Evedence.pdf"); Response.BinaryWrite(buffer); Response.End(); } else { tblEvedence.Visible = false; //lnkDownload.Visible = false; lblSuccess.Text = "Your Account get expired, Please Renew your Account."; } } } }
protected void btnSubmit_Click(object sender, EventArgs e) { if (IsValidate()) { ManageUserSVC.ManageUserClient Client = new ManageUserSVC.ManageUserClient(); ManageUserSVC.ManageUserCustomerData User = new ManageUserSVC.ManageUserCustomerData(); DataSet dsCus = ViewState["CustomerData"] as DataSet; if (dsCus != null && dsCus.Tables[0].Rows.Count > 0) { User.CompanyName = dsCus.Tables[0].Rows[0]["Company_Name"].ToString(); User.PersonalID = dsCus.Tables[0].Rows[0]["PersonalID"].ToString(); User.FirstName = dsCus.Tables[0].Rows[0]["FirstName"].ToString(); User.LastName = dsCus.Tables[0].Rows[0]["LastName"].ToString(); 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.EmailID = dsCus.Tables[0].Rows[0]["EmailID"].ToString(); User.IsActive = Convert.ToBoolean(dsCus.Tables[0].Rows[0]["IsActive"].ToString()); User.IsActivePolicy = Convert.ToBoolean(dsCus.Tables[0].Rows[0]["IsActivePolicy"].ToString()); User.SecurityCode = dsCus.Tables[0].Rows[0]["SecurityCode"].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.CustID = Guid.Parse(Session["CustomerID"].ToString()); User.Address = txtAddress.Text; User.City = txtCity.Text; User.LastUpdated = DateTime.Now; User.PhoneNo = txtPhone.Text; User.ZipCode = txtZipCode.Text; User.State = drpStates.SelectedItem.Text; Client.InsertUser(User); lblError.Visible = true; lblError.ForeColor = System.Drawing.Color.Green; lblError.Text = "Your profile has been successfully changed"; } }
protected void btnSubmit_Click(object sender, EventArgs e) { if (Validate()) { string Username = txtUsername.Text; string Password = txtPassword.Text; DataSet dsCustData = new DataSet(); ManageUserSVC.ManageUserClient Client = new ManageUserSVC.ManageUserClient(); dsCustData = Client.AdminLogin(Username, Password); if (dsCustData != null && dsCustData.Tables[0].Rows.Count > 0) { Session["Userdata"] = dsCustData; Response.Redirect("~/Admin/AdminCustomerList.aspx"); } else { lblError.Text = "Invalid Username or Password !"; } } }
private void CustomerBind() { DataSet Data = new DataSet(); ManageUserSVC.ManageUserClient Client = new ManageUserSVC.ManageUserClient(); Data = Client.GetAllCustomers(); //MKP Solved existing issue when grid have one customer than it deleted it is not automaic refresh the grid //if (Data != null && Data.Tables[0].Rows.Count > 0) { grdCustomers.DataSource = Data; grdCustomers.DataBind(); grdCustomers.UseAccessibleHeader = true; grdCustomers.HeaderRow.TableSection = TableRowSection.TableHeader; TableCellCollection cells = grdCustomers.HeaderRow.Cells; cells[0].Attributes.Add("data-class", "expand"); //cells[2].Attributes.Add("data-hide", "phone,tablet"); cells[3].Attributes.Add("data-hide", "phone,tablet"); cells[4].Attributes.Add("data-hide", "phone,tablet"); //cells[5].Attributes.Add("data-hide", "phone,tablet"); //cells[6].Attributes.Add("data-hide", "phone,tablet"); } }
private bool StoreinDB(byte[] buffer, ManageUserSVC.ManageUserClient client, ManageUserSVC.ManageUserCoverageData Coverage) { bool Valid = true; List <usp_GetEvedenceResult> DsCus = new List <usp_GetEvedenceResult>(); DsCus = client.GetEvedenceInfoByCusID(Guid.Parse(Session["CustomerID"].ToString())); if (DsCus != null && DsCus.Count > 0) { foreach (usp_GetEvedenceResult item in DsCus) { if (item.IsActive.Value) { client.Update_Evidence(Guid.Parse(Session["CustomerID"].ToString()), DateTime.Now, false, item.EvidenceID, true); } } } if (DsCus != null && DsCus.Count > 0) { { //Delete Evedence, need to renew account. //client.Delete_Evidence(Guid.Parse(Session["CustomerID"].ToString())); //Insert Newely generated Evedence after renew... client.InsertEvedence(Guid.NewGuid(), Coverage.CoverageDate, Guid.Parse(Session["CustomerID"].ToString()), DateTime.Now, true, true, buffer); } } else { //Inserted New Evedence. client.InsertEvedence(Guid.NewGuid(), Coverage.CoverageDate, Guid.Parse(Session["CustomerID"].ToString()), DateTime.Now, true, true, buffer); } return(Valid); }
protected void btnAdd_Click(object sender, EventArgs e) { lblSuccess.Text = ""; ManageUserSVC.ManageUserClient client = new ManageUserSVC.ManageUserClient(); if (ViewState["CompanyName"] != null) { Guid ID = Guid.Parse(ddlCompanyAffil.SelectedItem.Value); client.AddUpdateCompany(ID, txtCompayAff.Text); txtCompayAff.Text = ""; ViewState["CompanyName"] = null; } else { string Chk = client.CheckCmpny(txtCompayAff.Text); if (Chk.Equals("EXIST")) { lblSuccess.Text = "This Company is Allready Exists"; } else { string Name = txtCompayAff.Text; if (Name != "") { Guid NewID = Guid.NewGuid(); client.AddUpdateCompany(NewID, Name); txtCompayAff.Text = ""; } else { lblSuccess.Text = "Please Enter Company Name to Add"; } } } AffilationBind(); pnlCompantyAffil.Visible = false; }
protected void btnSave_Click(object sender, EventArgs e) { if (Valid()) { if (Session["UserID"] != null) { ManageUserSVC.ManageUserClient Client = new ManageUserSVC.ManageUserClient(); ManageUserSVC.ManageUserCustomerData User = new ManageUserSVC.ManageUserCustomerData(); User.CustID = Guid.Parse(Session["UserID"].ToString()); User.Address = txtAddress.Text; User.ApplicationNo = txtApplicationNo.Text; User.City = txtCity.Text; User.CompanyAffilID = Guid.Parse(drpCompnyAffil.SelectedItem.Value); User.CompanyName = txtCompany.Text; User.Country = txtCountry.Text; User.EmailID = txtEmailID.Text; User.FirstName = txtFirstName.Text; User.IsActive = chkIsActive.Checked; User.IsActivePolicy = chkIsActivePolicy.Checked; User.LastName = txtLastName.Text; User.LastUpdated = DateTime.Now; User.PhoneNo = txtphoneNo.Text; User.SecurityCode = txtSecCode.Text; User.State = drpStates.SelectedItem.Text; User.YourID = txtCustomerID.Text; User.ZipCode = txtZipCode.Text; User.SignUpDate = Convert.ToDateTime(txtSignup.Text); User.Payment = decimal.Parse(txtPayment.Text); User.IsSecCodeSent = chkIscedeSent.Checked; User.VerifyEmail = chkVerify.Checked; User.PersonalID = txtpersonalid.Text; User.InsuraceType = ""; Client.InsertUser(User); Response.Redirect("AdminCustomerList.aspx"); } } }
private void DocumentBind() { DataSet Data = new DataSet(); ManageUserSVC.ManageUserClient Client = new ManageUserSVC.ManageUserClient(); Data = Client.GetDocumentinfo(); if (Data != null && Data.Tables[0].Rows.Count > 0) { grddocument.DataSource = Data; grddocument.DataBind(); grddocument.UseAccessibleHeader = true; grddocument.HeaderRow.TableSection = TableRowSection.TableHeader; TableCellCollection cells = grddocument.HeaderRow.Cells; cells[0].Attributes.Add("data-class", "expand"); cells[2].Attributes.Add("data-hide", "phone,tablet"); cells[3].Attributes.Add("data-hide", "phone,tablet"); cells[4].Attributes.Add("data-hide", "phone,tablet"); cells[5].Attributes.Add("data-hide", "phone,tablet"); //cells[6].Attributes.Add("data-hide", "phone,tablet"); //cells[7].Attributes.Add("data-hide", "phone,tablet"); } }
protected void btnAdminLogin_Click(object sender, EventArgs e) { if (Validate()) { string Username = login1.UserName; string Password = login1.Password; DataSet dsCustData = new DataSet(); ManageUserSVC.ManageUserClient Client = new ManageUserSVC.ManageUserClient(); dsCustData = Client.AdminLogin(Username, Password); if (dsCustData != null && dsCustData.Tables[0].Rows.Count > 0) { Session["Userdata"] = dsCustData; if (this.AdminLoginClick != null) { AdminLoginClick(sender, e); } } else { lblError.Text = "Invalid Username or Password !"; } } }
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); } } } }
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(); }
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> </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> </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> </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> </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> </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> </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"; } } } }
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; } }
private void GetPayPalResponce() { string authToken, txToken, query, strResponse, Key, Val, status; authToken = WebConfigurationManager.AppSettings["PDTToken"]; //read in txn token from querystring txToken = Request.QueryString.Get("tx"); query = string.Format("cmd=_notify-synch&tx={0}&at={1}", txToken, authToken); // Create the request back string url = "https://www.sandbox.paypal.com/cgi-bin/webscr"; HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url); // Set values for the request back req.Method = "POST"; req.ContentType = "application/x-www-form-urlencoded"; req.ContentLength = query.Length; // Write the request back IPN strings StreamWriter stOut = new StreamWriter(req.GetRequestStream(), System.Text.Encoding.ASCII); stOut.Write(query); stOut.Close(); StreamReader stIn = new StreamReader(req.GetResponse().GetResponseStream()); strResponse = stIn.ReadToEnd(); if (strResponse.Contains("\n")) { strResponse = strResponse.Replace("\n", " "); } status = strResponse.Substring(0, strResponse.IndexOf(" ")); if (status != "FAIL") { Guid CustID = Guid.Parse(Session["CustomerID"].ToString()); ManageUserSVC.ManageUserClient Client = new ManageUserSVC.ManageUserClient(); ManageUserSVC.ManageUserCoverageData Coverage = new ManageUserCoverageData(); if (Session["RenewCoverageInfo"] != null) { Coverage = (ManageUserSVC.ManageUserCoverageData)Session["RenewCoverageInfo"]; } else { Coverage = (ManageUserSVC.ManageUserCoverageData)Session["CoverageInfo"]; } Client.InsertCoverageData(Coverage); bool Propertybuy = false;; Client.Update_Payment(CustID, decimal.Parse(Session["Amount"].ToString()), Propertybuy); if (Session["RenewCoverageInfo"] != null) { lblMessage.Text = "Payment Successful! Your Account is Renewed Successfully!"; //todo sendmail for renew success } else { string baseurl = System.Configuration.ConfigurationManager.AppSettings["HostingPrefix"]; lblMessage.Text = "Thank you! Your payment was successful."; idspan.Visible = true; } string Local = System.Configuration.ConfigurationManager.AppSettings["HostingPrefix"]; dowload(Local.Replace("https://", "http://") + "ProofEvidence.aspx?" + Crypto.ArgumentEncrypt("sss") + "=" + Crypto.Encrypt(CustID.ToString(), true), Coverage); SendEmailForProofOfEvidnce(Client, CustID, Local); } else { lblMessage.Text = "Some Error Occured while processing, Please try again By login into Site.!"; } }
protected void btnSearch_Click(object sender, EventArgs e) { ManageUserSVC.ManageUserClient Client = new ManageUserSVC.ManageUserClient(); DataSet Data = new DataSet(); lblsrcerror.Text = ""; lblgrd.Text = ""; if (txtSerchDate.Visible == false) { if (txtSearch.Text != "") { if (ddlSearchBy.SelectedItem.Text.Equals("All Users")) CustomerBind(); if (ddlSearchBy.SelectedItem.Text.Equals("Application Number")) { Data = Client.SearchCustomers(txtSearch.Text, "", "", "", null); } if (ddlSearchBy.SelectedItem.Text.Equals("Name")) { Data = Client.SearchCustomers("", txtSearch.Text, "", "", null); } if (ddlSearchBy.SelectedItem.Text.Equals("Email-ID")) { Data = Client.SearchCustomers("", "", txtSearch.Text, "", null); } if (ddlSearchBy.SelectedItem.Text.Equals("User ID")) { Data = Client.SearchCustomers("", "", "", txtSearch.Text, null); } if (Data != null && Data.Tables.Count > 0 && Data.Tables[0].Rows.Count > 0) { grdCustomers.Visible = true; grdCustomers.DataSource = Data; grdCustomers.DataBind(); } else { grdCustomers.Visible = false; lblgrd.Text = "No Data Found"; } } else { lblsrcerror.Text = "Please Enter Search Text."; } } else { if (ddlSearchBy.SelectedItem.Text.Equals("Coverage Start Date")) { if (txtSerchDate.Text != "") { DateTime strDate = DateTime.ParseExact( txtSerchDate.Text, "mm-dd-yyyy", System.Globalization.CultureInfo.InvariantCulture); Data = Client.SearchCustomers("", "", "", "", strDate); if (Data != null && Data.Tables.Count > 0 && Data.Tables[0].Rows.Count > 0) { grdCustomers.Visible = true; grdCustomers.DataSource = Data; grdCustomers.DataBind(); } else { grdCustomers.Visible = false; lblgrd.Text = "No Data Found"; } } else { lblsrcerror.Text = "Please Select Date."; } } } }
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!"; } } }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString[Crypto.ArgumentEncrypt("sss")] != null) { if (!IsPostBack) { //tim.Elapsed += new ElapsedEventHandler(Timer1_Tick); //tim.Interval = 8000; //tim.Start(); ManageUserSVC.ManageUserClient Cl = new ManageUserSVC.ManageUserClient(); DataSet dsCus = new DataSet(); Guid CustID = Guid.Parse(Crypto.Decrypt(Request.QueryString[Crypto.ArgumentEncrypt("sss")].ToString(), true)); ViewState["ID"] = CustID; dsCus = Cl.CreateEvedenceInfoByCusID(CustID); if (dsCus != null && dsCus.Tables[0].Rows.Count > 0) { if (dsCus.Tables[0].Rows[0]["CoverDate"].ToString() != "" || dsCus.Tables[0].Rows[0]["CoverDate"].ToString() != Convert.ToDateTime("1/1/1753 12:00:00").ToString()) { Guid EvedenceID = Guid.NewGuid(); lblnameaddress.Text = dsCus.Tables[0].Rows[0]["Name"].ToString() + "," + 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() + ", " + dsCus.Tables[0].Rows[0]["Country"].ToString(); DateTime CoverageDate = Convert.ToDateTime(dsCus.Tables[0].Rows[0]["CoverDate"].ToString()); lblCoverageDate.Text = CoverageDate.ToString("MM/dd/yyyy", CultureInfo.InvariantCulture); lbl12Month.Text = CoverageDate.AddMonths(12).ToString("MM/dd/yyyy", CultureInfo.InvariantCulture); lblEvedenceNo.Text = EvedenceID.ToString().ToUpper(); //lblcipx.Text = "CompanyPilicyNo.(Fixed)"; //if (dsCus.Tables[0].Rows[0]["IsProprtyBuy"].ToString().Equals("True")) //{ // ChkProperty.Checked = true; //} ViewState["CusID"] = CustID; ViewState["EvedenceID"] = EvedenceID; ViewState["CoverageDate"] = CoverageDate; } } //List<usp_GetEvedenceResult> ds = new List<usp_GetEvedenceResult>(); //ds = Cl.GetEvedenceInfoByCusID(CustID); //if (ds != null && ds.Count > 0) //{ // Byte[] bytee = ds.ToList()[0].Data.Bytes; // download(bytee); //} //else { if (Request.QueryString["firsttime"] != null) { tblEvedence.Visible = false; lblSuccess.Text = "Please Either verify your Account on Email Address or Your Account is Expired. Please Make sure that Your have done Payment."; } } } } }
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 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> </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> </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."; } } }
protected void btnChangePass_Click(object sender, EventArgs e) { if (IsValidateChangePass()) { ManageUserSVC.ManageUserClient Client = new ManageUserSVC.ManageUserClient(); ManageUserSVC.ManageUserCustomerData User = new ManageUserSVC.ManageUserCustomerData(); DataSet dsCus = ViewState["CustomerData"] as DataSet; if (dsCus.Tables[0].Rows[0]["SecurityCode"].ToString().Trim().Equals(txtCurrentPass.Text.Trim())) { 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.EmailID = dsCus.Tables[0].Rows[0]["EmailID"].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 = Guid.Parse(Session["CustomerID"].ToString()); User.SecurityCode = txtConfirmPass.Text; User.LastUpdated = DateTime.Now; Client.InsertUser(User); string url = System.Configuration.ConfigurationManager.AppSettings["HostingPrefix"]; string Name = dsCus.Tables[0].Rows[0]["FirstName"].ToString() + " " + dsCus.Tables[0].Rows[0]["LastName"].ToString(); //Sending verify email... StringBuilder strVerifyBody = new StringBuilder(); string headurl = url + "images/image.png"; //header strVerifyBody.Append("<p> </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> </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/>" + Name + "," + "<br /><br/>"); strVerifyBody.Append("Your Password is changed.<br /><br/>"); strVerifyBody.Append("Here is your Sign In information for your records:<br /><br/>"); strVerifyBody.Append("Email: " + dsCus.Tables[0].Rows[0]["EmailID"].ToString() + "<br />"); strVerifyBody.Append("Secure Password: "******"<br /><br/>"); strVerifyBody.Append("To start using dscoverage.com please click <a href='" + url + "Login.aspx' target='_blank'>here</a> <br/><br/>"); strVerifyBody.Append("If you are having trouble with the above link please copy and paste the following link into your browser:<br/><br/>"); strVerifyBody.Append("<span style='color:rgb(99,135,175)'>" + url + "Login.aspx </span><br/><br/>"); strVerifyBody.Append("Sincerely,<br/>"); strVerifyBody.Append("dscoverage.com<br/>"); strVerifyBody.Append("</tr></tbody></table><p> </p>"); //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.com' target='_blank' style='color:white;font-weight: bolder;'>dscoverage.com</a>, Inc. All Rights Reserved.</p></div>"); string Subject = ConfigurationManager.AppSettings["PasswordChangeSubject"].ToString(); bool Sent1 = CommonFunction.SendEmail(dsCus.Tables[0].Rows[0]["EmailID"].ToString(), strVerifyBody.ToString(), Subject); lblChangePassError.Visible = true; lblChangePassError.ForeColor = System.Drawing.Color.Green; lblChangePassError.Text = "Your password has been successfully changed."; txtCurrentPass.Attributes.Add("value", ""); txtNewPass.Attributes.Add("value", ""); txtConfirmPass.Attributes.Add("value", ""); txtCurrentPass.Text = ""; txtNewPass.Text = ""; txtConfirmPass.Text = ""; BindInfo(Session["CustomerID"].ToString()); } else { lblChangePassError.Visible = true; lblChangePassError.ForeColor = System.Drawing.Color.Red; lblChangePassError.Text = "Invalid current Password. Please enter valid current password."; } } }
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 btnLogin_Click(object sender, EventArgs e) { string EmailId = txtUsername.Text.Trim(); Session["EmailId"] = EmailId; string Password = txtSecuCode.Text.Trim(); DataSet dsCustData = new DataSet(); ManageUserSVC.ManageUserClient Client = new ManageUserSVC.ManageUserClient(); dsCustData = Client.LoginCustomer(EmailId.Trim(), Password.Trim()); Response.Cookies["UserName"].Value = txtUsername.Text.Trim(); Response.Cookies["UserName"].Expires = DateTime.Now.AddDays(30); if (dsCustData != null && dsCustData.Tables[0].Rows.Count > 0) { bool IsActivePolicy = Convert.ToBoolean(dsCustData.Tables[0].Rows[0]["IsActivePolicy"].ToString()); decimal Pay = Convert.ToDecimal(dsCustData.Tables[0].Rows[0]["Payment"].ToString()); Session["payment"] = Pay; string CusID = Crypto.Encrypt(dsCustData.Tables[0].Rows[0]["Cust_ID"].ToString(), true); Session["CustomerID"] = dsCustData.Tables[0].Rows[0]["Cust_ID"].ToString(); Session["EmailID"] = dsCustData.Tables[0].Rows[0]["EmailID"].ToString(); string firstname = Crypto.Encrypt(dsCustData.Tables[0].Rows[0]["FirstName"].ToString(), true); Session["Firstname"] = dsCustData.Tables[0].Rows[0]["FirstName"].ToString(); string paswrd = Crypto.Encrypt(dsCustData.Tables[0].Rows[0]["SecurityCode"].ToString(), true); Session["Paswrd"] = dsCustData.Tables[0].Rows[0]["SecurityCode"].ToString(); if (Session["GenerateCertificateFromDefaultPage"] != null) { ManageUserSVC.ManageUserClient Cl = new ManageUserSVC.ManageUserClient(); Guid CustID = Guid.Parse(Session["CustomerID"].ToString()); DataSet dsCus = Cl.CreateEvedenceInfoByCusID(CustID); DateTime CoverageDate; DateTime EndDate = DateTime.Now; if (dsCus != null && dsCus.Tables[0].Rows.Count > 0) { if (dsCus.Tables[0].Rows[0]["CoverDate"].ToString() != "") { CoverageDate = Convert.ToDateTime(dsCus.Tables[0].Rows[0]["CoverDate"].ToString()); EndDate = CoverageDate.AddMonths(12); int numberOfDayRemaining = (EndDate - DateTime.Now).Days; if (numberOfDayRemaining <= 0) { Response.Redirect("Home.aspx", true); } } } if (dsCus != null && dsCus.Tables[0].Rows.Count > 0) { Session["GenerateCertificateFromDefaultPage"] = null; Response.Redirect("FillCertiInfo.aspx"); } else { Session["GenerateCertificateFromDefaultPage"] = null; Session["pnl"] = "3"; Session["value"] = Crypto.Encrypt(Session["CustomerID"].ToString(), true); Response.Redirect("Register.aspx"); } } else { Response.Redirect("Home.aspx", true); } } else { lblError.Text = "Unfortunately we could not match the email address you entered with information in our database!"; } }
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> </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> </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> </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> </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."; } } }