Ejemplo n.º 1
0
        private void SaveHostImages(OrganizationRoleUser organizationRoleUser)
        {
            var hostImagesToSave = new List <HostImage>();

            int counter = 1;

            counter = UploadHostImage(HostImageUploader1, counter, hostImagesToSave);
            counter = UploadHostImage(HostImageUploader2, counter, hostImagesToSave);
            counter = UploadHostImage(HostImageUploader3, counter, hostImagesToSave);
            counter = UploadHostImage(HostImageUploader4, counter, hostImagesToSave);
            counter = UploadHostImage(HostImageUploader5, counter, hostImagesToSave);

            hostImagesToSave.ForEach(hostImage =>
            {
                hostImage.UploadedBy = organizationRoleUser;
                hostImage.UploadedOn = DateTime.Now;
            });

            IHostRepository hostRepository = new HostRepository();

            if (hostImagesToSave.Count > 0)
            {
                hostRepository.SaveHostImages(HostId, hostImagesToSave);
            }
        }