private void BuildABCHTML()
        {
            if (DropDownListOfSpecies.SelectedIndex == 1)
            {
                TextBoxOther.Visible = true;
                LabelOther.Visible   = true;

                speciesName = filterForFileName(TextBoxOther.Text);
                _latinName  = "Latin Name";
                _bandCode   = speciesName.Replace(' ', '_');
            }
            else
            {
                TextBoxOther.Visible = false;
                LabelOther.Visible   = false;
                speciesName          = DropDownListOfSpecies.SelectedItem.Text;
                _bandCode            = getSpeciesBandCode();
            }

            _latinName = DropDownListOfSpecies.SelectedItem.Value;
            string countyName   = County.SelectedItem.Value;
            string FirstName    = TextBoxFirstName.Text;
            string emailAddress = TextBoxEmailAddress.Text;
            string LastName     = string.Empty;

            string locationName = filterForFileName(City.Value);

            if (TextBoxOnBehalfOf.Text != string.Empty)
            {
                LastName  = TextBoxOnBehalfOf.Text.Replace(' ', '_');
                FirstName = string.Empty;
            }
            else
            {
                LastName = TextBoxLastName.Text.Replace(' ', '_');
            }

            //string date = string.Format("{0}{1}{2}", _dateOfPhoto.Year, _dateOfPhoto.Month, _dateOfPhoto.Day);

            _dateOfPhoto = Convert.ToDateTime(TextBoxObsDate.Text);

            // get the ABC Form Data

            abcSubmit = new ABCSubmit(locationName, FirstName, LastName, _dateOfPhoto, _bandCode, speciesName);

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

            saveUpLoadedFilesABC();

            abcSubmit.createWriters();

            abcSubmit.writeHeader();

            //Write the Credits
            writeABCDocumentation();

            abcSubmit.writeImageLocations(_image1, _image2, _image3, _image4);

            abcSubmit.writeFooter();

            abcSubmit.writeReturnLinks();

            abcSubmit.insertDataRecord();

            abcSubmit.closeFiles();
        }
Example #2
0
        private void BuildABCHTML()
        {
            string latinName  = DropDownListOfSpecies.SelectedItem.Value;
            string countyName = DropDownListCounty.SelectedItem.Text;

            if (CheckBoxNotPhotographer.Checked == true)
            {
                _PhotographerFirstName = TextboxPhotographersFName.Text;
                _PhotographerLastName  = TextBoxPhotographerLName.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 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;
                latinName   = "Latin Name";
                _bandCode   = speciesName.Replace(' ', '_');
            }

            // get the ABC Form Data

            abcSubmit = new ABCSubmit(locationName, _SubmitterFirstName, _SubmitterLastName, _dateOfPhoto, _bandCode, speciesName);

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

            saveUpLoadedFilesABC();

            abcSubmit.createWriters();

            abcSubmit.writeHeader();

            //Write the Credits
            writeABCDocumentation();

            abcSubmit.writeImageLocations(_image1, _image2, _image3, _image4);

            abcSubmit.writeFooter();

            abcSubmit.writeReturnLinks();

            abcSubmit.insertDataRecord();

            abcSubmit.closeFiles();
        }