public void NavigateToRegPage(LoginPage loginPage) { loginPage.Navigate("http://automationpractice.com/index.php"); SignInButton.Click(); EmailInput.SendKeys("*****@*****.**"); CreateAccountButton.Click(); }
public async Task <ResultDto> Add(EmailInput item) { var result = new ResultDto { Message = "" }; try { var email = _mapper.Map <EmailEntity>(item); await _emailDomainService.Add(email); await _operatorLogDomainService.AddSuccess(new OperatorLogEntity { Type = OperatorLogType.发送邮件, Content = JsonConvert.SerializeObject(item) }); await Commit(); result.IsSuccess = true; } catch (Exception ex) { result.Message = ex.Message; await _operatorLogDomainService.AddError(new OperatorLogEntity { Type = OperatorLogType.发送邮件, Content = $"Data={JsonConvert.SerializeObject(item)},ErrorMessage={result.Message}" }); await Commit(); } return(result); }
public BillingOrderPage FillEmail(string email) { CustomTestContext.WriteLine($"Fill email - '{email}'"); EmailInput.SendKeys(email); return(this); }
private void DetectInputLogin() { string Name = Account.Text.Trim(); string Passwd = Password.Password; string PasswdV = PasswordV.Password; string Email = EmailInput.Text.Trim(); if (string.IsNullOrEmpty(Name) || string.IsNullOrEmpty(Passwd) || string.IsNullOrEmpty(PasswdV) || string.IsNullOrEmpty(Email)) { if (string.IsNullOrEmpty(Name)) { Account.Focus(FocusState.Keyboard); } else if (string.IsNullOrEmpty(Passwd)) { Password.Focus(FocusState.Keyboard); } else if (string.IsNullOrEmpty(PasswdV)) { PasswordV.Focus(FocusState.Keyboard); } else if (string.IsNullOrEmpty(Email)) { EmailInput.Focus(FocusState.Keyboard); } } else if (Passwd != PasswdV) { StringResources stx = StringResources.Load("Error"); ServerMessage.Text = stx.Str("PasswordMismatch"); Password.Focus(FocusState.Keyboard); } else { ServerMessage.Text = ""; IsPrimaryButtonEnabled = IsSecondaryButtonEnabled = Account.IsEnabled = Password.IsEnabled = PasswordV.IsEnabled = EmailInput.IsEnabled = false ; this.Focus(FocusState.Pointer); IndicateLoad(); RuntimeCache RCache = new RuntimeCache() { EN_UI_Thead = true }; RCache.POST( Shared.ShRequest.Server , Shared.ShRequest.Register(Name, Passwd, Email) , RequestComplete, RequestFailed, false); } }
public NameScreenAttrPageObject FillData(string title, string name, string email) { TitleInput.SendKeys(title); YourNameInput.SendKeys(name); EmailInput.SendKeys(email); return(this); }
/// <summary> /// Send Contact us message to exact email and name with exact text /// </summary> /// <param name="email"></param> /// <param name="name"></param> /// <param name="text"></param> /// <returns></returns> public ContactUsPage ContactUs(string email, string name, string text) { NameInput.SendKeys(name); EmailInput.SendKeys(email); MessageTextArea.SendKeys(text); SendSubmit.Click(); return(ConstructPage <ContactUsPage>()); }
/// <summary> /// Sends Email from Admin or Teacher to any user. /// </summary> /// <param name="subject"></param> /// <param name="email"></param> /// <param name="message"></param> /// <returns>MailBoxPage</returns> public MailBoxPage SendEmail(string subject, string email, string message) { SubjectInput.SendKeys(subject); EmailInput.SendKeys(email); MessageInput.SendKeys(message); SubmitInput.Click(); return(ConstructPage <MailBoxPage>()); }
/// <summary> /// Does registration using given email, password and password confirm. /// </summary> /// <param name="email"></param> /// <param name="password"></param> /// <param name="passwordConfirm"></param> /// <returns></returns> public IndexPage Registration(string email, string password, string passwordConfirm) { EmailInput.SendKeys(email); PasswordInput.SendKeys(password); PasswordConfirmInput.SendKeys(passwordConfirm); WaitWhileNotClickableWebElement(RegistrationButton); RegistrationButton.Click(); return(ConstructPage <IndexPage>()); }
private void ClearTextBoxes() { TypeContactComboBox.ResetText(); NameInput.Clear(); StreetNameInput.Clear(); ZipCodeInput.Clear(); PostalAreaInput.Clear(); PhoneNumberInput.Clear(); EmailInput.Clear(); }
public HomePageObject FillLoginForm(string email, string password) { SignInButton.Click(); // Anasayfadaki giriş yap butonuna tıklar. EmailInput.SendKeys(email); // Kullanıcı girişi formunda email'i doldurur. PasswordInput.SendKeys(password); // Kullanıcı girişi formunda parolayı doldurur. RememberMe.Click(); // Kullanıcının daha sonradan hatırlanması için beni hatırla butonuna tıklar. LogInButton.Click(); // Siteye üye girişi yapılması için giriş yap butonuna tıklar. return(new HomePageObject()); // Kullanıcıyı anasayfaya geri döndürür. }
private void RegisterSubmit_Click(object sender, RoutedEventArgs e) { //Getting the data from the page var name = NameInput.Text; var password = PasswordInput.Password; var email = EmailInput.Text; //Check before using adding to DB if (name.Length < 4) { MessageBox.Show("The name should be greater than 3 symbols!"); } else if (password.Length < 5) { MessageBox.Show("The password should be greater than 4 symbols!"); } else if (!email.Contains("@") || email.Length < 6) { MessageBox.Show("Invalid Email!"); } else { using (var context = new EverydayJournalContext()) { try { context.People .Add(new Person() { Name = name, Password = password, Email = email }); context.SaveChanges(); MessageBox.Show("Registration successful!"); //Saving Id and UserName for the current session. LoggerUtility.UserId = context.People.Where(n => n.Name == name).Select(x => x.Id).FirstOrDefault(); LoggerUtility.UserName = name; UserHomePage homePage = new UserHomePage(); this.NavigationService?.Navigate(homePage); } catch (Exception) { MessageBox.Show("Error with registering. Please, try again!"); NameInput.Clear(); PasswordInput.Clear(); EmailInput.Clear(); } } } }
public void FillCheckoutFormAndSubmit(CheckOutFormModel model) { EmailInput.SendKeysWithWait(model.Email); NameInput.SendKeysWithWait(model.Name); AddressInput.SendKeysWithWait(model.Address); CardTypeDropdown.SelectText(model.CardType); CardNumberInput.SendKeysWithWait(model.CardNumber.ToString()); CardholderNameInput.SendKeysWithWait(model.CardholderName); VerificationCodeInput.SendKeysWithWait(model.VerificationCode.ToString()); PlaceOrder.ClickWithWait(); }
private void Submit_Click(object sender, RoutedEventArgs e) //submit button function. { //listing contraints for email and password using if and Regex. if (EmailInput.Text.Length == 0) { errormessage.Text = "Enter an email."; //show error message. EmailInput.Focus(); //will focus the email after the popup of error message. } else if (!Regex.IsMatch(EmailInput.Text, @"^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$")) //regex constraints for email validation. { errormessage.Text = "Enter a valid email."; EmailInput.Select(0, EmailInput.Text.Length); EmailInput.Focus(); } else { //assigning varibales for xaml input tags string firstname = FirstNameInput.Text; string lastname = LastNameInput.Text; string email = EmailInput.Text; string password = passwordInput.Password; //constraints for password using if if (passwordInput.Password.Length == 0) { errormessage.Text = "Enter password."; passwordInput.Focus(); } else if (passwordConfirmInput.Password.Length == 0) { errormessage.Text = "Enter Confirm password."; passwordConfirmInput.Focus(); } else if (passwordInput.Password != passwordConfirmInput.Password) { errormessage.Text = "Confirm password must be same as password."; passwordConfirmInput.Focus(); } else { errormessage.Text = ""; string address = AddressInput.Text; //sql connection --- SSMS --> Server type = Database engine ; Auth --> Windows Auth ; SqlConnection con = new SqlConnection(@"Data Source=PRAVEENRAMESH;Initial Catalog=Login_DB;Integrated Security=True;"); con.Open(); //create connection //insert values SqlCommand cmd = new SqlCommand("Insert into [Users] (FirstName,LastName,Email,Password,Address) values('" + firstname + "','" + lastname + "','" + email + "','" + password + "','" + address + "')", con); cmd.CommandType = CommandType.Text; cmd.ExecuteNonQuery(); //executenonquery to insert values con.Close(); //close connection after data inseration errormessage.Text = "You have Registered successfully."; Reset(); //reset the registration form } } }
public RegistrationPage FillForm(string email, string fullName, string password, string cpassword) { EmailInput.Clear(); EmailInput.Set(email); FullNameInput.Clear(); FullNameInput.Set(fullName); PasswordInput.Clear(); PasswordInput.Set(password); ConfirmPasswordInput.Clear(); ConfirmPasswordInput.Set(cpassword); return(this); }
public RegistrationPage FillForm(User user) { EmailInput.Clear(); EmailInput.Set(user.Email.Value); FullNameInput.Clear(); FullNameInput.Set(user.FullName); PasswordInput.Clear(); PasswordInput.Set(user.Password); ConfirmPasswordInput.Clear(); ConfirmPasswordInput.Set(user.Password); return(this); }
public IHttpActionResult SendEmail(int id, EmailPostDto emailPostDto) { if (emailPostDto.EmailState == EmailPostState.delete && (emailPostDto.appointment == null || emailPostDto.appointment.Date < DateTime.Now)) { return(BadRequest()); } EmailInput emailInput = new EmailInput(); var pat = db.Patients.Find(emailPostDto.appointment.PatientId); emailInput.UserName = pat.FullName; emailInput.Email = pat.Email; switch (emailPostDto.EmailState) { case EmailPostState.confirm: { emailInput.Subject = "Confirm appointment!"; emailInput.Body = $"Hello! \nYou reserved to apointment on {emailPostDto.appointment.Date}\nYour doctor:{db.Doctors.Find(emailPostDto.appointment.DoctorId).FullName}\nPlease delete appointment and register one more if It`s date doesn`t suitable for you\nBest regard,\nAlphaMedic"; break; } case EmailPostState.delete: { emailInput.Subject = "Deleted appointment!"; emailInput.Body = "Hello! \nI am sorry but you deleted from your appointment:\nAppointment date:" + emailPostDto.appointment.Date + "\nAppointment symptoms:" + emailPostDto.appointment.Description + "\nbecause It has already recerved. Please register for anouther" + " appointment and choose anouther date.\nBest regard,\nAlphaMedic"; break; } case EmailPostState.change: { emailInput.Subject = "Change appointment!"; emailInput.Body = "Hello! \nWe changed your appointment date because doctor busies on this date " + emailPostDto.appointment.Date + "\nYour doctor:" + db.Doctors.Find(emailPostDto.appointment.DoctorId)?.FullName + "\nPlease delete appointment and register one more if It`s date doesn`t suitable for you\nBest regard,\nAlphaMedic"; break; } } try { // EMailHelper.SendNotification(emailInput); } catch (Exception) { return(BadRequest()); } return(Ok()); }
public IHttpActionResult SendEmail(EmailInput data) { try { EmailHelper mailHelper = new EmailHelper(); mailHelper.SendEmail(data.Sender, data.Receivers, data.EmailSubject, data.EmailBody); } catch (Exception ex) { throw new Exception("Error: Email sent unsuccessfully"); } return(Ok()); }
public async Task ForgotPassword(EmailInput input) { var user = await _userManager.FindByEmailAsync(input.Email); if (user == null || !await _userManager.IsEmailConfirmedAsync(user)) { return; } string resetCode = await _userManager.GeneratePasswordResetTokenAsync(user); var callbackUrl = _linkGenerator.GetUriByAction(_httpContextAccessor.HttpContext, "reset-password", "Forms", new { userEmail = user.Email, code = resetCode }); await _email.SendEmailAsync(user.Email, "Reset Password", $"A request was made to reset your password. To do so, click <a href={callbackUrl}>here</a>. If you did not make this request, ignore this message. If you are receiving multiple messages about resetting your password that you did not request, contact the DogsIRL team at [email protected]"); }
private void button1_Click(object sender, EventArgs e) { label1.Text = "Registraion"; label2.Text = "Please enter the correct information."; button1.Hide(); NameBox.Show(); NameInput.Show(); CompanyBox.Show(); CompanyInput.Show(); PurposeBox.Show(); PurposeInput.Show(); EmailBox.Show(); EmailInput.Show(); SubmitDetails.Show(); }
private async Task <IHttpActionResult> SendEmailNotification(EmailInput data) { try { EMailHelper mailHelper = new EMailHelper(EMailHelper.EMAIL_SENDER, EMailHelper.EMAIL_CREDENTIALS, EMailHelper.SMTP_CLIENT); var emailBody = String.Format(EMailHelper.EMAIL_BODY); if (mailHelper.SendEMail(data.EmailId, EMailHelper.EMAIL_SUBJECT, emailBody)) { // } } catch (Exception ex) { } return(Ok()); }
public Form1() { InitializeComponent(); NameBox.Hide(); NameInput.Hide(); CompanyBox.Hide(); CompanyInput.Hide(); PurposeBox.Hide(); PurposeInput.Hide(); EmailBox.Hide(); EmailInput.Hide(); SubmitDetails.Hide(); InstallButton.Hide(); PercentComplete.Hide(); InstallProgressBar.Hide(); }
//hemen & maarten public void addGebruiker(Window closeWindow) { try { if (EmailInput != null && VoorNaamInput != null && AchterNaamInput != null && VivesNrInput != null) { if (EmailInput.Contains("vives.be") && EmailInput.Contains("@")) { var gebruiker = _dataservice.getGebruikerViaEmail(EmailInput); if (gebruiker == null) { if (WachtwoordBevestigen == WachtwoordInput) { using (var sha256 = SHA256.Create()) { GebruikersBeheer beheer = new GebruikersBeheer(LoggedInGebruiker); var hashedBytes = sha256.ComputeHash(Encoding.UTF8.GetBytes(WachtwoordInput)); _dataservice.addGebruiker(SelectedRol.Omschrijving, EmailInput, hashedBytes, VoorNaamInput, AchterNaamInput, VivesNrInput); closeWindow.Close(); beheer.ShowDialog(); } } else { SelectedError = "wachtwoord is niet hetzelfde"; } } else { SelectedError = "Het emailadres bestaat al"; } } else { SelectedError = "Het emailadres moet 'vives.be' bevatten"; } } else { SelectedError = "Er zijn velden niet ingevuld"; } } catch (Exception) { SelectedError = "oei, er is iets fout"; } }
private void ToggleEmailGrouping(bool state) { if (state == true) { gridEmailGroup.Visibility = Visibility.Visible; this.PreviewKeyDown -= KeyTakePhotoAction; EmailInput.Focus(); Keyboard.Focus(EmailInput); } else { SaveEmail.Focus(); gridEmailGroup.Visibility = Visibility.Collapsed; EmailInput.Text = emailInputDefaultText; this.PreviewKeyDown += KeyTakePhotoAction; } }
private void AddRow_Click(object sender, EventArgs e) { EmployeePayroll employeePayRoll = new EmployeePayroll(); employeePayRoll.EmployeeFirstName = FirstNameInput.Text; employeePayRoll.EmployeeLastName = LastNameInput.Text; employeePayRoll.EmployeeEmail = EmailInput.Text; double PayRate = 0; double.TryParse(PayRateInput.Text, out PayRate); employeePayRoll.EmployeePayRate = PayRate; double Quantity = 0; double.TryParse(QtyInput.Text, out Quantity); employeePayRoll.TaskQty = Quantity; double ExtraPay = 0; double.TryParse(ExtraInput.Text, out ExtraPay); employeePayRoll.EmployeeExtraPay = ExtraPay; double TotalPay = 0; double.TryParse(TotalPayInput.Text, out TotalPay); employeePayRoll.EmployeeTotalPay = TotalPay; employeePayRoll.EmployeeComments = CommentsInput.Text; // Display the new information in the grid from the field. dataGridView1.Rows.Add(FirstNameInput.Text, LastNameInput.Text, EmailInput.Text, PayRate, Quantity, ExtraPay, TotalPay, CommentsInput.Text); dataGridView1.Columns[0].DisplayIndex = 0; // Clear out the input fields FirstNameInput.Clear(); LastNameInput.Clear(); EmailInput.Clear(); PayRateInput.Clear(); QtyInput.Clear(); ExtraInput.Clear(); TotalPayInput.Clear(); CommentsInput.Clear(); }
private void EditEmployeeOKButton_Click(jQueryEvent evt) { string firstName = FirstNameInput.Value.Trim(), lastName = LastNameInput.Value.Trim(), title = TitleInput.Value.Trim(), email = EmailInput.Value.Trim(); if (firstName == "") { Window.Alert("You must enter a first name."); FirstNameInput.Focus(); return; } if (lastName == "") { Window.Alert("You must enter a last name."); LastNameInput.Focus(); return; } if (title == "") { title = null; } if (email == "") { Window.Alert("You must enter an email address."); EmailInput.Focus(); return; } bool add = (EmployeesGrid.GetData(EmployeesGrid.SelectedRowIndex) == null); Employee emp = new Employee(firstName, lastName, title, email); EmployeesGrid.UpdateItem(EmployeesGrid.SelectedRowIndex, GetGridTexts(emp), emp); if (add) { EmployeesGrid.AddItem(GetGridTexts(null), null); } Tree.SetTreeNodeData(DepartmentsTree.SelectedNode, GetCurrentEmployees()); EditEmployeeDialog.Close(); }
Welcome welcome = new Welcome(); //object for welcome class private void Login_Click(object sender, RoutedEventArgs e) //login button function { //constraints for login using if and regex if (EmailInput.Text.Length == 0) { errormessage.Text = "Enter an email."; EmailInput.Focus(); } else if (!Regex.IsMatch(EmailInput.Text, @"^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$")) { errormessage.Text = "Enter a valid email."; EmailInput.Select(0, EmailInput.Text.Length); EmailInput.Focus(); } else { string email = EmailInput.Text; string password = passwordInput.Password; //sql connection --> to know env see MainWindow.xaml.cs sql comment line 94. SqlConnection con = new SqlConnection("Data Source=PRAVEENRAMESH;Initial Catalog=Login_DB;Integrated Security=True;"); con.Open(); //create connection //select login values from db. SqlCommand cmd = new SqlCommand("Select * from dbo.Users where Email='" + email + "' and password='******'", con); cmd.CommandType = CommandType.Text; SqlDataAdapter adapter = new SqlDataAdapter(); adapter.SelectCommand = cmd; DataSet dataSet = new DataSet(); adapter.Fill(dataSet); //check in db for data. if (dataSet.Tables[0].Rows.Count > 0) { string username = dataSet.Tables[0].Rows[0]["FirstName"].ToString() + " " + dataSet.Tables[0].Rows[0]["LastName"].ToString(); welcome.TextBlockName.Text = username; //Sending value from one form to another form. welcome.Show(); //shows welcome window Close(); //close login window } else { errormessage.Text = "Sorry! Please enter existing emailid/password."; } con.Close(); //close the connection. } }
// End of functions by Windows Forms private void SubmitDetails_Click(object sender, EventArgs e) { NameBox.Hide(); NameInput.Hide(); CompanyBox.Hide(); CompanyInput.Hide(); PurposeBox.Hide(); PurposeInput.Hide(); EmailBox.Hide(); EmailInput.Hide(); SubmitDetails.Hide(); label1.Text = "Installation"; label2.Text = "Click \"Install\" To install..."; InstallButton.Show(); string DetailsEncoded = EncodeUserDetails(); System.IO.File.WriteAllText(@".\UserDetails.txt", DetailsEncoded); }
public async Task <ResultDto> Update(int id, EmailInput item) { var result = new ResultDto { Message = "" }; try { var email = await _emailDomainService.Get(id); if (email == null) { result.Message = $"邮件 {id} 不存在!"; return(result); } var content = email.ComparisonTo(item); _mapper.Map(item, email); await _emailDomainService.Update(email); await _operatorLogDomainService.AddSuccess(new OperatorLogEntity { Type = OperatorLogType.修改邮件, Content = $"Id = {id},Data = {content}" }); await Commit(); result.IsSuccess = true; } catch (Exception ex) { result.Message = ex.Message; await _operatorLogDomainService.AddError(new OperatorLogEntity { Type = OperatorLogType.修改邮件, Content = $"Data={JsonConvert.SerializeObject(item)},ErrorMessage={result.Message}" }); await Commit(); } return(result); }
public IHttpActionResult SendConfirmRegisterEmail(int id, object user) { EmailInput emailInput = new EmailInput(); var pat = db.Patients.Find(id); emailInput.UserName = pat.FullName; emailInput.Email = pat.Email; emailInput.Subject = "Confirm registration!"; try { // EMailHelper.SendConfirmRegisterNotification(emailInput, id); } catch (Exception) { return(BadRequest()); } return(Ok()); }
public bool Login(User user) { if (user.loginOption == LoginOption.Guest) { throw new ArgumentException(); } EmailInput?.SendKeys(user.email); PasswordInput.SendKeys(user.password); SignInButton.Click(); _driver.WaitUntiLoading(); try { return(_driver.SafeFindFirstDisplayedElementBy(_validationIncorrectPasswordWarningLocator, 3) == null); } catch { return(false); } }