Beispiel #1
0
        public ResponseViewModel Delete(int id)
        {
            var response = new ResponseViewModel();

            var maintenance = _maintenanceDal.GetMaintenance(p => p.Id == id);

            if (maintenance == null)
            {
                response.IsSuccess = false;
                response.Message   = "Maintenance bulunamadı.";
                return(response);
            }

            maintenance.IsDeleted = true;

            _maintenanceDal.Update(maintenance);
            var saving = _maintenanceDal.SaveChanges();

            if (!saving)
            {
                response.IsSuccess = false;
                response.Message   = "Maintenance silme işlemi sırasında hata oluştu.";

                return(response);
            }

            response.Data = maintenance;

            return(response);
        }
Beispiel #2
0
        private bool IsMaintenanceHave(int maintenanceId)
        {
            var maintenance = _maintenanceDal.GetMaintenance(x => x.Id == maintenanceId);

            if (maintenance == null)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }