Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
0
 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!";
     }
 }