Exemplo n.º 1
0
 public ActionResult DeleteEmployee(int Id, int uId)
 {
     WeedHackersContext
     .Users
     .Single(u => u.Id == Id)
     .Deleted = true;
     WeedHackersContext.SaveChanges();
     WeedHackersContext
     .Users
     .Single(u => u.Id == uId)
     .Deleted = true;
     return(RedirectToAction("AllEmployees", "Admin"));
 }
Exemplo n.º 2
0
        public ActionResult DeleteCustomer(int cId, int uId)
        {
            WeedHackersContext
            .Customers
            .Single(u => u.Id == cId)
            .Deleted = true;

            WeedHackersContext
            .Users
            .Single(u => u.Id == uId)
            .Deleted = true;

            WeedHackersContext.SaveChanges();
            return(RedirectToAction("AllCustomers", "Admin"));
        }