public void Delete(int id) { var order = new OrderDa(databasecontext); if (id > 0) { var currentOrder = GetById(id); order.Delete(currentOrder); } }
public Order Save(int id, string OrderNumber, OrderStatus Status, DateTime DateTime) { var order = id > 0 ? GetById(id) : new Order(); order.OrderNumber = OrderNumber; order.Status = (int)Status; order.DateTime = DateTime; var orderDa = new OrderDa(databasecontext); //if new if (id < 1) order = orderDa.Add(order); //update else order = orderDa.Update(order); return order; }
public void SetDispatched(Order order) { var orderDa = new OrderDa(databasecontext); order.Status = (int)OrderStatus.Dispatched; orderDa.Update(order); }
public void SetReady(Order order) { var orderDa= new OrderDa(databasecontext); order.Status = (int)OrderStatus.Ready; orderDa.Update(order); }