public static void CreateOrder(DTO.OrderDTO orderDTO) { var db = new PapaBobsDbEntities(); var order = convertToEntity(orderDTO); db.Orders.Add(order); db.SaveChanges(); }
public static void CompleteOrder(Guid orderId) { var db = new PapaBobsDbEntities(); var order = db.Orders.FirstOrDefault(p => p.OrderId == orderId); order.Completed = true; db.SaveChanges(); }
public static void CreateOrder(DTO.OrderDTO orderDTO) { var db = new PapaBobsDbEntities(); // Call helper method to convert the order into the proper type. var order = convertToEntity(orderDTO); db.Orders.Add(order); db.SaveChanges(); }
public static void CreateOrder(DTO.OrderDTO orderDTO) { var db = new PapaBobsDbEntities(); //var order = new Order(); //order.OrderId = Guid.NewGuid(); //order.Size = 1; //order.Crust = 0; //order.Pepperoni = true; //order.Name = "Test"; //order.Address = "123 Elm"; //order.ZipCode = "12345"; //order.Phone = "555-5555"; //order.PaymentType = 0; //order.TotalCost = 16.50M; db.Orders.Add((Order)convertToEntity((OrderDTO)orderDTO)); db.SaveChanges(); }