Пример #1
0
 private Orden findOrder(int orderID)
 {
     using (BDRestauranteProyectoLenguajesEntities db = new BDRestauranteProyectoLenguajesEntities())
     {
         return(db.Orden.Find(orderID));
     }
 }
Пример #2
0
 public void returnLastOrder(int orderID, int state)
 {
     using (BDRestauranteProyectoLenguajesEntities db = new BDRestauranteProyectoLenguajesEntities())
     {
         db.PROC_CHANGE_STATE(orderID, state);
     }
 }
Пример #3
0
 // email - date - state
 public List <PROC_FILTER_ORDERS_BY_EMAIL_DATE_STATE_Result> FilterByEmail_Date_State(String email, DateTime firstDate, DateTime secondDate, int state)
 {
     using (BDRestauranteProyectoLenguajesEntities db = new BDRestauranteProyectoLenguajesEntities())
     {
         return(db.PROC_FILTER_ORDERS_BY_EMAIL_DATE_STATE(email, firstDate, secondDate, state).ToList());
     }
 }
Пример #4
0
 public void deliverOrder(int orderID)
 {
     using (BDRestauranteProyectoLenguajesEntities db = new BDRestauranteProyectoLenguajesEntities())
     {
         db.PROC_CHANGE_STATE(orderID, 5);
     }
 }
Пример #5
0
 // kitchen orders
 public List <PROC_KITCHEN_ORDERS_Result> LoadKitchenOrders()
 {
     using (BDRestauranteProyectoLenguajesEntities db = new BDRestauranteProyectoLenguajesEntities())
     {
         return(db.PROC_KITCHEN_ORDERS(1).ToList());
     }
 }
Пример #6
0
 // only state
 public List <PROC_FILTER_ORDERS_BY_STATE_Result> FilterByState(int state)
 {
     using (BDRestauranteProyectoLenguajesEntities db = new BDRestauranteProyectoLenguajesEntities())
     {
         return(db.PROC_FILTER_ORDERS_BY_STATE(state).ToList());
     }
 }
Пример #7
0
 // only date
 public List <PROC_FILTER_ORDERS_BY_DATE_Result> FilterByDate(DateTime firstDate, DateTime secondDate)
 {
     using (BDRestauranteProyectoLenguajesEntities db = new BDRestauranteProyectoLenguajesEntities())
     {
         return(db.PROC_FILTER_ORDERS_BY_DATE(firstDate, secondDate).ToList());
     }
 }
Пример #8
0
 // only email
 public List <PROC_FILTER_ORDERS_BY_EMAIL_Result> FilterByEmail(String email)
 {
     using (BDRestauranteProyectoLenguajesEntities db = new BDRestauranteProyectoLenguajesEntities())
     {
         return(db.PROC_FILTER_ORDERS_BY_EMAIL(email).ToList());
     }
 }
Пример #9
0
        /*CRUD Users Finish*/



        public void changeStateOrder(int ordenID, int stateID)
        {
            using (BDRestauranteProyectoLenguajesEntities db = new BDRestauranteProyectoLenguajesEntities())
            {
                db.PROC_CHANGE_STATE(ordenID, stateID);
            }
        }
Пример #10
0
 public void changeStateOrder(HistoricoCambioEstadoOrden estado)
 {
     using (BDRestauranteProyectoLenguajesEntities db = new BDRestauranteProyectoLenguajesEntities())
     {
         db.HistoricoCambioEstadoOrden.Add(estado);
         db.SaveChanges();
     }
 }
Пример #11
0
 public List <Orden> ordersTable()
 {
     using (BDRestauranteProyectoLenguajesEntities db = new BDRestauranteProyectoLenguajesEntities())
     {
         return(db.Orden.ToList());
         //return ToDataTable(db.Orden.ToList());
     }
 }
Пример #12
0
 public void setTimesToOrders(List <int> numOrders)
 {
     using (BDRestauranteProyectoLenguajesEntities db = new BDRestauranteProyectoLenguajesEntities())
     {
         foreach (int orderID in numOrders)
         {
             db.PROC_SET_TIMES_TO_ORDERS(orderID, System.DateTime.Now);
         }
     }
 }
Пример #13
0
 public void addOrder(Orden newOrder, List <LineaOrden> orderLines)
 {
     using (BDRestauranteProyectoLenguajesEntities db = new BDRestauranteProyectoLenguajesEntities())
     {
         db.Orden.Add(newOrder);
         db.SaveChanges();
         foreach (LineaOrden line in orderLines)
         {
             db.LineaOrden.Add(line);
         }
         db.SaveChanges();
     }
 }
Пример #14
0
 public void addOrder(String email, Decimal total, List <LineaOrden> orderLines)
 {
     using (BDRestauranteProyectoLenguajesEntities db = new BDRestauranteProyectoLenguajesEntities())
     {
         ObjectParameter ob = new ObjectParameter("ordenID", typeof(int));
         db.PROC_AGREGAR_ORDEN(email, System.DateTime.Now, total, ob);
         int orderID = (int)ob.Value;
         foreach (LineaOrden line in orderLines)
         {
             line.OrdenID = orderID;
             db.LineaOrden.Add(line);
         }
         db.SaveChanges();
     }
 }