protected void BtnSubmit_Click(object sender, EventArgs e) { EntityServiceReference.EntityServiceClient ServiceRefClient = new EntityServiceReference.EntityServiceClient(); ServiceRefClient.Open(); var arr = ServiceRefClient.ForgotPassword(txtmembershipId.Text.ToString(), txtEmailId.Text.ToString()); if (arr.Length > 0) { //LblMsg.Text = arr[0].Password.ToString(); emailid = txtEmailId.Text.ToString(); if (arr[0].Value.ToString().Equals("1"))// pwd exist already { if (arr[0].Password.ToString().Trim().Equals("") || arr[0].Password.ToString().Trim().Equals(null))// pwd exist already { ////generate pwd //var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; //var random = new Random(); //var pwd = new string( // Enumerable.Repeat(chars, 8) // .Select(s => s[random.Next(s.Length)]) // .ToArray()); ////update pwd in db //EntityServiceReference.EntityServiceClient ServiceRefClient1 = new EntityServiceReference.EntityServiceClient(); //ServiceRefClient1.Open(); //int cnfrm = ServiceRefClient1.ChangePassword(txtmembershipId.Text.ToString(), arr[0].Password.ToString(), pwd.ToString()); //ServiceRefClient1.Close(); //HTMLMailer(emailid.ToString(), pwd.ToString(), txtmembershipId.Text.ToString()); //LblMsg.Text = "Your password is mailed at " + emailid.ToString(); LblMsg.Text = "Password not found! Please register and verify your membership."; } else { pwd = arr[0].Password.ToString(); LblMsg.Text = "Your password is mailed at " + emailid.ToString(); // send mail sms HTMLMailer(emailid.ToString(), pwd.ToString(), txtmembershipId.Text.ToString()); } } else { LblMsg.Text = "<center>Dear Guest,The Email ID or MembershipID provided by you does not match with our records.<br/>Request you to call at Loyalty Desk for assistance.</center><center>Tel:0124-4847435.</center><center>Email:<a href='mailto:[email protected]'>[email protected]</center></a>"; } } ServiceRefClient.Close(); }
protected void BtnSubmit_Click(object sender, EventArgs e) { EntityServiceReference.EntityServiceClient ServiceRefClient = new EntityServiceReference.EntityServiceClient(); ServiceRefClient.Open(); var arr = ServiceRefClient.ForgotPassword(txtmembershipId.Text.ToString(), txtEmailId.Text.ToString()); if (arr.Length > 0) { //LblMsg.Text = arr[0].Password.ToString(); emailid = txtEmailId.Text.ToString(); if (arr[0].Value.ToString().Equals("1")) // pwd exist already { if (arr[0].Password.ToString().Trim().Equals("") || arr[0].Password.ToString().Trim().Equals(null)) // pwd exist already { ////generate pwd //var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; //var random = new Random(); //var pwd = new string( // Enumerable.Repeat(chars, 8) // .Select(s => s[random.Next(s.Length)]) // .ToArray()); ////update pwd in db //EntityServiceReference.EntityServiceClient ServiceRefClient1 = new EntityServiceReference.EntityServiceClient(); //ServiceRefClient1.Open(); //int cnfrm = ServiceRefClient1.ChangePassword(txtmembershipId.Text.ToString(), arr[0].Password.ToString(), pwd.ToString()); //ServiceRefClient1.Close(); //HTMLMailer(emailid.ToString(), pwd.ToString(), txtmembershipId.Text.ToString()); //LblMsg.Text = "Your password is mailed at " + emailid.ToString(); LblMsg.Text = "Password not found! Please register and verify your membership."; } else { pwd = arr[0].Password.ToString(); LblMsg.Text = "Your password is mailed at " + emailid.ToString(); // send mail sms HTMLMailer(emailid.ToString(), pwd.ToString(), txtmembershipId.Text.ToString()); } } else { LblMsg.Text = "<center>Dear Guest,The Email ID or MembershipID provided by you does not match with our records.<br/>Request you to call at Loyalty Desk for assistance.</center><center>Tel:0124-4847435.</center><center>Email:<a href='mailto:[email protected]'>[email protected]</center></a>"; } } ServiceRefClient.Close(); }