public MainWindowForm(Common.Solver solver) { InitializeComponent(); this.solver = solver; ticketService = new TicketsServiceClient(); NotificationServiceCallback notificationServiceCallback = new NotificationServiceCallback(); notificationServiceCallback.UserNotifiedEvent += UserNotified_Handler; instanceContext = new InstanceContext(notificationServiceCallback); notificationServiceClient = new NotificationServiceClient(instanceContext); try { userId = notificationServiceClient.Subscribe(); } catch { Console.WriteLine("ERROR: notificationServiceClient.Subscribe()"); } UI_Init(); }
private void LoginBtn_Click(object sender, EventArgs e) { try { Common.Solver solver = ticketService.Login(LoginUsernameTextBox.Text, LoginPasswordTextBox.Text); if (solver != null) { WelcomeWindowHelpLabel.Text = "Login sucessful!"; this.Hide(); MainWindowForm mainWindowForm = new MainWindowForm(solver); mainWindowForm.ShowDialog(); this.Close(); } else { WelcomeWindowHelpLabel.Text = "Wrong credentials!"; } } catch { WelcomeWindowHelpLabel.Text = "Error connecting with the service!"; } }