public ActionResult OrderPizza(IFormCollection collection, PizzaWebApp.Models.Orderpizza op) { Domain.Orderpizza dmc = new Domain.Orderpizza(); dmc.orderid = op.orderid; dmc.locationfid_op = Int32.Parse(TempData["id"].ToString()); dmc.userFID = Int32.Parse(TempData["userid"].ToString()); dmc.Timecheck = op.Timecheckdefault; //dmc.Timecheckdefault = op.Timecheckdefault; TempData.Keep("userId"); TempData.Keep("id"); try { if (TempData["userid"] != null) { // if (((DateTime)op.Timecheckdefault - (DateTime)op.Timecheck).Hours < 24) //{ db2.AddOrder(dmc); db2.Save(); TempData.Keep("userId"); return(RedirectToAction("Index")); //} // else // { //TempData.Keep(); //return View(); // } } else { TempData.Keep(); return(View()); } } catch { return(View()); } }
public void RemoveOrder(Domain.Orderpizza order) { _db.Orderpizza.Remove(Mapper.Map(order)); }
public void UpdateOrder(Domain.Orderpizza order) { _db.Orderpizza.Update(Mapper.Map(order)); }
public void AddOrder(Domain.Orderpizza order) { _db.Orderpizza.Add(Mapper.Map(order)); }