private Orden findOrder(int orderID) { using (BDRestauranteProyectoLenguajesEntities db = new BDRestauranteProyectoLenguajesEntities()) { return(db.Orden.Find(orderID)); } }
public void returnLastOrder(int orderID, int state) { using (BDRestauranteProyectoLenguajesEntities db = new BDRestauranteProyectoLenguajesEntities()) { db.PROC_CHANGE_STATE(orderID, state); } }
// 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()); } }
public void deliverOrder(int orderID) { using (BDRestauranteProyectoLenguajesEntities db = new BDRestauranteProyectoLenguajesEntities()) { db.PROC_CHANGE_STATE(orderID, 5); } }
// kitchen orders public List <PROC_KITCHEN_ORDERS_Result> LoadKitchenOrders() { using (BDRestauranteProyectoLenguajesEntities db = new BDRestauranteProyectoLenguajesEntities()) { return(db.PROC_KITCHEN_ORDERS(1).ToList()); } }
// 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()); } }
// 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()); } }
// 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()); } }
/*CRUD Users Finish*/ public void changeStateOrder(int ordenID, int stateID) { using (BDRestauranteProyectoLenguajesEntities db = new BDRestauranteProyectoLenguajesEntities()) { db.PROC_CHANGE_STATE(ordenID, stateID); } }
public void changeStateOrder(HistoricoCambioEstadoOrden estado) { using (BDRestauranteProyectoLenguajesEntities db = new BDRestauranteProyectoLenguajesEntities()) { db.HistoricoCambioEstadoOrden.Add(estado); db.SaveChanges(); } }
public List <Orden> ordersTable() { using (BDRestauranteProyectoLenguajesEntities db = new BDRestauranteProyectoLenguajesEntities()) { return(db.Orden.ToList()); //return ToDataTable(db.Orden.ToList()); } }
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); } } }
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(); } }
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(); } }