Ejemplo n.º 1
0
        public ActionResult Create1(int id, int storeid, int localid, Orderedpizzas ordpizz)
        {
            storeid = storeidy;
            id      = idy;
            localid = localidy;
            try
            {
                DateTime newtime = DateTime.Now;

                PizzaWebApp.Models.Orderdetails neworder = new PizzaWebApp.Models.Orderdetails()
                {
                    Customerid = id,
                    Storeid    = storeid,
                    Locationid = localid,
                    Dateplaced = newtime,
                    Totalcost  = ordpizz.Pizzascost,
                };
                Repo.Createorder(neworder);
                PizzaWebApp.Models.Orderdetails order = Repo.Getorderbytime(newtime);
                ordpizz.Orderid = order.Orderid;
                Repo.Createpizzaorder(ordpizz);

                return(RedirectToAction(nameof(Index)));
            }
            catch
            {
                return(View());
            }
        }
Ejemplo n.º 2
0
 public static Data.Orderdetails TimeorderMap(Mods.Orderdetails order) => new Data.Orderdetails
 {
     Orderid    = order.Orderid,
     Customerid = order.Customerid,
     Storeid    = order.Storeid,
     Locationid = order.Locationid,
     Totalcost  = order.Totalcost,
     Dateplaced = order.Dateplaced,
 };
Ejemplo n.º 3
0
 public static Data.Orderdetails CustomdetsMap(Mods.Orderdetails dets) => new Data.Orderdetails
 {
     Orderid    = dets.Orderid,
     Customerid = dets.Customerid,
     Storeid    = dets.Storeid,
     Locationid = dets.Locationid,
     Totalcost  = dets.Totalcost,
     Dateplaced = dets.Dateplaced,
 };
Ejemplo n.º 4
0
 public static Data.Orderdetails Map(PizzaWebApp.Models.Orderdetails orderdetails) => new Data.Orderdetails
 {
     Orderid       = orderdetails.Orderid,
     Customerid    = orderdetails.Customerid,
     Storeid       = orderdetails.Storeid,
     Locationid    = orderdetails.Locationid,
     Totalcost     = orderdetails.Totalcost,
     Dateplaced    = orderdetails.Dateplaced,
     Customer      = CustomMap(orderdetails.Customer),
     Location      = Map(orderdetails.Location),
     Store         = Map(orderdetails.Store),
     History       = Map(orderdetails.History).ToList(),
     Ordereddrinks = Map(orderdetails.Ordereddrinks).ToList(),
     Orderedpizzas = Map(orderdetails.Orderedpizzas).ToList(),
     Orderedsides  = Map(orderdetails.Orderedsides).ToList(),
 };
Ejemplo n.º 5
0
 public void Createorder(Mods.Orderdetails order)
 {
     _db.Add(CreateMap(order));
     Save();
 }