예제 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            TrashE employee = db.TrashE.Find(id);

            db.TrashE.Remove(employee);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #2
0
        public ActionResult Create([Bind(Include = "Name, ZipCode")] TrashE employee)
        {
            string currentUserId = User.Identity.GetUserId();

            employee.ApplicationUserId = currentUserId;
            db.TrashE.Add(employee);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #3
0
        // GET: TrashCs
        public ActionResult Index(TrashE e)
        {
            //var customer = db.TrashC.Where(c => c.Days == e.Days ).ToList();
            //return View(customer);

            var customers = db.TrashC.ToList();

            return(View(customers));
        }
예제 #4
0
        // GET: TrashEs/Delete/5
        public ActionResult Delete(int id)
        {
            TrashE employee = db.TrashE.Find(id);

            if (employee == null)
            {
                return(HttpNotFound());
            }
            return(View(employee));
        }
예제 #5
0
 public ActionResult Edit(TrashE employee)
 {
     if (ModelState.IsValid)
     {
         db.Entry(employee).State = System.Data.Entity.EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(employee));
 }
예제 #6
0
        // GET: TrashEs/Edit/5
        public ActionResult Edit(int id)
        {
            TrashE employee = db.TrashE.Find(id);

            return(View(employee));
        }