Esempio n. 1
0
        //Submits the contents of the form to Samanage
        public void SubmitForm(object sender, EventArgs e)
        {
            FormData formData = new FormData();

            formData.Fill(locDDList.SelectedItem.Text, Convert.ToInt32(FP_Radio.SelectedValue), CustEmail.Text, dateTextBox.Text,
                          originList.SelectedItem.Text, Server.HtmlEncode(originTxtBox.Text), dispList.SelectedItem.Text, dispDetails.SelectedItem.Text, Server.HtmlEncode(commentBox.Text),
                          CustName.Text, ReservationTextBox.Text, FPTier: FPTier.SelectedValue, FPNumber: FPIDTxtBox.Text,
                          websiteAccess: webAccessRadioButtonList.SelectedValue, ParkingType: parkingDDL.SelectedValue);
            JObject body = formData.FormatJSON("Web Complaint");

            if (SamanageConnectAPI.PostToSamanage(body))
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "MyScript", "alert('Form Submitted Successfully!'); window.location ='WebComplaint.aspx'", true);
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "MyScript", "alert('Form Failed to Submit. Please try again.')", true);
            }
        }