public string deleteCustomer(int Id)
        {
            var entity = _dbContext.Customers.Find(Id);

            if (entity != null)
            {
                var entities = _dbContext.Entry(entity);
                entities.State = EntityState.Deleted;
                _dbContext.SaveChanges();
                return("");
            }
            return("");
        }
예제 #2
0
        public string deleteVehicle(int Id)
        {
            var entity = _dbcontext.Vehicles.Find(Id);

            if (entity != null)
            {
                var entities = _dbcontext.Entry(entity);
                entities.State = System.Data.Entity.EntityState.Deleted;
                _dbcontext.SaveChanges();
                return("");
            }
            return("");
        }
예제 #3
0
 public bool deleteBooking(int Id)
 {
     try
     {
         var entity = _dbcontext.AppointBookings.Find(Id);
         if (entity.Status != null)
         {
             var entities = _dbcontext.Entry(entity);
             entities.State = EntityState.Deleted;
             _dbcontext.SaveChanges();
             return(true);
         }
     }
     catch (Exception)
     {
         // return false;
     }
     return(false);
 }