示例#1
0
        public ActionResult Delete(Location location)
        {
            using (EVModelEntities entities = new EVModelEntities())
            {
                Location updatedLocation = (from c in entities.Locations
                                            where c.ID == location.ID
                                            select c).FirstOrDefault();
                updatedLocation.DeleteDate = DateTime.UtcNow;
                updatedLocation.IsDeleted  = true;
                entities.SaveChanges();
            }

            return(RedirectToAction("Index"));
        }
        public ActionResult Delete(Connector connector)
        {
            using (EVModelEntities entities = new EVModelEntities())
            {
                Connector updatedConnector = (from c in entities.Connectors
                                              where c.Id == connector.Id
                                              select c).FirstOrDefault();
                updatedConnector.DeleteDate = DateTime.UtcNow;
                updatedConnector.isDeleted  = true;
                entities.SaveChanges();
            }

            return(RedirectToAction("Index"));
        }
        public ActionResult Delete(Customer customer)
        {
            using (EVModelEntities entities = new EVModelEntities())
            {
                Customer updatedCustomer = (from c in entities.Customers
                                            where c.ID == customer.ID
                                            select c).FirstOrDefault();
                updatedCustomer.DeleteDate = DateTime.UtcNow;
                updatedCustomer.IsDeleted  = true;
                entities.SaveChanges();
            }

            return(RedirectToAction("Index"));
        }