Пример #1
0
        // 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));
        }
Пример #2
0
        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));
        }