public async Task <IActionResult> Create([Bind("OrderId,UserId,LocId,Opizza1,Opizza2,Opizza3,Opizza4,Opizza5,Opizza6,Opizza7,Opizza8,Opizza9,Opizza10,Opizza11,Opizza12,TimeofOrder,OrderTotalPrice")] OrderDb orderDb)
        {
            if (ModelState.IsValid)
            {
                _context.Add(orderDb);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["LocId"]  = new SelectList(_context.LocationDb, "LocationId", "LocationId", orderDb.LocId);
            ViewData["UserId"] = new SelectList(_context.UserDb, "UserId", "UserId", orderDb.UserId);
            return(View(orderDb));
        }
Ejemplo n.º 2
0
        public void AddCustomer(Library.Customer customer)
        {
            Entities.Customer entity = Mapper.Map(customer);

            _dbContext.Add(entity);
        }
 public void AddOrder(Models.Order order)
 {
     _db.Add(Mapper.Map(order));
 }