public void CreatePictureProfile(PictureProfileBll profile)
        {
            if (profile == null)
                throw new ArgumentNullException("profile");

            repository.Create(profile.ToDal());
            uow.Commit();
        }
Beispiel #2
0
        public void CreatePictureProfile(PictureProfileBll profile)
        {
            if (profile == null)
            {
                throw new ArgumentNullException("profile");
            }

            repository.Create(profile.ToDal());
            uow.Commit();
        }
        public void UpdatePictureProfile(PictureProfileBll profile)
        {
            if (profile == null)
                throw new ArgumentNullException("profile");

            PictureProfileDal currentPictureProfile = profile.ToDal();
            PictureProfileDal existedPictureProfile = repository.GetById(profile.Id);
            if (existedPictureProfile == null)
                throw new EntityNotFoundException("profile", profile.Id);

            existedPictureProfile.Description = currentPictureProfile.Description;
            existedPictureProfile.PictureId = currentPictureProfile.PictureId;
            existedPictureProfile.Rating = currentPictureProfile.Rating;

            repository.Update(existedPictureProfile);
            uow.Commit();

        }
Beispiel #4
0
        public void UpdatePictureProfile(PictureProfileBll profile)
        {
            if (profile == null)
            {
                throw new ArgumentNullException("profile");
            }

            PictureProfileDal currentPictureProfile = profile.ToDal();
            PictureProfileDal existedPictureProfile = repository.GetById(profile.Id);

            if (existedPictureProfile == null)
            {
                throw new EntityNotFoundException("profile", profile.Id);
            }

            existedPictureProfile.Description = currentPictureProfile.Description;
            existedPictureProfile.PictureId   = currentPictureProfile.PictureId;
            existedPictureProfile.Rating      = currentPictureProfile.Rating;

            repository.Update(existedPictureProfile);
            uow.Commit();
        }