Ejemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            CoffeeModels coffeeModels = db.CoffeeModels.Find(id);

            db.CoffeeModels.Remove(coffeeModels);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "Id,Year,Month,Day,RegularCoffee,DecafCoffee,Latte")] CoffeeModels coffeeModels)
 {
     if (ModelState.IsValid)
     {
         db.Entry(coffeeModels).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(coffeeModels));
 }
Ejemplo n.º 3
0
        // GET: Coffee/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CoffeeModels coffeeModels = db.CoffeeModels.Find(id);

            if (coffeeModels == null)
            {
                return(HttpNotFound());
            }
            return(View(coffeeModels));
        }
Ejemplo n.º 4
0
        public ActionResult Create([Bind(Include = "Id,Date,RegularCoffee,DecafCoffee,Latte")] CoffeeModels coffeeModels)
        {
            if (ModelState.IsValid)
            {
                db.CoffeeModels.Add(coffeeModels);
                DateTime Clock = DateTime.Now;
                coffeeModels.DayOfWeek = (int)Clock.DayOfWeek;
                coffeeModels.Date      = DateTime.Now.ToString("dd/MM/yyyy");
                db.SaveChanges();
                return(RedirectToAction("Stripe", "Coffee"));
            }

            return(View(coffeeModels));
        }