Ejemplo n.º 1
0
        protected void OnActionDeleteClick(object sender, EventArgs e)
        {
            var button = (LinkButton)sender;

            _campaignAction.TSP_CampaignActions(int.Parse(button.CommandArgument));
            CampaignActionRepeater.DataBind();
            ScrollTargetHidden.Value = "ActionListHeader";
        }
Ejemplo n.º 2
0
        protected void ApproveActionLink_OnClick(object sender, EventArgs e)
        {
            var campaignActionConditionsXml = string.Empty;

            if (ActionTemplateAdditionalSectionPlaceHolder.Visible)
            {
                Guid    valueGuid;
                string  valueString;
                decimal valueDecimal;
                bool    isNullValue;
                if (IsActionValueValid(out valueGuid, out valueString, out valueDecimal, out isNullValue))
                {
                    campaignActionConditionsXml = Utilities.FormatXml(@"<campaign_action_condition>
                                                                        <condition_id>{0}</condition_id>
                                                                        <value_guid>{1}</value_guid>
                                                                        <value_string>{2}</value_string>
                                                                        <value_decimal>{3}</value_decimal>
                                                                    </campaign_action_condition>", ActionConditionIDHidden.Value, valueGuid, valueString, valueDecimal);
                }
                else
                {
                    if (!isNullValue)
                    {
                        return;
                    }
                }
            }

            if (GiftTicketPlaceHolder.Visible && GiftTicketCountTextBox.Number > ActionValueDecimalInput.Number)
            {
                return;
            }

            var xml = new StringBuilder();

            xml.Append("<data>");

            xml.AppendFormat("<campaign_id>{0}</campaign_id>", _campaignID);
            xml.AppendFormat("<action_id>{0}</action_id>", SelectedActionID.Value);
            xml.AppendFormat("<campaign_action_conditions>{0}</campaign_action_conditions>", campaignActionConditionsXml);


            if (ActionTemplatePrimarySectionPlaceHolder.Visible)
            {
                xml.AppendFormat("<value_decimal>{0}</value_decimal>", ActionValueDecimalInput.Number);
            }

            if (GiftTicketPlaceHolder.Visible)
            {
                xml.AppendFormat("<additional_value_decimal>{0}</additional_value_decimal>", GiftTicketCountTextBox.Number);
            }
            else if (TypePlaceHolder.Visible)
            {
                xml.AppendFormat("<additional_value_decimal>{0}</additional_value_decimal>", cbTypes.Value);
            }

            xml.Append("</data>");

            _campaign.TX_Campaigns(2, xml.ToString());
            ResetActionTemplate();
            CampaignActionRepeater.DataBind();
            ScrollTargetHidden.Value = "ActionListHeader";
        }