protected void Button1_Click(object sender, EventArgs e) { MessageBox msg = new MessageBox(); admin ad = new admin(); MembershipUser u = Membership.GetUser(TextBox1.Text); if (u == null) { msg.Show("Invalid username"); } else { Guid a = new Guid(u.ProviderUserKey.ToString()); DataSet ds = ad.getuserpassword(a); string pass = ds.Tables[0].Rows[0]["password"].ToString(); string email = u.Email.ToString(); ProfileCommon comm = Profile.GetProfile(TextBox1.Text); string username = TextBox1.Text; string mobile = comm.Mobile; string name = comm.FirstName; mailing mail = new mailing(); string mess1 = "Dear " + name + ",<br><br>Your freshprawnsonline account password is:" + pass + "<br><br>Regards,<br>Admin, Farm Fresh Prawns."; string mess = "Dear " + name + " Your freshprawnsonline account password is:" + pass; mail.mymail(email, mess1, "Password Retrieval"); sms s = new sms(); s.SendSMS(mobile, mess); TextBox1.Text = ""; msg.Show("Password has been sent to your provided email and mobile number"); } }
protected void Button1_Click(object sender, EventArgs e) { mailing m = new mailing(); MessageBox msg = new MessageBox(); int z = 0; for (int i = 0; i < GridView1.Rows.Count; i++) { CheckBox c = (CheckBox)GridView1.Rows[i].FindControl("CheckBox1"); Literal l1 = (Literal)GridView1.Rows[i].FindControl("Literal1"); if (c.Checked == true) { m.mymail(l1.Text, uc1.Value, TextBox1.Text); z = 1; } } if (z == 1) { TextBox1.Text = ""; msg.Show("Newsletter sent successfully"); } else { msg.Show("Select subscribers"); } }
protected void LinkButton1_Click(object sender, EventArgs e) { MessageBox msg = new MessageBox(); admin ad = new admin(); mailing mail = new mailing(); DataTable dt = ad.getadminlogin(); string u = dt.Rows[0]["username"].ToString(); string p = dt.Rows[0]["password"].ToString(); string adminemail = mailing.adminemail; mail.mymail(adminemail, "Dear Admin,<br/> Please your admin panel details are as follows <br/>Username :"******"Password :"******"<br/><br/>Regards,<br/>ZartShop.Com", "Admin Panel Password"); msg.Show("Username and password has been sent to your specified email id"); }
protected void LinkButton2_Click(object sender, EventArgs e) { TextBox1.Visible = false; TextBox2.Visible = false; TextBox3.Visible = false; TextBox4.Visible = false; TextBox5.Visible = false; TextBox6.Visible = false; TextBox7.Visible = false; TextBox8.Visible = false; DropDownList1.Visible = false; LinkButton1.Visible = true; LinkButton2.Visible = false; Label1.Visible = true; Label2.Visible = true; Label3.Visible = true; Label4.Visible = true; Label5.Visible = true; Label6.Visible = true; Label11.Visible = true; Label8.Visible = true; Label9.Visible = true; MembershipUser mem = Membership.GetUser(); string id = mem.UserName; MembershipUser u = Membership.GetUser(id); string c = u.UserName.ToString(); ProfileCommon comm = Profile.GetProfile(c); comm.name = TextBox1.Text; comm.Address = TextBox2.Text; comm.Landmark = TextBox3.Text; comm.City = TextBox4.Text; comm.State = DropDownList1.SelectedItem.Text.ToString(); comm.PostalCode = TextBox5.Text; comm.Mobile = TextBox6.Text; comm.Country = "India"; comm.ShippingEmail = TextBox8.Text; admin ad = new admin(); ad.updateuserpassword(c, TextBox7.Text); comm.Save(); ((user)this.Page.Master).data(); mailing mail = new mailing(); mail.mymail(Label10.Text, "Dear " + TextBox1.Text + "Your account details has been updated successfully." + "<br/><br/> Regards ,<br/>ZartShop.com", "Account Details"); filldata(); }
protected void Button1_Click(object sender, EventArgs e) { admin ad = new admin(); MessageBox msg = new MessageBox(); DataTable dt = ad.getuserpassword(TextBox1.Text); if (dt.Rows.Count == 0) { TextBox1.Text = ""; msg.Show("User does not exists"); } else { string password = dt.Rows[0]["password"].ToString(); string email = TextBox1.Text; mailing mail = new mailing(); mail.mymail(email, "Dear Customer,<br/> Your Zartshop.com account password is :" + password + "<br/><br/>Regards,<br>ZartShop.com", "Account Password"); TextBox1.Text = ""; msg.Show("Password has been sent to your email address"); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { string s = Request.Form["responseparams"]; string[] param = s.Split('|'); Label2.Text = param[0].ToString(); Label3.Text = param[5].ToString(); Label4.Text = param[6].ToString(); MembershipUser memb = Membership.GetUser(Profile.UserName); string userid = ""; try { userid = memb.ProviderUserKey.ToString(); } catch (Exception ex) { Response.Redirect("Login.aspx"); } DataSet ds = or.select_order(userid); string name = ds.Tables[0].Rows[0]["firstname"].ToString(); string address = ds.Tables[0].Rows[0]["address"].ToString(); string city = ds.Tables[0].Rows[0]["city"].ToString(); string state = ds.Tables[0].Rows[0]["state"].ToString(); string email = ds.Tables[0].Rows[0]["email"].ToString(); string mobile = ds.Tables[0].Rows[0]["mobile"].ToString(); string ship_name = ds.Tables[0].Rows[0]["delivery_firstname"].ToString(); string ship_address = ds.Tables[0].Rows[0]["delivery_address"].ToString(); string ship_city = ds.Tables[0].Rows[0]["delivery_city"].ToString(); string ship_state = ds.Tables[0].Rows[0]["delivery_state"].ToString(); string ship_email = ds.Tables[0].Rows[0]["delivery_email"].ToString(); string ship_mobile = ds.Tables[0].Rows[0]["delivery_mobile"].ToString(); //email to delivery address string msg = "Dear " + ship_name + ", An order for prawn from " + name + " account of amount Rs." + Label4.Text + " has been marked as unsuccessfull. Order id is " + Label3.Text + " and direcpay reference id " + Label2.Text; em.mymail(ship_email, msg, "Order Unsuccessfull"); string msg1 = "Dear " + name + ", " + "An order made for " + ship_name + " from your farmfreshprawns account of amount Rs." + Label4.Text + " has been marked as unsuccessfull. Order id is " + Label3.Text + " and direcpay reference id " + Label2.Text; //email to billing address em.mymail(email, msg1, "Order Unsuccessfull"); sms sm = new sms(); sm.SendSMS(mobile, msg1); string adminmobile = sms.adminsms; string adminemail = sms.adminemail; string adminmessage = "Dear Admin, New order placed from " + name + "for amount of Rs." + Label4.Text + ". has been marked as unsuccessfull. Order id is " + Label3.Text + " and DirecPay reference id is " + Label2.Text; em.mymail(adminemail, adminmessage, "Order Unsuccessfull"); sm.SendSMS(adminmobile, adminmessage); Profile.prawncrunchShopping.Items.Clear(); } }
public string GetErrorMessage(MembershipCreateStatus status) { switch (status) { case MembershipCreateStatus.DuplicateUserName: return("Username already exists. Please enter a different user name."); case MembershipCreateStatus.DuplicateEmail: return("A username for that e-mail address already exists. Please enter a different e-mail address."); case MembershipCreateStatus.InvalidPassword: return("Password should be of minimum of 6 characters and should be alphanumeric"); case MembershipCreateStatus.InvalidEmail: return("The e-mail address provided is invalid. Please check the value and try again."); case MembershipCreateStatus.InvalidAnswer: return("The password retrieval answer provided is invalid. Please check the value and try again."); case MembershipCreateStatus.InvalidQuestion: return("The password retrieval question provided is invalid. Please check the value and try again."); case MembershipCreateStatus.InvalidUserName: return("The user name provided is invalid. Please check the value and try again."); case MembershipCreateStatus.ProviderError: return("The authentication provider returned an error. Please verify your entry and try again. If the problem persists, please contact your system administrator."); case MembershipCreateStatus.UserRejected: return("The user creation request has been canceled. Please verify your entry and try again. If the problem persists, please contact your system administrator."); case MembershipCreateStatus.Success: ProfileCommon pc = (ProfileCommon)ProfileCommon.Create(Username.Text, true); Roles.AddUserToRole(Username.Text, "user"); pc.FirstName = firstname.Text; pc.Phone = phone.Text; pc.Mobile = mobile.Text; pc.Address = address1.Text; pc.City = DropDownList1.SelectedItem.Text; pc.State = Region.Text; pc.Save(); mailing mail = new mailing(); string msg1 = "Congratulations you are registered successfully with Fresh Farm Prawns" + "<br>" + "Username: "******"<br>" + "Password: "******"<br>" + "Regards ," + "<br>" + "Admin" + ", " + "Fresh Farm Prawns"; mail.mymail(Email.Text, msg1, "User Registration"); sms s = new sms(); s.SendSMS(mobile.Text, "Dear " + firstname.Text + " your freshprawnsonline account has been created. Username:"******" Password:"******""; //Password.Text = ""; //Repassword.Text = ""; //firstname.Text = ""; //address1.Text = ""; //DropDownList1.SelectedIndex = 0; //Region.Text = ""; //Email.Text = ""; //mobile.Text = ""; //phone.Text = ""; //CheckBox2.Checked = false; // address1.Text = city.Text = answer.Text = Region.Text = Email.Text = firstname.Text = lastname.Text = phone.Text = mobile.Text = Username.Text = ""; return("Registered Successfully"); default: return("An unknown error occurred. Please verify your entry and try again. If the problem persists, please contact your system administrator."); } }
protected void Button1_Click(object sender, EventArgs e) { int i = 0; string RandomKey = null; KeyGen = new KeyGenerate(); KeyGen.KeyLetters = "abcdefghjklmnpqrstuvwxyz"; KeyGen.KeyNumbers = "23456789"; KeyGen.KeyChars = 9; int mExist = 0; int mExist1 = 0; for (i = 0; i <= 1; i++) { RandomKey = KeyGen.Generate().ToUpper(); } if (RadioButtonList1.SelectedItem.Value == "1") { MembershipUser mem = Membership.GetUser(TextBox1.Text); if (mem == null) { MembershipCreateStatus status; MembershipUser newuser = Membership.CreateUser(TextBox1.Text, RandomKey, TextBox1.Text, "a", "a", true, out status); if (newuser == null) { msg.Show(GetErrorMessage(status)); } else { ProfileCommon pc = (ProfileCommon)ProfileCommon.Create(TextBox1.Text, true); Roles.AddUserToRole(TextBox1.Text, "user"); mailing mail = new mailing(); mail.mymail(TextBox1.Text, "Dear customer, you are successfully registered with ZartShop.com. Account details are as follows <br/>UserName : "******"<br>Password : "******"<br/><br/>Regards,<br/>ZartShop.com", "ZartShop Registration"); msg.Show("Registered successfully"); newsletter.addnewsletter(TextBox1.Text); System.Threading.Thread.Sleep(1000); FormsAuthentication.SetAuthCookie(TextBox1.Text, true); Response.Redirect("shipping-address.aspx?id=" + RadioButtonList1.SelectedItem.Value.ToString()); } } else { msg.Show("Email Id already registered"); } } else { DataTable dt = ad.checkuser(TextBox1.Text, TextBox2.Text); if (dt.Rows.Count == 0) { msg.Show("Invalid username and password"); } else { if (Request.QueryString["returnurl"] != null) { string te1 = Request.QueryString["returnurl"].ToString(); try { FormsAuthentication.SetAuthCookie(TextBox1.Text, true); Response.Redirect(te1); } catch (Exception ex) { } } else { string te = "shipping-address.aspx?id=" + RadioButtonList1.SelectedItem.Value.ToString(); FormsAuthentication.SetAuthCookie(TextBox1.Text, true); Response.Redirect(te); } } } }