//private void btn_SignIn(object sender, RoutedEventArgs e) //{ // string dataemail = email.Text; // string datapassword = password.Password; // var status = callLogin.login(dataemail, datapassword); // if(status == true) // { // Dashboard dashboard = new Dashboard(); // dashboard.Show(); // Close(); // } //} private void btn_ForgotPass(object sender, RoutedEventArgs e) { ForgotPassword callFP = new ForgotPassword(); callFP.Show(); Close(); }
private void lbl_forgotpassword_Click(object sender, EventArgs e) { ForgotPassword forgotPassword = new ForgotPassword(); forgotPassword.Show(); this.Close(); }
private void lblForgotPassword_Click(object sender, EventArgs e) { this.Hide(); ForgotPassword forgotPassword = new ForgotPassword(); forgotPassword.Show(); }
private void SubmitBtn2_Click(object sender, EventArgs e) { if (db.ConfirmDetails(Email_TxtBox1.Text, Uname_TxtBox2.Text)) { var forgotPwordForm = new ForgotPassword(Email_TxtBox1.Text); forgotPwordForm.Show(); Close(); } }
private void ForgotPassword(object sender, RoutedEventArgs e) { ForgotPassword forgotWindow = new ForgotPassword(); //forgotWindow.Visibility = Visibility.Visible; ////forgotWindow.Show(); ////this.Close(); //this.Visibility = Visibility.Collapsed; forgotWindow.Show(); }
private void SubmitBtn2_Click(object sender, EventArgs e) { if (!EmailFieldEmpty() && !UnameFieldEmpty()) { if (db.ConfirmDetails(Email_TxtBox1.Text, Uname_TxtBox2.Text)) { var forgotPwordForm = new ForgotPassword(Email_TxtBox1.Text); forgotPwordForm.Show(); Close(); } } else if (EmailFieldEmpty()) { MessageBox.Show("Please enter your email.", "Yapp! Error"); } else if (UnameFieldEmpty()) { MessageBox.Show("Please enter your username.", "Yapp! Error"); } }
private void label2_Click(object sender, EventArgs e) { if (email.Text == null || email.Text == "Type your email") { label3.ForeColor = Color.Red; label3.Text = "Please enter your email first."; } else { if (forgot == null) { forgot = new ForgotPassword(); forgot.notNew(email.Text); forgot.Show(); Close(); } else { forgot = null; } } }
private void bRegister_Click(object sender, EventArgs e) { var gender = ""; maskedTextBox1.TextMaskFormat = MaskFormat.ExcludePromptAndLiterals; var phoneNumber = maskedTextBox1.Text; var dob = dateTimePicker1.Value.Date.ToShortDateString(); var passw = tPassword.Text.Trim(); var name = tName.Text.Trim(); var surname = tSurname.Text.Trim(); var address = tAdress.Text.Trim(); var email = tEmail.Text.Trim(); lbError.Text = ""; var dtEmail = u.GetCustomerByEmail(email); var dtPhonenumber = u.GetCustomerByPhoneNumber(phoneNumber); if (imgLoc.Length != 0) { var fs = new FileStream(imgLoc, FileMode.Open, FileAccess.Read); var br = new BinaryReader(fs); img = br.ReadBytes((int)fs.Length); if (rbMale.Checked) { gender = "Male"; } else if (rbFemale.Checked) { gender = "Female"; } if (name.Length == 0 || surname.Length == 0 || email.Length == 0 || passw.Length == 0 || address.Length == 0 || phoneNumber.Length == 0) { lbError.Text = "Parameters can not be empty."; } else if (name == "Name" || surname == "Surname" || email == "Email" || address == "Address") { lbError.Text = "Please enter valid informations"; } else if (name == "admin" || surname == "admin" || email == "admin") { lbError.Text = "Please enter valid informations"; } else if (dtEmail.Rows.Count > 0) { lbError.Text = "This email is already exists."; } else if (dtPhonenumber.Rows.Count > 0) { lbError.Text = "This number is already exists."; } else if (!rbMale.Checked && !rbFemale.Checked) { lbError.Text = "Please select a gender"; } else { if (email.IndexOf(".com") < email.IndexOf("@") + 1 || email.IndexOf(".com") == -1 || email.IndexOf(" ") != -1 || email.IndexOf("@") == -1) { lbError.Text = "Please enter valid email adress"; //lbError.Text = dob; //lbError.Text = (DateTime.Now.Year - dateTimePicker1.Value.Year).ToString(); return; } if (name.Length > 20 || name.Length < 3) { lbError.Text = "Name must be between 20 and 3 characters"; return; } if (surname.Length > 20 || surname.Length < 3) { lbError.Text = "Surname must be between 20 and 3 characters"; return; } if (passw.Length > 20 || passw.Length < 5) { lbError.Text = "Password must be between 20 and 5 characters"; return; } if (DateTime.Now.Year - dateTimePicker1.Value.Year < 18) { lbError.Text = "You must be 18 at least to sign in."; } else { try { var u = new User(); var result = u.Add(name, surname, email, passw, address, gender, phoneNumber, dob); if (result > 0) { lbError.Text = "Succesful"; cc.CreateTable(phoneNumber); u.AddImage(int.Parse(u.GetByName(name, "Customer").Rows[0][0].ToString()), img, "Customer"); lbError.Text = CommonFunctions.ReturnString("success"); forgotPassword.isNew(email); lbError.ForeColor = Color.Green; Hide(); forgotPassword.Show(); } else { lbError.Text = "Error"; lbError.ForeColor = Color.Red; } } catch (Exception ex) { MessageBox.Show(ex.Message); } } } } else { lbError.ForeColor = Color.Red; lbError.Text = "Please add a picture."; } }
private void metroLink1_Click(object sender, EventArgs e) { ForgotPassword fpfrm = new ForgotPassword(); fpfrm.Show(); }
private void ChangePword_Btn1_Click(object sender, EventArgs e) { ForgotPassword forgotPassword = new ForgotPassword(email); forgotPassword.Show(); }