コード例 #1
0
        public ResponseViewModel Delete(int id)
        {
            var response = new ResponseViewModel();

            var maintenanceHistory = _maintenanceHistoryDal.GetMaintenanceHistory(p => p.Id == id);

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

            maintenanceHistory.IsDeleted = true;

            _maintenanceHistoryDal.Update(maintenanceHistory);
            var saving = _maintenanceHistoryDal.SaveChanges();

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

                return(response);
            }

            response.Data = maintenanceHistory;

            return(response);
        }
コード例 #2
0
 public IResult Update(MaintenanceHistory maintenanceHistory)
 {
     _maintenanceHistoryDal.Update(maintenanceHistory);
     return(new SuccessResult(Messages.Updated));
 }