Beispiel #1
0
        private void UploadList_Btn_Click(object sender, EventArgs e)
        {
            string Adress;

            if (UploadAddresses.ShowDialog() == DialogResult.Cancel)
            {
                return;
            }
            else
            {
                try
                {
                    Adress = UploadAddresses.FileName;
                    ReadFile(Adress);
                    MessageBox.Show($"Найдено адресов: {Getter_adresses.Count}");
                }
                catch (NullReferenceException nex)
                {
                    MessageBox.Show("Процесс считывания был прерван!", "Внимание", MessageBoxButtons.OK,
                                    MessageBoxIcon.Exclamation);
                }
            }
        }
        /// <summary>
        /// Gets the upload URL.
        /// </summary>
        /// <returns>
        /// The Response
        /// </returns>
        public async Task<UploadAddresses> UploadUrls()
        {
            var uploadAddress = new UploadAddresses();
            var guestResponse = this.personRepository.RetrieveGuestUploadsUrls();
            var crewResponse = this.personRepository.RetrieveCrewUploadsUrls();
            var visitorResponse = this.personRepository.RetrieveVisitorUploadsUrls();
            await Task.WhenAll(guestResponse, crewResponse, visitorResponse);

            uploadAddress.CrewmembersSecurityPhotoUploadAddress = crewResponse.Result.SecurityPhotoUploadAddress;
            uploadAddress.GuestSecurityPhotoUploadAddress = guestResponse.Result.SecurityPhotoUploadAddress;
            uploadAddress.VisitorSecurityPhotoUploadAddress = visitorResponse.Result.SecurityPhotoUploadAddress;

            return uploadAddress;
        }