architechure changes

This commit is contained in:
Wyatt Miller 2018-11-26 20:09:27 -05:00
parent d3f0e0dc10
commit 1f94357521
12 changed files with 46 additions and 15 deletions

Binary file not shown.

View File

@ -16,15 +16,15 @@ namespace DeskHubSharp
// TODO: finish this class
// TODO: debug feedback form
private string _to = "wjmiller2016@gmail.com";
private string _from = "wjmiller2016@gmail.com";
private string _name;
private string _message;
private string _emailText;
public EmailBLL(TextBox name, TextBox emailBody)
public EmailBLL(string name, string message, string emailText)
{
_name = name.Text;
_message = emailBody.Text;
_name = name;
_message = message;
_emailText = emailText;
}
private bool IsValidated()
@ -55,24 +55,27 @@ namespace DeskHubSharp
{
try
{
var email = new Email();
var err = new ErrorWindow();
var message = new MimeMessage();
message.From.Add(new MailboxAddress($"{_name}", _from));
message.To.Add(new MailboxAddress("Wyatt J. Miller", _to));
message.From.Add(new MailboxAddress($"{_name}", email.FromEmail));
message.To.Add(new MailboxAddress("Wyatt J. Miller", email.ToEmail));
message.Subject = $"{_name} requires your attention!";
message.Body = new TextPart("plain")
{
Text = _message
Text = _message + _emailText
};
using (var client = new SmtpClient())
{
client.Connect("smtp.gmail.com", 465, SecureSocketOptions.SslOnConnect);
// change credentials
client.Authenticate(_from, "password");
client.Authenticate(email.FromEmail, email.Password);
client.Send(message);
client.Disconnect(true);
}
err.lbl_title.Content = "Thank you!";
err.txtblk_error.Text = "Thank you for sending your email! We have it and will reply shortly.";
err.ShowDialog();

View File

@ -10,7 +10,7 @@ namespace DeskHubSharp
{
class Request
{
private string _apiEndpoint = "https://api.github.com/v3/";
private string _apiEndpoint = "https://api.github.com/";
public Request()
{

View File

@ -5,7 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:DeskHubSharp"
mc:Ignorable="d"
Title="ErrorWindow" Height="200" Width="300
Title="Response - DeskHubSharp" Height="200" Width="300
">
<Grid>
<TextBlock x:Name="txtblk_error" HorizontalAlignment="Left" Margin="10,66,0,0" TextWrapping="Wrap" Text="An error occurred. Please try again." VerticalAlignment="Top" Width="272" TextAlignment="Center" RenderTransformOrigin="0.468,-0.751"/>

View File

@ -8,7 +8,7 @@
Title="Feedback - DeskHubSharp" Height="450" Width="500">
<Grid>
<Label x:Name="lbl_title" Content="Feedback" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" FontSize="20"/>
<TextBox x:Name="txtbox_name" HorizontalAlignment="Left" Height="23" Margin="43,159,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="216"/>
<TextBox x:Name="txtbox_name" HorizontalAlignment="Left" Height="23" Margin="43,159,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="152"/>
<TextBox x:Name="txtbox_feedbackmessage" HorizontalAlignment="Left" Height="117" Margin="43,213,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="406"/>
<TextBlock HorizontalAlignment="Left" Margin="43,52,0,0" TextWrapping="Wrap" Text="Is there a problem with the program? Got a new feature that you want in the program? By filling out this feedback form, you can shape development going forward! Please state your case and we will reply as soon as possible." VerticalAlignment="Top" Height="76" Width="388"/>
<Label x:Name="lbl_nametxt" Content="Name:" HorizontalAlignment="Left" Margin="43,133,0,0" VerticalAlignment="Top" Padding="2,5,5,5"/>
@ -19,6 +19,8 @@
<Color x:Key="Green">#FF34A853</Color>
</Button.Resources>
</Button>
<TextBox x:Name="txtbox_email" HorizontalAlignment="Left" Height="23" Margin="200,159,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="249"/>
<Label x:Name="lbl_emailtxt" Content="Email:" HorizontalAlignment="Left" Margin="200,133,0,0" VerticalAlignment="Top" Padding="3,5,5,5"/>
</Grid>
</Window>

View File

@ -31,7 +31,7 @@ namespace DeskHubSharp
private void btn_send_Click(object sender, RoutedEventArgs e)
{
EmailBLL email = new EmailBLL(txtbox_name, txtbox_feedbackmessage);
EmailBLL email = new EmailBLL(txtbox_name.Text, txtbox_feedbackmessage.Text, txtbox_email.Text);
email.CreateMessage();
}
}

View File

@ -2,6 +2,32 @@ namespace DeskHubSharp
{
public class Email
{
private string _toEmail = "wjmiller2016@gmail.com";
private string _fromEmail = "wjmiller2016@gmail.com";
private string _passwordEmail = "IhaveanAMDRX580";
public string Password
{
get { return _passwordEmail; }
set { _passwordEmail = value; }
}
public string FromEmail
{
get { return _fromEmail; }
set { _fromEmail = value; }
}
public string ToEmail
{
get { return _toEmail; }
set { _toEmail = value; }
}
public Email()
{
}
}
}

View File

@ -1 +1 @@
5fc4a31b9da29844dd7ba799c86639ce1bf7d4b0
ac6d87119126ef96a9551362a1832c83be77d6c5

View File

@ -12,7 +12,7 @@ DEBUG;TRACE
C:\Users\Wyatt\Desktop\Source\DeskHubSharp\DeskHubSharp\App.xaml
7-86569338
21133474928
22-1533856682
20415715258
AboutWindow.xaml;DetailWindow.xaml;ErrorWindow.xaml;FeedbackWindow.xaml;HelpWindow.xaml;MainWindow.xaml;SearchWindow.xaml;