// GET: EoDLunch/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } EoDLunchModels eoDLunchModels = db.EoDLunchModels.Find(id); if (eoDLunchModels == null) { return(HttpNotFound()); } return(View(eoDLunchModels)); }
public ActionResult Create([Bind(Include = "Date,ChefSalad,CranSalad,CaeserSalad,RanchDressingCup,BalsamicDressingCup,Tuna,ChickenSaladSam,ColdItalian,BuffaloRanch,BuffaloBleu,TurkeyClub,BLTCClub,PortabelloWrap,GrilledCheese,TurkeyApple,HamCheese,BLTCWrap")] EoDLunchModels eoDLunchModels) { if (ModelState.IsValid) { db.EoDLunchModels.Add(eoDLunchModels); DateTime Clock = DateTime.Now; eoDLunchModels.DayOfWeek = (int)Clock.DayOfWeek; eoDLunchModels.DaysWeather = WeatherAPI.CallAPICurrentWeather(); eoDLunchModels.Date = DateTime.Now.ToString("dd/MM/yyyy"); db.SaveChanges(); return(RedirectToAction("EmployeeTools", "Home")); } return(View(eoDLunchModels)); }