private async void setCustomerAndRestaurantFields() { customer = await db.GetCustomer(order.CustomerID); Restaurant restaurant = await db.GetRestaurant(order.RestaurantID); if (customer == null) { nameLabel.Text = order.CustomerID; } else { nameLabel.Text = customer.Name; } estimatedDeliveryButton.Value = restaurant.DeliveryTime; order.EstimatedDeliveryTime = restaurant.DeliveryTime; }
async private void restaurantLogin() { Restaurant passChecker = new Restaurant(); passChecker = await loginer.GetRestaurant(lUsernameTextBox.Text); if (passChecker != null && passChecker.Password == lPasswordTextBox.Text) { //MessageBox.Show("Sikeres bejelentkezés!\nID: " + passChecker.RestaurantID, "Infó"); this.Hide(); RestaurantFoodListing main = new RestaurantFoodListing(ref passChecker); main.Show(); // TODO: Átvitel fő felületre } else { courierLogin(); } }
async private void button2_Click(object sender, EventArgs e) { if (checkRestaurantFields()) { Restaurant newRestaurant = await db.GetRestaurant(rUsername.Text); if (newRestaurant == null) { newRestaurant = new Restaurant(); newRestaurant.RestaurantID = rUsername.Text; newRestaurant.RestaurantName = rName.Text; newRestaurant.Password = rPassword.Text; newRestaurant.OpenTime = rOpening.Text; newRestaurant.CloseTime = rClosing.Text; newRestaurant.DeliveryTime = Convert.ToInt32(rDeliveryTime.Text); Location newLocation = new Location(); newLocation.City = rCity.Text; newLocation.Street = rStreet.Text; newLocation.HouseNumber = Convert.ToInt32(rHouseNumber.Text); newRestaurant.Address = newLocation; await db.AddRestaurant(newRestaurant); //MessageBox.Show("Sikeres regisztráció!", "Infó"); this.Close(); } else { MessageBox.Show("A felhasználónév foglalt!", "Infó"); } } else { MessageBox.Show("Kérem tölsön ki minden mezőt!", "Infó"); } }