예제 #1
0
        protected void btnSend_Click1(object sender, EventArgs e)
        {
            //Event fires for sending the mail.
            //*******************************************************************************************************************
            bool sendit = true;

            //// no date selected
            //if (Calendar1.SelectedDate.Year == 0001)
            //{
            //    LabelValidDate.Visible = true;
            //    sendit = false;
            //}

            // if form entry is valid build the html files
            if (sendit)
            {
                BuildABCHTML();
            }


            // this temp to stop emails
            string email = NewformatABCHTMLText();

            bool pigscanfly = true;

            if (pigscanfly)
            {
                if (sendit)
                {
                    abcSubmit.SendMail(TextBoxEmailAddress.Text, NewformatABCHTMLText());
                }
            }

            if (sendit)
            {
                //lblMessage.ForeColor = Color.Navy;
                //lblMessage.Font.Size = 14;

                ////User information after submission.
                //lblMessage.Text = "Thank You, " + TextBoxFirstName.Text + " " + TextBoxLastName.Text + " - *Your email has been sent successfully*";

                Response.Redirect("thankyouABC.html");
            }
        }
예제 #2
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            string reviewStatus = string.Empty;

            //// no date selected
            //if (TextBoxObservationDate.Text == string.Empty)
            //{
            //    LabelValidDate.Visible = true;
            //    return;
            //}
            // use to test
            // string email = formatABCEmailMessage();

            if (Panel1.Visible == true)
            {
                BuildAZFOHTML();
                reviewStatus = getSpeciesReviewStatus();
                if (reviewStatus == "Y")
                {
                    Panel2.Visible     = true;
                    ButtonReview.Text  = "Continue";
                    ButtonExit.Visible = false;
                }
            }

            if (Panel2.Visible == true && Panel1.Visible == false)
            {
                if (RadioButtonList1.SelectedValue != "includeABCReport")
                {
                    InitialObserver.Value = String.Format("{0} {1} submitted this record via the AZFO Photo Documentation Form, but chose not to fill out the ABC Data", TextBoxFirstName.Text, TextBoxLastName.Text);
                }

                BuildABCHTML();
            }

            // temp stop email
            bool pigsfly = true;

            if (Panel1.Visible == true && pigsfly == true)
            {
                azfoSubmit.SendMail(TextBoxEmailAddress.Text);
            }

            // set AZFO Panel to false and show panel2 ABC panel
            Panel1.Visible = false;

            if (RadioButtonList1.SelectedValue == "includeABCReport" && pigsfly == true)
            {
                string formattedMessage = NewformatABCHTMLText();
                abcSubmit.SendMail(TextBoxEmailAddress.Text, formattedMessage);
            }

            // redirect to a thank you
            if (RadioButtonList1.SelectedValue == "No" || reviewStatus == "N")
            {
                Response.Redirect("thankYou.html");
            }

            // redirect to a thank you
            if (RadioButtonList1.SelectedValue == "includeABCReport")
            {
                Response.Redirect("thankYouABC.html");
            }
        }