private void FormReservationDetails_Load(object sender, EventArgs e) {
   if((CurrentClient != null) && (CurrentReception != null)) {
     textBoxDate.Text = CurrentReception.ReceptionDate.ToString("dd MMMM yyyy");
     textBoxName.Text = CurrentReception.ReceptionName;
     try {
       using(ProjetSGBDEntities context = new ProjetSGBDEntities()) {
         IQueryable<GetReservedDish_Result> _reservedDishes = context.GetReservedDish(CurrentReception.ReceptionId, CurrentClient.Id);
         if(_reservedDishes.Where(dish => dish.DishTypeId == DishTypeStarter).Count() == 1) {
           _starter_old = _reservedDishes.Where(dish => dish.DishTypeId == DishTypeStarter).First();
           _starter = context.Dish.Where(dish => dish.DishId == _starter_old.DishId).First();
           textBoxStarter.Text = _starter.Name;
         }
         if(_reservedDishes.Where(dish => dish.DishTypeId == DishTypeMainDish).Count() == 1) {
           _mainCourse_old = _reservedDishes.Where(dish => dish.DishTypeId == DishTypeMainDish).First();
           _mainCourse = context.Dish.Where(dish => dish.DishId == _mainCourse_old.DishId).First();
           textBoxMainCourse.Text = _mainCourse.Name;
         }
         if(_reservedDishes.Where(dish => dish.DishTypeId == DishTypeDessert).Count() == 1) {
           _dessert_old = _reservedDishes.Where(dish => dish.DishTypeId == DishTypeDessert).First();
           _dessert = context.Dish.Where(dish => dish.DishId == _dessert_old.DishId).First();
           textBoxDessert.Text = _dessert.Name;
         }
       }
     } catch(Exception ex) {
       ModelError modelError = new ModelError(ex);
       MessageBox.Show(modelError.Message, "Erreur fatale!", MessageBoxButtons.OK, MessageBoxIcon.Error);
       DialogResult = DialogResult.Abort;
       Close();
     }
   }
 }
 public FormReservationDetails() {
   InitializeComponent();
   CurrentClient = null;
   CurrentReception = null;
   _starter = null;
   _mainCourse = null;
   _dessert = null;
   _starter_old = null;
   _mainCourse_old = null;
   _dessert_old = null;
 }
Example #3
0
 public ClientOrderToReview CreateOrderReview(Dish selectedDish, int orderSubscriptionId)
 {
     var clientOrderToReviewId = _myClientOrdersToReview.Max(c => c.ClientOrderToReviewId) + 1;
     var newClientOrderToReview = new ClientOrderToReview
     {
         ClientOrderToReviewId = clientOrderToReviewId,
         ClientId = 1,
         CookerId = selectedDish.CookerId,
         MenuId = selectedDish.MenuId,
         OrderId = orderSubscriptionId,
         OrderDate = DateTime.Today.Date,
         OrderModelTypeId = (int)OrderModelType.Values.Subscription
     };
     _myClientOrdersToReview.Add(newClientOrderToReview);
     return newClientOrderToReview;
 }
Example #4
0
 public Dish FishandSeafoodDish2()
 {
     var dish = new Dish
     {
         DishId = 33,
         MenuId = 7,
         CookerId = 3,
         SectionId = 17,
         Name = "Bhelpuri",
         Description = null,
         Price = (decimal)5.99,
         CurrencyId = 1,
         Photo = @"C:\Users\haraissia\Documents\Visual Studio 2013\Projects\PrivateChef\trunk\Test\Images\Food\Japanese\Udon.jpg",
         ServingId = 8,
         SpecialNote = ""
     };
     return dish;
 }
Example #5
0
 public Dish DailySpecialDish1()
 {
     var dish = new Dish
     {
         DishId = 23,
         MenuId = 5,
         CookerId = 2,
         SectionId = 13,
         Name = "Shawarma Laffa",
         Description = "Fire roasted marinated chicken thighs. Served with hummus.",
         Price = (decimal)12.99,
         CurrencyId = 1,
         Photo = @"C:\Users\haraissia\Documents\Visual Studio 2013\Projects\PrivateChef\trunk\Test\Images\Food\Japanese\Japanese-sushi.jpg",
         ServingId = 4,
         SpecialNote = "No Special Note"
     };
     return dish;
 }
Example #6
0
 public Dish ClassicRollsDish1()
 {
     var dish = new Dish
     {
         DishId = 14,
         MenuId = 3,
         CookerId = 2,
         SectionId = 8,
         Name = "Jumbo Sweet Shrimp",
         Description = null,
         Price = (decimal)5.99,
         CurrencyId = 1,
         Photo = @"C:\Users\haraissia\Documents\Visual Studio 2013\Projects\PrivateChef\Test\Images\Food\Italien\greek-salad.jpg",
         ServingId = 2,
         SpecialNote = ""
     };
     return dish;
 }
Example #7
0
 public Dish DailySpecialDish2()
 {
     var dish = new Dish
     {
         DishId = 24,
         MenuId = 5,
         CookerId = 2,
         SectionId = 13,
         Name = "Shawarma Bowl",
         Description = "Succulent chicken from our taboon oven. Served with hummus.",
         Price = (decimal)8.50,
         CurrencyId = 1,
         Photo = null,
         ServingId = 5,
         SpecialNote = ""
     };
     return dish;
 }
Example #8
0
 public Dish BurgersAndChickenDish1()
 {
     var dish = new Dish
     {
         DishId = 7,
         MenuId = 1,
         CookerId = 1,
         SectionId = 4,
         Name = "Lamb Turkey Kebab Pocket Combo",
         Description = "Ground turkey and lamb, marinated and grilled. Perfectly packaged in our freshly baked pitas, original or whole wheat and filled with chopped salad and hummus. Comes with your choice of side and drink.",
         Price = (decimal)10.95,
         CurrencyId = 1,
         Photo = @"C:\Users\haraissia\Documents\Visual Studio 2013\Projects\PrivateChef\trunk\Test\Images\Food\Mexican\dscn2246.jpg",
         ServingId = 8,
         SpecialNote = "Put extra lettuce"
     };
     return dish;
 }
Example #9
0
 public Dish MostPopularDish1()
 {
     var dish = new Dish
     {
         DishId = 9,
         MenuId = 3,
         CookerId = 2,
         SectionId = 6,
         Name = "Wasabi Appetizer",
         Description = "Your choice of seafood with wasabi mayo, olives, scallion sealte with house sauce.",
         Price = (decimal)12.00,
         CurrencyId = 2,
         Photo = @"C:\Users\haraissia\Documents\Visual Studio 2013\Projects\PrivateChef\trunk\Test\Images\Food\Japanese\Asian Fish.jpg",
         ServingId = 5,
         SpecialNote = "No Special Note"
     };
     return dish;
 }
Example #10
0
 public Dish MorrocanMostPopularDish3()
 {
     var dish = new Dish
     {
         DishId = 22,
         MenuId = 5,
         CookerId = 2,
         SectionId = 12,
         Name = "Steak Taboon Pita",
         Description = "Succulent steak from our taboon oven. Served with hummus.",
         Price = (decimal)5.99,
         CurrencyId = 1,
         Photo = @"C:\Users\haraissia\Documents\Visual Studio 2013\Projects\PrivateChef\trunk\Test\Images\Food\Mexican\foods_tacos.jpg",
         ServingId = 5,
         SpecialNote = null
     };
     return dish;
 }
Example #11
0
 public Dish MorrocanMostPopularDish2()
 {
     var dish = new Dish
     {
         DishId =21,
         MenuId = 5,
         CookerId = 2,
         SectionId = 12,
         Name = "Gyro Platter",
         Description = "Top quality beef and lamb. Made with authentic Greek spices. Served with hummus.",
         Price = (decimal)4.50,
         CurrencyId = 3,
         Photo = null,
         ServingId = 6,
         SpecialNote = "Put extra sauce"
     };
     return dish;
 }
Example #12
0
 public Dish MorrocanMostPopularDish1()
 {
     var dish = new Dish
     {
         DishId = 20,
         MenuId = 5,
         CookerId = 2,
         SectionId = 12,
         Name = "Falafel Bowl",
         Description = "Our chef's special recipe, with your choice of two fillings. Served with hummus.",
         Price = (decimal)12.00,
         CurrencyId = 2,
         Photo = "",
         ServingId = 5,
         SpecialNote = "No Special Note"
     };
     return dish;
 }
Example #13
0
 public Dish JamaicanMostPopularDish2()
 {
     var dish = new Dish
     {
         DishId = 17,
         MenuId = 5,
         CookerId = 2,
         SectionId = 10,
         Name = "Stuffed Pepper",
         Description = "A pepper hollowed out and then stuffed with our special blend of meat, rice, sauce and seasonings.",
         Price = (decimal)12.50,
         CurrencyId = 3,
         Photo = @"C:\Users\haraissia\Documents\Visual Studio 2013\Projects\PrivateChef\trunk\Test\Images\Food\Mexican\Enchiladas.jpg",
         ServingId = 6,
         SpecialNote = "Put extra sauce"
     };
     return dish;
 }
Example #14
0
 public DetailViewModel(Dish dish, Drink drink)
 {
     Dish  = dish;
     Drink = drink;
 }
Example #15
0
 public Dish MostPopularDish3()
 {
     var dish = new Dish
     {
         DishId = 11,
         MenuId = 3,
         CookerId = 2,
         SectionId = 6,
         Name = "Tar Tar",
         Description = "Chopped salmon or tuna with spicy sauce.",
         Price = (decimal)7.99,
         CurrencyId = 1,
         Photo = @"C:\Users\haraissia\Documents\Visual Studio 2013\Projects\PrivateChef\trunk\Test\Images\Food\Italien\romano-s-macaroni.jpg",
         ServingId = 2,
         SpecialNote = null
     };
     return dish;
 }
Example #16
0
 public Dish SoupAndSaladDish2()
 {
     var dish = new Dish
     {
         DishId = 9,
         MenuId = 1,
         CookerId = 1,
         SectionId = 5,
         Name = "Mango Vermicelli Salad",
         Description = "Includes two mini burgers. Mildly spicy.",
         Price = (decimal)8.50,
         CurrencyId = 1,
         Photo = @"C:\Users\haraissia\Documents\Visual Studio 2013\Projects\PrivateChef\trunk\Test\Images\Food\Mexican\foods_tacos.jpg",
         ServingId = 7,
         SpecialNote = "Nothing"
     };
     return dish;
 }
Example #17
0
 public Dish SignatureRollsDish2()
 {
     var dish = new Dish
     {
         DishId = 13,
         MenuId = 3,
         CookerId = 2,
         SectionId = 7,
         Name = "Any 3 Rolls Lunch Special",
         Description = "Served with miso soup or green salad.",
         Price = (decimal)8.50,
         CurrencyId = 1,
         Photo = @"C:\Users\haraissia\Documents\Visual Studio 2013\Projects\PrivateChef\trunk\Test\Images\Food\Italien\romano-s-macaroni.jpg",
         ServingId = 6,
         SpecialNote = ""
     };
     return dish;
 }
 private void UpdateDish(GetReservedDish_Result oldDish, Dish newDish) {
   using(ProjetSGBDEntities context = new ProjetSGBDEntities()) {
     if(oldDish != null) {
       if((newDish != null) && (oldDish.DishId != newDish.DishId)) {
         context.DeleteReservedDish(oldDish.ClientId, oldDish.DishId, CurrentReception.ReceptionId, oldDish.ModifiedAt);
         context.NewReservedDish(CurrentClient.Id, newDish.DishId, CurrentReception.ReceptionId, CurrentClient.Acronym);
       }
     } else {
       if(newDish != null) {
         context.NewReservedDish(CurrentClient.Id, newDish.DishId, CurrentReception.ReceptionId, CurrentClient.Acronym);
       }
     }
   }
 }
Example #19
0
 public Dish SoupAndSaladDish3()
 {
     var dish = new Dish
     {
         DishId = 10,
         MenuId = 1,
         CookerId = 1,
         SectionId = 5,
         Name = "Onion Soup",
         Description = "",
         Price = (decimal)10.00,
         CurrencyId = 1,
         Photo = @"C:\Users\haraissia\Documents\Visual Studio 2013\Projects\PrivateChef\trunk\Test\Images\Food\Mexican\mexican-food-2.jpg",
         ServingId = 4,
         SpecialNote = "In a clean bowl"
     };
     return dish;
 }
Example #20
0
 public Dish MostPopularDish1()
 {
     var dish = new Dish
     {
         DishId = 1,
         MenuId = 1,
         CookerId = 1,
         SectionId = 1,
         Name = "Chicken Roma Hot Sandwich",
         Description = "Chicken sauteed with roasted red peppers in our marinara sauce with provolone cheese. Served on fresh white Italian braided rolls topped with sesame seeds.",
         Price = (decimal)8.00,
         CurrencyId = 1,
         Photo = @"C:\Users\haraissia\Documents\Visual Studio 2013\Projects\PrivateChef\Test\Images\Food\Italien\greek-salad.jpg",
         ServingId = 8,
         SpecialNote = "No Special Note"
     };
     return dish;
 }
Example #21
0
 public Dish MostPopularDish2()
 {
     var dish = new Dish
     {
         DishId = 10,
         MenuId = 3,
         CookerId = 2,
         SectionId = 6,
         Name = "Tataki",
         Description = "Salmon or tuna with chili lime garlic sauce.",
         Price = (decimal)4.50,
         CurrencyId = 3,
         Photo = @"C:\Users\haraissia\Documents\Visual Studio 2013\Projects\PrivateChef\trunk\Test\Images\Food\Japanese\Japanese-sushi.jpg",
         ServingId = 6,
         SpecialNote = "Put extra sauce"
     };
     return dish;
 }
Example #22
0
 public Dish StartersDish1()
 {
     var dish = new Dish
     {
         DishId = 4,
         MenuId = 1,
         CookerId = 1,
         SectionId = 2,
         Name = "Shrimp Shumai",
         Description = "Includes six pieces.",
         Price = (decimal)10.00,
         CurrencyId = 1,
         Photo = @"C:\Users\haraissia\Documents\Visual Studio 2013\Projects\PrivateChef\Test\Images\Food\Italien\greek-salad.jpg",
         ServingId = 8,
         SpecialNote = "No Special Note"
     };
     return dish;
 }
Example #23
0
 public Dish SignatureSandwichesDish2()
 {
     var dish = new Dish
     {
         DishId = 19,
         MenuId = 5,
         CookerId = 2,
         SectionId = 11,
         Name = "Chef's Salad",
         Description = "Ham, turkey, cheese, lettuce, tomato, onions and pimientos.",
         Price = (decimal)7.50,
         CurrencyId = 3,
         Photo = @"C:\Users\haraissia\Documents\Visual Studio 2013\Projects\PrivateChef\trunk\Test\Images\Food\Mexican\mexican-food-2.jpg",
         ServingId = 6,
         SpecialNote = "Put extra sauce"
     };
     return dish;
 }
Example #24
0
 public Dish StartersDish2()
 {
     var dish = new Dish
     {
         DishId = 5,
         MenuId = 1,
         CookerId = 1,
         SectionId = 1,
         Name = "Spiced Filet Mignon Mini Burgers",
         Description = "Includes two mini burgers. Mildly spicy.",
         Price = (decimal)8.50,
         CurrencyId = 1,
         Photo = @"C:\Users\haraissia\Documents\Visual Studio 2013\Projects\PrivateChef\trunk\Test\Images\Food\Italien\romano-s-macaroni.jpg",
         ServingId = 8,
         SpecialNote = "Only Fresh meat"
     };
     return dish;
 }
Example #25
0
 public Dish SignatureRollsDish1()
 {
     var dish = new Dish
     {
         DishId = 12,
         MenuId = 3,
         CookerId = 2,
         SectionId = 7,
         Name = "Salmon Lover Sushi",
         Description = "Seven pieces of salmon sushi and spicy salmon roll with crunch. Served with miso soup or green salad.",
         Price = (decimal)19.00,
         CurrencyId = 1,
         Photo = @"C:\Users\haraissia\Documents\Visual Studio 2013\Projects\PrivateChef\Test\Images\Food\Italien\greek-salad.jpg",
         ServingId = 8,
         SpecialNote = "No Special Note"
     };
     return dish;
 }
Example #26
0
 public Dish SoupAndSaladDish4()
 {
     var dish = new Dish
     {
         DishId = 11,
         MenuId = 1,
         CookerId = 1,
         SectionId = 5,
         Name = "Premium Soup Medium",
         Description = "Onion, garlic, cucumber, celery, cilantro, mixed peppers, tomato puree, tomato juice, tobasco sauce and lime juice.",
         Price = (decimal)4.50,
         CurrencyId = 1,
         Photo = @"C:\Users\haraissia\Documents\Visual Studio 2013\Projects\PrivateChef\trunk\Test\Images\Food\Mexican\mexican-food.jpg",
         ServingId = 5,
         SpecialNote = "I love your soup"
     };
     return dish;
 }
Example #27
0
 public Dish SignatureSandwichesDish1()
 {
     var dish = new Dish
     {
         DishId = 18,
         MenuId = 5,
         CookerId = 2,
         SectionId = 11,
         Name = "Grilled Chicken Arugula Salad",
         Description = "Thin strips of grilled chicken breast served over an arugula salad with a honey balsamic dressing.",
         Price = (decimal)8.99,
         CurrencyId = 2,
         Photo = @"C:\Users\haraissia\Documents\Visual Studio 2013\Projects\PrivateChef\trunk\Test\Images\Food\Mexican\mexican-food-2.jpg",
         ServingId = 5,
         SpecialNote = "No Special Note"
     };
     return dish;
 }
 private void buttonStarter_Click(object sender, EventArgs e) {
   FormSelectDish form = new FormSelectDish();
   DialogResult result;
   try {
     form.PopulateList(CurrentReception.ReceptionId, DishTypeStarter, CurrentClient);
     result = form.ShowDialog();
     if((result == DialogResult.OK) && (form.SelectedDishId != null)) {
       using(ProjetSGBDEntities context = new ProjetSGBDEntities()) {
         _starter = context.Dish.Where(dish => dish.DishId == form.SelectedDishId).First();
         textBoxStarter.Text = _starter.Name;
       }
     }
   } catch(Exception ex) {
     ModelError modelError = new ModelError(ex);
     MessageBox.Show(modelError.Message, "Erreur fatale!", MessageBoxButtons.OK, MessageBoxIcon.Error);
   }
 }
Example #29
0
 public Dish EveryDaySpecialsDish2()
 {
     var dish = new Dish
     {
         DishId = 26,
         MenuId = 5,
         CookerId = 2,
         SectionId = 14,
         Name = "Corn Salad Small",
         Description = null,
         Price = (decimal)3.99,
         CurrencyId = 1,
         Photo = "",
         ServingId = 4,
         SpecialNote = ""
     };
     return dish;
 }
Example #30
0
 public Dish JamaicanMostPopularDish1()
 {
     var dish = new Dish
     {
         DishId = 16,
         MenuId = 5,
         CookerId = 2,
         SectionId = 10,
         Name = "Buffalo Chicken Sliders",
         Description = "Two mini buns with Buffalo chicken and bleu cheese, served with seasoned curly fries.",
         Price = (decimal)11.99,
         CurrencyId = 2,
         Photo = @"C:\Users\haraissia\Documents\Visual Studio 2013\Projects\PrivateChef\trunk\Test\Images\Food\Mexican\dscn2246.jpg",
         ServingId = 5,
         SpecialNote = "No Special Note"
     };
     return dish;
 }
Example #31
0
 public Dish EveryDaySpecialsDish1()
 {
     var dish = new Dish
     {
         DishId = 25,
         MenuId = 5,
         CookerId = 2,
         SectionId = 14,
         Name = "Steak Taboon Bowl",
         Description = "Succulent steak from our taboon oven. Served with hummus.",
         Price = (decimal)6.99,
         CurrencyId = 1,
         Photo = @"C:\Users\haraissia\Documents\Visual Studio 2013\Projects\PrivateChef\trunk\Test\Images\Food\Filipino\Beef-Mechado.jpg",
         ServingId = 7,
         SpecialNote = ""
     };
     return dish;
 }
Example #32
0
 //This region is used to compare id's instead of the reference identity
 protected bool Equals(Dish other)
 {
     return(Id == other.Id);
 }