Пример #1
0
 public static void UpdateOrder(int orderId, int foodid,
                                string size, string chilli, string salt, string pepper)
 {
     using (ShopOrders entities = new ShopOrders())
     {
         Order order = entities.Orders.Where(p => p.OrderID == orderId).First <Order>();
         order.FoodID   = foodid;
         order.FoodName = GetFood(foodid);
         order.Size     = size;
         order.Chilli   = chilli;
         order.MoreSalt = salt;
         order.Pepper   = pepper;
         entities.SaveChanges();
     }
 }
Пример #2
0
 public static void AddOrder(string user, int foodID, string foodname,
                             string size, string chilli, string salt, string pepper)
 {
     using (ShopOrders entities = new ShopOrders())
     {
         Order order = new Order
         {
             Username = user,
             FoodID   = foodID,
             FoodName = foodname,
             Size     = size,
             Chilli   = chilli,
             MoreSalt = salt,
             Pepper   = pepper
         };
         entities.Orders.Add(order);
         entities.SaveChanges();
     }
 }