Repository navigation
Expand file tree
/
Copy pathMain.cs
More file actions
56 lines (41 loc) · 1.7 KB
/
Copy pathMain.cs
File metadata and controls
56 lines (41 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
using CleanArch.Domain.Interfaces;
using CleanCodeMethods.Services;
using NotificationService;
using NotificationService.DTO;
namespace CleanArchitecture
{
public partial class Main : Form
{
INotificationService _notification;
public Main(INotificationService notification)
{
InitializeComponent();
this._notification = notification;
}
private void btn_Notification_Click(object sender, EventArgs e)
{
// Fix: Create an instance of EmailDTO with the correct properties
// but properties are readonly cannot initialize only initialize in constructor
//var email = new EmailDTO
//{
// To = "to@example.com",
// Subject = "Hello",
// Body = "Test body",
// From = "from@example.com"
//};
// Fix: Use the correct generic type for INotificationService
// Injection Dependancy Injection Manually
//INotificationService<EmailDTO> emailnotification = new EmailService();
//NotificationManager<EmailDTO> notificationManager = new NotificationManager<EmailDTO>(emailnotification);
//// Data Transfer Objects (DTOs) for Email and SMS
//EmailDTO email = new EmailDTO("abcd@gmail.com", "WHO", "Message Text", "Regards Haroon Siddique", "abcd@gmail.com");
//SMSDTO sms = new SMSDTO("0305361597", "Mesage");
//notificationManager.Notify(email);
//smsManager.SendMessage(sms);
}
private void btn_SMS_Click(object sender, EventArgs e)
{
SMSService sMSService = new SMSService();
}
}
}