Example #1
0
        protected void submit_Click(Object sender, EventArgs e)
        {
            DataTable data = FormGeneratorTools.GenerateFieldList(Form.Controls);

            FormGeneratorEmail email = new FormGeneratorEmail();

            email.Send(data, "Field_ID", "Field_Value", Form.ID, "",true);
        }
        private void SendDataToAprimo(bool isTest)
        {
            DataTable dtDBResults = new DataTable();
            DataTable fieldData = FormGeneratorTools.GenerateFieldList(Form.Controls);

            HiddenField hfDBResults = (HiddenField)this.Form.FindControl("hfDBResults");

            HiddenField hfCampaign = (HiddenField)this.Form.FindControl("c");
            HiddenField hfSource = (HiddenField)this.Form.FindControl("s");
            HiddenField hfPage = (HiddenField)this.Form.FindControl("_p");

            if (hfDBResults.Value != "")
                dtDBResults = DelimStringToDataTable(hfDBResults.Value);

            DataTable dtMerged = MergeDataTables(fieldData, dtDBResults);

            FormGeneratorEmail email = new FormGeneratorEmail();

            string aprimoID = this.Form.Attributes["AprimoID"].ToString();
            string subject = this.Form.Attributes["AprimoSubject"].ToString();

            if (isTest)
                email.Send(dtMerged, "Field_ID", "Field_Value", subject, aprimoID, true);
            else
                email.Send(dtMerged, "Field_ID", "Field_Value", subject, aprimoID, false);
        }