Пример #1
0
 public ReservationForm(User user, RestaurantForm restaurantForm)
 {
     this.user           = user;
     this.service        = restaurantForm.service;
     this.restaurantForm = restaurantForm;
     InitializeComponent();
 }
Пример #2
0
 public ReservationForm(Reservation reservation, User user, RestaurantForm restaurantForm)
 {
     this.user           = user;
     this.service        = restaurantForm.service;
     this.reservation    = reservation;
     this.restaurantForm = restaurantForm;
     InitializeComponent();
     this.Text = "Edit Reservation";
     this.firstNameTextbox.Text         = reservation.FirstName;
     this.lastNameTextbox.Text          = reservation.LastName;
     this.PhoneTextbox.Text             = reservation.PhoneNumber;
     this.PartySizeTextbox.Text         = reservation.PartySize.ToString();
     this.reservationDatepicker.Value   = reservation.ReservationDate;
     this.reservationHourTextbox.Text   = reservation.ReservationTime.Hours.ToString();
     this.reservationMinuteTextbox.Text = reservation.ReservationTime.Minutes.ToString();
     this.descriptionTextbox.Text       = reservation.ReservationDetails;
     this.submitButton.Text             = "Edit";
     this.deleteButton.Visible          = true;
 }
Пример #3
0
        private void loginButton_Click(object sender, EventArgs e)
        {
            loginSpinner.Visible = true;
            string username        = this.usernameTextbox.Text;
            string password        = this.passwordTextbox.Text;
            string serviceResponse = service.Login(username, password);

            if (serviceResponse != null)
            {
                loginSpinner.Visible = false;
                User           user           = JsonConvert.DeserializeObject <User>(serviceResponse);
                RestaurantForm restaurantForm = new RestaurantForm(user, service);
                restaurantForm.Show();
                this.Hide();
            }
            else
            {
                statusLabel.Text      = "Wrong Username or Password";
                statusLabel.ForeColor = Color.Red;
                statusLabel.Visible   = true;
                loginSpinner.Visible  = false;
            }
        }