Beispiel #1
0
 public Tuple <bool, string> AddOrUpdateSettings(Settings settings)
 {
     try
     {
         _unitOfWork.BeginTransaction();
         _settingsRepository.AddOrUpdate(settings);
         var uv = _universityRepository.Find(q => q.Id == settings.UniversityId);
         uv.Name    = settings.University.Name;
         uv.Address = settings.University.Address;
         uv.Logo    = settings.University.Logo;
         _universityRepository.Update(uv);
         _unitOfWork.SaveChanges();
         _unitOfWork.CommitTransaction();
         return(new Tuple <bool, string>(true, "عملیات ثبت شد"));
     }
     catch (Exception ex)
     {
         _unitOfWork.Rollback();
         return(new Tuple <bool, string>(false, "خطا در انجام عملیات"));
     }
 }