Exemple #1
0
        protected void btnAddAction_Click(object sender, EventArgs e)
        {
            if (ddlActions.SelectedIndex > 0)
            {
                string pageControlID = hfPageControlID_Action_ForEdit.Value;
                FormGeneratorData data = new FormGeneratorData();

                data.AddControlAction(pageControlID, ddlActions.SelectedValue);

                rptrActions.DataSource = data.GetControlActionsByPageControl_ID(pageControlID);
                rptrActions.DataBind();

                if (ddlPages.SelectedIndex != 0)
                {
                    if (data.DoesPagehaveECASControlAction(ddlPages.SelectedValue))
                        pnlReturnURL.Visible = true;
                }
            }
        }
Exemple #2
0
        protected void rptrPageControls_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            FormGeneratorData data = new FormGeneratorData();
            HiddenField hf = (HiddenField)e.Item.FindControl("hidPageControlID");
            DataTable dtProperties = data.GetPageControlPropertyValuesByPageControl_ID(hf.Value);

            if (dtProperties.Rows.Count > 0)
            {
                if (dtProperties.Rows[0]["ControlList_Name"].ToString() == "Content Block")
                {
                    pnlEditActions.Visible = false;
                    pnlAddEditDropdown.Visible = false;
                    pnlAddEditTextBox.Visible = false;
                    pnlAddEditContentBlock.Visible = true;
                    pnlAddSubmitButton.Visible = false;
                    btnAdd.Visible = true;

                    txtRTE.Text = dtProperties.Rows[0]["SettingValue"].ToString();
                    btnRTECancel.Visible = true;
                    btnUpdateRTE.Visible = true;

                }
                else if (dtProperties.Rows[0]["ControlList_Name"].ToString() == "Submit")
                {
                    pnlEditActions.Visible = false;
                    pnlAddEditDropdown.Visible = false;
                    pnlAddEditTextBox.Visible = false;
                    pnlAddEditContentBlock.Visible = false;
                    pnlAddSubmitButton.Visible = true;
                    btnAdd.Visible = true;

                    txtButtonText.Text = dtProperties.Rows[0]["SettingValue"].ToString();
                }

                hfPageControlSetting_ID.Value = dtProperties.Rows[0]["PageControlSetting_ID"].ToString();
                hfControlListID_ForEdit.Value = dtProperties.Rows[0]["ControlList_ID"].ToString();
                hfPageControlID_ForEdit.Value = dtProperties.Rows[0]["PageControl_ID"].ToString();
            }

            if (e.CommandName.ToString() == "delete")
            {
                data.RemovePageControl(e.CommandArgument.ToString());
                LoadDropdown(ddlControlList, data.GetAvalableControlsByPage_ID(ddlPages.SelectedValue), "name", "controllist_id", "Select Field");

                pnlControlList.Visible = true;
                btnAdd.Visible = true;
                pnlAddEditDropdown.Visible = false;
                pnlAddEditContentBlock.Visible = false;
                pnlAddEditTextBox.Visible = false;
                pnlAddSubmitButton.Visible = false;

                LogMessage("Deleted Field From Form.");
            }
            else // Edit
            {

                pnlControlList.Visible = false;

                DataTable dtControlInfo = data.GetControlInfoByPageControl_ID(hf.Value);
                string controlType = dtControlInfo.Rows[0]["ControlType"].ToString();

                if (controlType == "TextBox" || controlType == "Multi-line")
                {
                    pnlEditActions.Visible = false;
                    pnlAddEditDropdown.Visible = false;
                    pnlAddEditTextBox.Visible = true;
                    pnlAddEditContentBlock.Visible = false;
                    btnAdd.Visible = true;

                    hfControlListID_ForEdit.Value = dtControlInfo.Rows[0]["ControlList_ID"].ToString();
                    hfPageControlID_ForEdit.Value = hf.Value;
                }
                else if (controlType == "DropDownList")
                {
                    pnlEditActions.Visible = false;
                    pnlAddEditDropdown.Visible = true;
                    pnlAddEditTextBox.Visible = false;
                    pnlAddEditContentBlock.Visible = false;
                    btnAdd.Visible = false;
                    hfPageControlID_DD_ForEdit.Value = hf.Value;

                    DataTable dtOptions = data.GetControlOptionsByPageControl_ID(hf.Value);
                    string defaultValue = data.GetDefaultOptionByPageControl_ID(hf.Value);

                    txtDefaultOption.Text = defaultValue;
                    rptrOptions.DataSource = dtOptions;
                    rptrOptions.DataBind();
                }
                else if (controlType == "Submit")
                {
                    pnlEditActions.Visible = true;
                    pnlAddSubmitButton.Visible = true;
                    pnlControlList.Visible = false;

                    btnUpdateButtonText.Visible = true;

                    hfPageControlID_Action_ForEdit.Value = hf.Value;
                    hfPageControlID_ForEdit.Value = hf.Value;

                    DataTable dtActionTypes = data.GetControlActionTypes();
                    DataTable dtActions = data.GetControlActionsByPageControl_ID(hf.Value);
                    DataTable dtAprimoInfo = data.GetAprimoInfoByPage_ID(ddlPages.SelectedValue);

                    if (dtAprimoInfo != null)
                    {
                        txtAprimoSubject.Text = dtAprimoInfo.Rows[0]["Subject"].ToString();
                        txtAprimoID.Text = dtAprimoInfo.Rows[0]["Aprimo_ID"].ToString();
                    }

                    LoadDropdown(ddlActions, dtActionTypes, "Name", "ControlActionType_ID", "Select Action");

                    rptrActions.DataSource = dtActions;
                    rptrActions.DataBind();

                    if (ddlPages.SelectedIndex != 0)
                    {
                        if (data.DoesPagehaveECASControlAction(ddlPages.SelectedValue))
                        {
                            string url = "";

                            if (ddlPages.SelectedIndex != 0)
                                url = data.GetReturnURLByPage_ID(ddlPages.SelectedValue);

                            tbxReturnURL.Text = url;

                            pnlReturnURL.Visible = true;
                        }
                    }

                }

            }

            ReloadControlList();
        }
Exemple #3
0
        protected void rptrActions_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            HiddenField hf = (HiddenField)e.Item.FindControl("hidPageControl_ID");
            string controlActionID = e.CommandArgument.ToString();
            FormGeneratorData data = new FormGeneratorData();

            data.RemoveControlAction(controlActionID);

            LogMessage("Removed Action from Submit Button.");

            DataTable dtActions = data.GetControlActionsByPageControl_ID(hf.Value);

            rptrActions.DataSource = dtActions;
            rptrActions.DataBind();

            if (ddlPages.SelectedIndex != 0)
            {
                if (data.DoesPagehaveECASControlAction(ddlPages.SelectedValue))
                    pnlReturnURL.Visible = true;
                else
                    pnlReturnURL.Visible = false;
            }
        }
        protected void submit_Click(Object sender, EventArgs e)
        {
            Response.Write("yeah!");
            //****************************
            FormGeneratorData data = new FormGeneratorData();
            string pageControlID = ((CrossBrowser_Button)sender).txtCrossBrowserSubmit.Attributes["pageControlID"];
            DataTable dtActions = data.GetControlActionsByPageControl_ID(pageControlID);

            foreach (DataRow action in dtActions.Rows)
            {
                string actionName = action["Name"].ToString();
                string controlAction_ID = action["ControlAction_ID"].ToString();

                if (actionName == "Send Data To Aprimo (test)")
                {
                    SendDataToAprimo(true);
                }
                else if (actionName == "Send Data To Aprimo (live)")
                {
                    SendDataToAprimo(false);
                }
            }

            PlaceHolder ph = (PlaceHolder)Page.Master.FindControl("phColumn1");
            CrossBrowser_Button cbb = (CrossBrowser_Button)ph.FindControl("cbbSubmit");

            cbb.lblSuccessMessage.Visible = true;

            ClearFields();
        }