Example #1
0
        private void BindGridInfo(int pageIndex)
        {
            int pageSize    = AspNetPager1.PageSize;
            int recordCount = 0;
            MarketingCampaigns _bMarketingCampaigns = new MarketingCampaigns();
            string             sWhere = "1>0";

            if (ddlCategory.SelectedValue != "-1")
            {
                sWhere = "CategoryName='" + ddlCategory.SelectedItem.Text + "'";
            }
            DataSet ds = _bMarketingCampaigns.GetCampaignsList(pageSize, pageIndex, sWhere, out recordCount, OrderName, OrderType);

            AspNetPager1.RecordCount      = recordCount;
            AspNetPager1.CurrentPageIndex = pageIndex;
            AspNetPager1.PageSize         = pageSize;

            gridMarketingCampaign.DataSource = ds;
            gridMarketingCampaign.DataBind();
            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0 && iCampaignId == 0)
            {
                //iFrmURL.Attributes.Add("src", GetCampaignUrl(ds.Tables[0].Rows[0]["CampaignDetailURL"]));
                //若该页面未传递ID,则默认显示第一条ID的Detail信息
                iCampaignId = Convert.ToInt32(ds.Tables[0].Rows[0]["CampaignId"]);
            }
        }
Example #2
0
        private void BindFilter()
        {
            MarketingCampaigns _bMarketingCampaigns = new MarketingCampaigns();
            DataTable          dtSource             = _bMarketingCampaigns.GetMarketingCategoryInfo();


            // add "All Lead Sources" row
            DataRow NewSourceRow = dtSource.NewRow();

            NewSourceRow["CategoryId"]   = "-1";
            NewSourceRow["CategoryName"] = "All Categories";
            dtSource.Rows.InsertAt(NewSourceRow, 0);

            ddlCategory.DataTextField  = "CategoryName";
            ddlCategory.DataValueField = "CategoryId";

            ddlCategory.DataSource = dtSource;
            ddlCategory.DataBind();
        }
Example #3
0
    private void BindFilterData()
    {
        MarketingCampaigns _bMarketingCampaigns = new MarketingCampaigns();
        DataSet            dsCampaign           = _bMarketingCampaigns.GetList("1>0");
        DataTable          dtCampaign           = new DataTable();

        dtCampaign.Columns.Add("CampaignName");
        DataRow dr;

        foreach (DataRow drCp in dsCampaign.Tables[0].Rows)
        {
            if (dtCampaign.Select("CampaignName='" + drCp["CampaignName"].ToString() + "'").Length == 0)
            {
                dr = dtCampaign.NewRow();
                dr["CampaignName"] = drCp["CampaignName"].ToString();
                dtCampaign.Rows.Add(dr);
            }
        }
        DataView dv = dtCampaign.DefaultView;

        dv.Sort = "CampaignName";
        DataTable dtAllCampaigns = dv.Table;

        dr = dtAllCampaigns.NewRow();
        dr["CampaignName"] = "All Campaigns";
        dtAllCampaigns.Rows.InsertAt(dr, 0);

        ddlCampaigns.DataSource = dtAllCampaigns;
        ddlCampaigns.DataBind();

        DataTable dtStartedBy = _bLoanMarketing.GetDisStartByInfo();
        DataRow   drStartedBy = dtStartedBy.NewRow();

        drStartedBy["UserId"]        = 0;
        drStartedBy["StartedByUser"] = "******";
        dtStartedBy.Rows.InsertAt(drStartedBy, 0);
        ddlStartedBy.DataSource = dtStartedBy;
        ddlStartedBy.DataBind();
    }
        protected void Page_Load(object sender, EventArgs e)
        {
            bool bIsValid = PageCommon.ValidateQueryString(this, "campaignId", QueryStringType.ID);

            if (bIsValid == false)
            {
                PageCommon.WriteJsEnd(this, sErrorMsg, "window.parent.location.href='" + sReturnUrl + "'");
            }
            iCampaignId = Convert.ToInt32(Request.QueryString["campaignId"]);
            ipageIndex  = Convert.ToInt32(Request.QueryString["pageindex"]);
            MarketingCampaigns _bMarketingCampaigns = new MarketingCampaigns();

            DataSet dsCampaigns = _bMarketingCampaigns.GetCampaignsList(ipageSize, ipageIndex, "1>0", out recordCount, sOrderName, 0);
            //DataSet dsCampaigns = _bMarketingCampaigns.GetAllList();
            string sIDs = "";

            foreach (DataRow dr in dsCampaigns.Tables[0].Rows)
            {
                sIDs += dr["CampaignId"].ToString() + ",";
            }
            sIDs             = sIDs.TrimEnd(',');
            this.hfID.Value  = iCampaignId.ToString();
            this.hfIDs.Value = sIDs;
        }
Example #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (string.IsNullOrEmpty(Request.QueryString["needret"]))
        {
            strNeedReturn = "0";
        }
        else
        {
            strNeedReturn = "1";
        }

        #region 校验必要参数

        bool bIsValid = PageCommon.ValidateQueryString(this, "RuleID", QueryStringType.ID);
        if (bIsValid == false)
        {
            this.ClientScript.RegisterClientScriptBlock(this.GetType(), "_Missing", "$('#divContainer').hide();alert('Missing required query string.');window.parent.CloseDialog_EditRule();", true);
            return;
        }

        this.iRuleID = Convert.ToInt32(this.Request.QueryString["RuleID"]);

        #endregion

        #region 加载Rule信息
        Template_Rules RuleManager = new Template_Rules();
        DataTable      RuleInfo    = RuleManager.GetRuleInfo(this.iRuleID);
        if (RuleInfo.Rows.Count == 0)
        {
            this.ClientScript.RegisterClientScriptBlock(this.GetType(), "_Invalid", "$('#divContainer').hide();alert('Invalid required query string.');window.parent.CloseDialog_EditRule();", true);
            return;
        }

        #endregion

        // is referenced by rule group
        this.hdnIsRef.Text = RuleManager.bIsRef(this.iRuleID).ToString();

        if (this.IsPostBack == false)
        {
            #region 加载email template
            LoanTasks      LoanTaskManager  = new LoanTasks();
            Template_Email EmailTempManager = new Template_Email();
            DataTable      EmailTemplates   = EmailTempManager.GetEmailTemplate(" and Enabled = 1");

            DataRow NoneEmailTemplateRow = EmailTemplates.NewRow();
            NoneEmailTemplateRow["TemplEmailId"] = 0;
            NoneEmailTemplateRow["Name"]         = "-- select an email template --";
            EmailTemplates.Rows.InsertAt(NoneEmailTemplateRow, 0);

            this.ddlRecomActionTemplate.DataSource = EmailTemplates;
            this.ddlRecomActionTemplate.DataBind();

            this.ddlAlertEmailTemplate.DataSource = EmailTemplates;
            this.ddlAlertEmailTemplate.DataBind();

            #endregion

            #region 加载Conditions

            DataTable ConditionListData = RuleManager.GetConditionList(this.iRuleID);
            this.gridConditionList.DataSource = ConditionListData;
            this.gridConditionList.DataBind();

            #endregion

            #region 绑定数据

            this.txtRuleName.Text   = RuleInfo.Rows[0]["Name"].ToString();
            this.txtDesc.Text       = RuleInfo.Rows[0]["Desc"].ToString();
            this.chkEnabled.Checked = Convert.ToBoolean(RuleInfo.Rows[0]["Enabled"]);
            this.ddlRecomActionTemplate.SelectedValue = RuleInfo.Rows[0]["RecomEmailTemplid"].ToString();
            this.ddlAlertEmailTemplate.SelectedValue  = RuleInfo.Rows[0]["AlertEmailTemplId"].ToString();
            this.chkReqAck.Checked      = Convert.ToBoolean(RuleInfo.Rows[0]["AckReq"]);
            this.txtFormula.Text        = RuleInfo.Rows[0]["AdvFormula"].ToString();
            this.ddlScope.SelectedValue = RuleInfo.Rows[0]["RuleScope"].ToString();

            #region get loan target

            //this.ddlTarget.SelectedValue = RuleInfo.Rows[0]["LoanTarget"].ToString();

            LPWeb.Model.Template_Rules_LoanTarget modelLoanTarget;
            if (!RuleInfo.Rows[0].IsNull("LoanTarget"))
            {
                modelLoanTarget = new LPWeb.Model.Template_Rules_LoanTarget(Convert.ToInt16(RuleInfo.Rows[0]["LoanTarget"]));
            }
            else
            {
                modelLoanTarget = new LPWeb.Model.Template_Rules_LoanTarget();
            }

            this.chkTargetActiveLoans.Checked   = modelLoanTarget.ActiveLoans;
            this.chkTargetActiveLeads.Checked   = modelLoanTarget.ActiveLeads;
            this.chkTargetArchivedLoans.Checked = modelLoanTarget.ArchivedLoans;
            this.chkTargetArchivedLeads.Checked = modelLoanTarget.ArchivedLeads;

            #endregion

            #endregion
            if (RuleInfo.Rows[0]["AutoCampaignId"].ToString() != "")
            {
                this.hfSelCampaigns.Value = RuleInfo.Rows[0]["AutoCampaignId"].ToString();
                MarketingCampaigns             _bMarketingCampaigns = new MarketingCampaigns();
                LPWeb.Model.MarketingCampaigns _mMarketingCampaigns = _bMarketingCampaigns.GetModel(Convert.ToInt32(RuleInfo.Rows[0]["AutoCampaignId"]));
                //txtMarketingCampaign.Text = _mMarketingCampaigns.CampaignName;
            }
            // set counter
            this.hdnCounter.Value = ConditionListData.Rows.Count.ToString();
        }
    }