Exemplo n.º 1
0
 private void showTripsDialog(TouristAttractions.model.AgencyUser agencyUser)
 {
     try
     {
         tripsForm.SetAgencyUser(agencyUser);
         tripsForm.Show();
         tripsForm.updateRows();
         tripsForm.update();
     }
     catch (Exception e)
     {
         MessageBox.Show(e.Message, "Error");
     }
 }
Exemplo n.º 2
0
        private void loginButton_Click(object sender, EventArgs e)
        {
            TouristAttractions.model.AgencyUser agencyUser = new TouristAttractions.model.AgencyUser(-1, usernameTextBox.Text, passwordTextBox.Text);

            clientController.Login(agencyUser);

            TouristAttractions.model.AgencyUser searchedAgencyUser = clientController.SearchAgencyUserByUserNameAndPassword(usernameTextBox.Text, passwordTextBox.Text);

            if (searchedAgencyUser != null)
            {
                clientController.server.addObserver(port);
                showTripsDialog(searchedAgencyUser);
            }
            else
            {
                MessageBox.Show("This Agency User doesn't exist!", "Error");
            }
        }