public static void Register(string email, string password) { try { MailService ms = new MailService(); ms.Email = email; ms.EmailTitle = "User registration"; ms.EmailBody = "Body of message..."; if (ms.ValidEmail() == true) { ms.SendNotification(); ms.AddNotificationToDB(); ms.ReadNotification(); } SmsService ss = new SmsService(); ss.Number = "111 111 111"; ss.SmsText = "User successfully registered..."; ss.SendNotification(); } catch (Exception ex) { throw; } }
public static void Register(string email, string password) { MailService ms = new MailService(email, "User registration", "Body of message..."); SmsService ss = new SmsService("111 111 111", "User successfully registered..."); try { if (ms.ValidEmail()) { ms.SendNotification(); } ss.SendNotification(); } catch (Exception e) { Console.WriteLine(e.Message); throw; } }