예제 #1
0
 public void Remove(OrderMovie ord)
 {
     using (var client = new HttpClient())
     {
         HttpResponseMessage response =
             client.DeleteAsync(ServerAddress.Address + "ordermovie/" + ord.Id).Result;
     }
 }
예제 #2
0
 public void Add(OrderMovie om)
 {
     using (var client = new HttpClient())
     {
         HttpResponseMessage response =
             client.PostAsJsonAsync(ServerAddress.Address + "ordermovie/", om).Result;
     }
 }
예제 #3
0
 public Movie GetMovieByOrderMovie(OrderMovie om)
 {
     using (var client = new HttpClient())
     {
         HttpResponseMessage response =
             client.GetAsync(ServerAddress.Address + "MovieByOrderMovie?id="+ om.Id).Result;
         return response.Content.ReadAsAsync<Movie>().Result;
     }
 }
예제 #4
0
 public ActionResult PlaceOrder(Customer cus)
 {
     if (cus.Id == 0)
         Facade.GetInstance().GetCustomerRep().Add(cus);
     Order order = new Order() { Customer = cus, Date = DateTime.Now, OrderMovie = new List<OrderMovie>() };
     Facade.GetInstance().GetOrderRep().Add(order);
     foreach (var item in ShoppingCart.GetInstance().movies)
     {
         OrderMovie om = new OrderMovie() { Movie = item, Order = order };
         Facade.GetInstance().GetOrderMovieRep().Add(om);
     }
     ShoppingCart.GetInstance().EmptyCart();
     SetCart();
     return View();
 }