Exemple #1
0
 private void SendContact_Btn(object sender, RoutedEventArgs e)
 {
     if (AreAllFieldsComplete())
     {
         string      mail        = Mail_TxtBox.Text;
         string      firstName   = FirstName_TxtBox.Text;
         string      familyName  = Name_TxtBox.Text;
         string      phoneNumber = Telephone_TxtBox.Text;
         string      text        = Text_TxtBox.Text;
         ContactForm contact     = ContactFormFactory.Create(mail, firstName, familyName, phoneNumber, text);
         if (contact.SendForm())
         {
             Reset();
             DialogBox.Ok("Well done", "Your contact form has been sent. We will reply you asap.");
         }
         else
         {
             DialogBox.Ok("Error", "An error occured. Please try again.");
         }
     }
 }