Exemplo n.º 1
0
        private void saveUpLoadedFilesABC()
        {
            string locationName = filterForFileName(TextBoxShortLocation.Text);
            string FirstName    = TextBoxFirstName.Text;
            string LastName     = TextBoxLastName.Text.Replace(' ', '_');
            string date         = _dateOfPhoto.ToString("dd_MMMM_yyyy");

            String[] allowedExtensions = { ".gif", ".png", ".jpeg", ".jpg", ".bmp" };
            String[] fileIncrement     = { "a", "b", "c", "d" };
            char     delimiterChars    = '.';

            azfoSubmit = new AZFOSubmit(locationName, FirstName, LastName, date, _bandCode, speciesName);

            string fromfile1 = azfoSubmit.getFileName;

            foreach (string increment in fileIncrement)
            {
                foreach (string ext in allowedExtensions)
                {
                    string fromfilename1FullPath = string.Format("{0}{1}_{2}{3}", azfoSubmit.getImagePath, fromfile1, increment, ext);

                    FileInfo f = new FileInfo(fromfilename1FullPath);
                    if (f.Exists)
                    {
                        string tofilename1FullPath = string.Format("{0}{1}", abcSubmit.getImagePath, f.Name);
                        File.Copy(fromfilename1FullPath, tofilename1FullPath, true);
                        if (increment == "a")
                        {
                            _image1 = string.Format("<p><img src='../submittedImages/{0}' border='0' align='bottom' width ='850'></p>", f.Name);
                        }
                        if (increment == "b")
                        {
                            _image2 = string.Format("<p><img src='../submittedImages/{0}' border='0' align='bottom' width ='850'></p>", f.Name);
                        }
                        if (increment == "c")
                        {
                            _image3 = string.Format("<p><img src='../submittedImages/{0}' border='0' align='bottom' width ='850'></p>", f.Name);
                        }
                        if (increment == "d")
                        {
                            _image4 = string.Format("<p><img src='../submittedImages/{0}' border='0' align='bottom' width ='850'></p>", f.Name);
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void BuildAZFOHTML()
        {
            string latinName  = DropDownListOfSpecies.SelectedItem.Value;
            string countyName = DropDownListCounty.SelectedItem.Text;

            if (CheckBoxNotPhotographer.Checked == true)
            {
                _PhotographerFirstName = TextboxPhotographersFName.Text;
                _PhotographerLastName  = TextBoxPhotographerLName.Text.Replace(' ', '_');
                _SubmitterFirstName    = TextBoxFirstName.Text;
                _SubmitterLastName     = TextBoxLastName.Text.Replace(' ', '_');
            }
            else
            {
                _PhotographerFirstName = TextBoxFirstName.Text;
                _PhotographerLastName  = TextBoxLastName.Text;
                _SubmitterFirstName    = TextBoxFirstName.Text;
                _SubmitterLastName     = TextBoxLastName.Text.Replace(' ', '_');
            }

            //string FirstName = TextBoxFirstName.Text;
            string emailAddress = TextBoxEmailAddress.Text;

            string locationName     = filterForFileName(TextBoxShortLocation.Text);
            string locationLongName = TextBoxLocationName.Text;

            //string LastName = TextBoxLastName.Text.Replace(' ', '_');
            //string date = string.Format("{0}{1}{2}", _dateOfPhoto.Year, _dateOfPhoto.Month, _dateOfPhoto.Day);

            _dateOfPhoto = Convert.ToDateTime(TextBoxObservationDate.Text.Trim());
            string date = _dateOfPhoto.ToString("dd_MMMM_yyyy");

            //LabelValidDate.Visible = false;

            if (TextBoxOther.Text == string.Empty)
            {
                speciesName = DropDownListOfSpecies.SelectedItem.Text;
                _bandCode   = getSpeciesBandCode();
            }
            else
            {
                speciesName = TextBoxOther.Text.Replace("'", "_");
                latinName   = "Latin Name";
                _bandCode   = speciesName.Replace(' ', '_');
            }

            azfoSubmit = new AZFOSubmit(locationName, _SubmitterFirstName, _SubmitterLastName, date, _bandCode, speciesName);

            _nameAndLocation = string.Format("<h3> {0} <i>({1})</i>, {2}, {3} County</h3>", speciesName, latinName, locationLongName, countyName);
            _credits         = string.Format("<p><i>{0}, photo by {1} {2}</i></p>", _dateOfPhoto.ToString("dd MMMM yyyy"), _PhotographerFirstName, _PhotographerLastName) + '\n';

            saveUpLoadedFilesAZFO();

            azfoSubmit.createWriters();

            azfoSubmit.writeHeader();

            //Write the Credits
            writeCredits();

            azfoSubmit.writeFooter();

            azfoSubmit.writeReturnLinks();

            azfoSubmit.closeFiles();
        }