示例#1
0
        public override List <AdUserPageVO> GetModels(ref AdUserPagePara mp)
        {
            string where = GetConditionByPara(mp);

            int    pStart = mp.PageIndex.Value * mp.PageSize.Value;
            int    pEnd   = mp.PageSize.Value;
            string cmd    = QUERYPAGE
                            .Replace("@PAGESIZE", pEnd.ToString())
                            .Replace("@PTOP", pStart.ToString())
                            .Replace("@WHERE", where)
                            .Replace("@ORDER", GetOrderByPara(mp));

            CodeCommand command = new CodeCommand();

            command.CommandText = cmd;

            var table = DbProxyFactory.Instance.Proxy.ExecuteTable(command);

            List <AdUserPageVO> list = new List <AdUserPageVO>();

            for (int i = 0; i < table.Rows.Count; i++)
            {
                list.Add(new AdUserPageVO(table.Rows[i]));
            }

            if (!mp.Recount.HasValue)
            {
                mp.Recount = GetRecords(mp);
            }

            return(list);
        }
示例#2
0
        private void BindPage()
        {
            AdUserPagePara aup = new AdUserPagePara();

            aup.AdPageId   = int.Parse(hidId.Value);
            aup.FlowUserId = Account.UserId;

            var list = AdUserPageBLL.Instance.GetModels(aup);

            if (list.Count == 0)
            {
                if (string.IsNullOrEmpty(txtPageName.Value))
                {
                    txtPageName.Value = AdPageInfoBLL.Instance.GetPageName();
                    AdPageInfoBLL.Instance.CreateAdPage(txtPageName.Value, DN.WeiAd.Business.Config.AppConfig.TemplateName);
                }
            }
            else
            {
                txtPageName.Value = list[0].PageName;
            }

            var info = AdPageInfoBLL.Instance.GetModelById(aup.AdPageId.Value);

            if (info != null)
            {
                lnkPrview.NavigateUrl = AdPageInfoBLL.Instance.GetAdViewUrl(txtPageName.Value);
                lnkPrview.Text        = lnkPrview.NavigateUrl;
                ltAdTitle.Text        = info.Title;
            }
        }
示例#3
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            AdUserPagePara aup = new AdUserPagePara();

            aup.AdPageId   = int.Parse(hidId.Value);
            aup.FlowUserId = Account.UserId;

            var list = AdUserPageBLL.Instance.GetModels(aup);

            if (list.Count == 0)
            {
                var adpage = AdPageInfoBLL.Instance.GetSingle(new AdPageInfoPara()
                {
                    Id = aup.AdPageId.Value
                });
                if (adpage != null)
                {
                    AdUserPageVO info = new AdUserPageVO();
                    info.AdPageId     = int.Parse(hidId.Value);
                    info.CreateDate   = DateTime.Now;
                    info.CreateUserId = Account.UserId;
                    info.PageName     = txtPageName.Value;
                    info.AdUserId     = adpage.UserId;
                    info.FlowLastDate = DateTime.Now;
                    info.FlowUserId   = Account.UserId;
                    info.Gid          = Guid.NewGuid().ToString();

                    var plist = AdUserPageBLL.Instance.GetModels(new AdUserPagePara()
                    {
                        PageName = info.PageName
                    });
                    if (plist.Count == 0)
                    {
                        if (AdPageInfoBLL.Instance.CreateAdPage(info.PageName, DN.WeiAd.Business.Config.AppConfig.TemplateName, adpage.Id))
                        {
                            AdUserPageBLL.Instance.Add(info);
                            Response.Redirect("/AccFlow/Tasks/UserTaskList.aspx?state=0");
                            lblMsg.Text = "领取任务成功。";
                        }
                        else
                        {
                            lblMsg.Text = "领取任务失败,再试一试。";
                        }
                    }
                    else
                    {
                        lblMsg.Text = "该页面己经存在,重新添加任务一次。";
                    }
                }
                else
                {
                    lblMsg.Text = "该广告己经不存,无法领取任务。";
                }
            }
            else
            {
                lblMsg.Text = "您己经领取过该任务。";
            }
        }
示例#4
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            AdUserPagePara aup = new AdUserPagePara();

            aup.AdPageId   = int.Parse(hidId.Value);
            aup.FlowUserId = int.Parse(ddlFlow.SelectedValue);

            var list = AdUserPageBLL.Instance.GetModels(aup);

            if (list.Count == 0)
            {
                var adpage = AdPageInfoBLL.Instance.GetSingle(new AdPageInfoPara()
                {
                    Id = aup.AdPageId.Value
                });
                if (adpage != null)
                {
                    AdUserPageVO info = new AdUserPageVO();
                    info.AdPageId     = int.Parse(hidId.Value);
                    info.CreateDate   = DateTime.Now;
                    info.CreateUserId = Account.UserId;
                    info.PageName     = txtPageName.Value;
                    info.AdUserId     = adpage.UserId;
                    info.FlowLastDate = DateTime.Now;
                    info.FlowUserId   = int.Parse(ddlFlow.SelectedValue);
                    info.Gid          = Guid.NewGuid().ToString();

                    var plist = AdUserPageBLL.Instance.GetModels(new AdUserPagePara()
                    {
                        PageName = info.PageName
                    });
                    if (plist.Count == 0)
                    {
                        if (AdPageInfoBLL.Instance.CreateAdPage(info.PageName, ddlTemplate.SelectedValue, adpage.Id))
                        {
                            AdUserPageBLL.Instance.Add(info);
                            lblMsg.Text = "分配成功。";
                        }
                        else
                        {
                            lblMsg.Text = "分配成功失败,再试一试。";
                        }
                    }
                    else
                    {
                        lblMsg.Text = "该页面己经存在,重新添加任务一次。";
                    }
                }
                else
                {
                    lblMsg.Text = "该广告己经不存,无法领取任务。";
                }
            }
            else
            {
                lblMsg.Text = "该工作室中己存在该广告";
            }
        }
示例#5
0
        public override string GetOrderByPara(AdUserPagePara mp)
        {
            if (!string.IsNullOrEmpty(mp.OrderBy))
            {
                return(string.Format(" order by {0}", mp.OrderBy));
            }

            return("");
        }
示例#6
0
        public override AdUserPageVO GetSingle(AdUserPagePara mp)
        {
            var list = GetModels(mp);

            if (list.Count == 1)
            {
                return(list[0]);
            }

            return(null);
        }
示例#7
0
        public override int GetRecords(AdUserPagePara mp)
        {
            string where = GetConditionByPara(mp);

            CodeCommand command = new CodeCommand();

            command.CommandText = QUERYCOUNT + where;

            var result = DbProxyFactory.Instance.Proxy.ExecuteScalar(command);

            return(int.Parse(result.ToString()));
        }
示例#8
0
        public override string GetConditionByPara(AdUserPagePara mp)
        {
            StringBuilder sb = new StringBuilder();

            if (mp.Id.HasValue)
            {
                sb.AppendFormat(" AND [Id]='{0}' ", mp.Id);
            }
            if (!string.IsNullOrEmpty(SqlFilterHelper.CheckPropertyName(mp.Gid)))
            {
                sb.AppendFormat(" AND [Gid]='{0}' ", mp.Gid);
            }
            if (!string.IsNullOrEmpty(SqlFilterHelper.CheckPropertyName(mp.PageName)))
            {
                sb.AppendFormat(" AND [PageName]='{0}' ", mp.PageName);
            }
            if (mp.AdPageId.HasValue)
            {
                sb.AppendFormat(" AND [AdPageId]='{0}' ", mp.AdPageId);
            }
            if (mp.AdUserId.HasValue)
            {
                sb.AppendFormat(" AND [AdUserId]='{0}' ", mp.AdUserId);
            }
            if (mp.IsState.HasValue)
            {
                sb.AppendFormat(" AND [IsState]='{0}' ", mp.IsState);
            }
            if (mp.CreateDate.HasValue)
            {
                sb.AppendFormat(" AND [CreateDate]='{0}' ", mp.CreateDate);
            }
            if (mp.CreateUserId.HasValue)
            {
                sb.AppendFormat(" AND [CreateUserId]='{0}' ", mp.CreateUserId);
            }
            if (mp.FlowUserId.HasValue)
            {
                sb.AppendFormat(" AND [FlowUserId]='{0}' ", mp.FlowUserId);
            }
            if (mp.FlowLastDate.HasValue)
            {
                sb.AppendFormat(" AND [FlowLastDate]='{0}' ", mp.FlowLastDate);
            }


            sb.Insert(0, " WHERE 1=1 ");

            return(sb.ToString());
        }
示例#9
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            AdUserPagePara aup = new AdUserPagePara();

            aup.PageName = txtPageName.Value;

            var list = AdUserPageBLL.Instance.GetModels(aup);

            if (list.Count == 0)
            {
                AdUserPageVO info = new AdUserPageVO();
                info.AdPageId     = int.Parse(hidId.Value);
                info.CreateDate   = DateTime.Now;
                info.CreateUserId = Account.UserId;
                info.PageName     = txtPageName.Value;
                info.FlowLastDate = DateTime.Now;
                info.AdUserId     = Account.UserId;
                info.Gid          = Guid.NewGuid().ToString();
                if (AdPageInfoBLL.Instance.CreateAdPage(info.PageName, ddlTemplate.SelectedValue, int.Parse(hidId.Value)))
                {
                    AdUserPageBLL.Instance.Add(info);

                    var adinfo = AdPageInfoBLL.Instance.GetSingle(new AdPageInfoPara()
                    {
                        Id = info.AdPageId
                    });
                    if (adinfo != null)
                    {
                        adinfo.PageCount = AdUserPageBLL.Instance.GetRecords(new AdUserPagePara()
                        {
                            AdPageId = info.AdPageId
                        });
                        adinfo.LastDate = DateTime.Now;
                        AdPageInfoBLL.Instance.Edit(adinfo);
                    }

                    lblMsg.Text = "页面创建成功。";
                }
                else
                {
                    lblMsg.Text = "创建广告页失败,请联系管理员处理。";
                }
            }
            else
            {
                lblMsg.Text = "该页面己经存在,请重新输入。";
            }
        }
示例#10
0
        private void Bind(int pageIndex = 1)
        {
            AdUserPagePara cip = new AdUserPagePara();

            cip.PageIndex  = pageIndex - 1;
            cip.PageSize   = 10;
            cip.FlowUserId = Account.UserId;
            cip.OrderBy    = " id desc ";
            cip.IsState    = int.Parse(hidState.Value);

            var list = AdUserPageBLL.Instance.GetModels(ref cip);

            rptTable.DataSource = list;
            rptTable.DataBind();

            apPager.RecordCount = cip.Recount.Value;
        }
示例#11
0
        public override bool Delete(AdUserPagePara mp)
        {
            string where = GetConditionByPara(mp);

            CodeCommand command = new CodeCommand();

            command.CommandText = DELETE + where;

            int result = DbProxyFactory.Instance.Proxy.ExecuteNonQuery(command);

            if (result >= 1)
            {
                return(true);
            }

            return(false);
        }
示例#12
0
        private void BindPage()
        {
            var tlist = AdPageInfoBLL.Instance.GetTemplateSett();

            ddlTemplate.Items.Clear();
            foreach (var item in tlist)
            {
                ddlTemplate.Items.Add(item);
            }

            var ulist = AccountInfoBLL.Instance.GetModels(new AccountInfoPara()
            {
                UserType = 1
            });

            ddlFlow.DataSource     = ulist;
            ddlFlow.DataTextField  = "NickName";
            ddlFlow.DataValueField = "Id";
            ddlFlow.DataBind();

            AdUserPagePara aup = new AdUserPagePara();

            aup.AdPageId   = int.Parse(hidId.Value);
            aup.FlowUserId = Account.UserId;

            var list = AdUserPageBLL.Instance.GetModels(aup);

            if (list.Count == 0)
            {
                txtPageName.Value = AdPageInfoBLL.Instance.GetPageName();
            }
            else
            {
                txtPageName.Value = list[0].PageName;
            }

            var info = AdPageInfoBLL.Instance.GetModelById(aup.AdPageId.Value);

            if (info != null)
            {
                lnkPrview.NavigateUrl = string.Format("/Ad/{0}.aspx", info.ViewPage);
            }
        }
示例#13
0
        private void Bind(int pageIndex = 1)
        {
            AdUserPagePara cip = new AdUserPagePara();

            cip.PageIndex  = pageIndex - 1;
            cip.PageSize   = 10;
            cip.FlowUserId = Account.UserId;
            cip.OrderBy    = " id desc ";
            cip.IsState    = int.Parse(hidState.Value);

            var list = AdUserPageBLL.Instance.GetModels(ref cip);

            rptTable.DataSource = list;
            rptTable.DataBind();

            QueryGroupInfo query = new QueryGroupInfo();

            query.FlowUserId = Account.UserId;
            query.Time       = DateTime.Now;
            query.GroupBy    = "adid";

            var table = AnalysisBLL.Instance.GetAnalysis(query);

            for (int i = 0; i < rptTable.Items.Count; i++)
            {
                HiddenField hidAdId   = (HiddenField)rptTable.Items[i].FindControl("hidAdId");
                Literal     ltPvCount = (Literal)rptTable.Items[i].FindControl("ltPvCount");
                Literal     ltUvCount = (Literal)rptTable.Items[i].FindControl("ltUvCount");
                Literal     ltIpCount = (Literal)rptTable.Items[i].FindControl("ltIpCount");
                var         rows      = table.Select(string.Format("adid={0}", hidAdId.Value));
                if (rows != null && rows.Count() != 0)
                {
                    ltPvCount.Text = rows[0]["pvcount"].ToString();
                    ltUvCount.Text = rows[0]["uvcount"].ToString();
                    ltIpCount.Text = rows[0]["ipcount"].ToString();
                }
            }

            apPager.RecordCount = cip.Recount.Value;
        }
示例#14
0
        private string ReplaceMiddlePageHtml(string html, AdPageInfoVO info)
        {
            //有效域名
            DomainInfoPara dp = new DomainInfoPara();

            dp.IsAuth  = 1;
            dp.IsState = 0;
            var list = DomainInfoBLL.Instance.GetModels(dp);

            StringBuilder sbDomain = new StringBuilder();

            foreach (var item in list)
            {
                sbDomain.AppendFormat("\"{0}\",", item.Domain);
            }
            if (sbDomain.Length != 0)
            {
                sbDomain = sbDomain.Remove(sbDomain.Length - 1, 1);
            }

            //有效页面
            AdUserPagePara aup = new AdUserPagePara();

            aup.AdPageId = info.Id;
            var plist = AdUserPageBLL.Instance.GetModels(aup);

            StringBuilder sbPage = new StringBuilder();

            foreach (var item in plist)
            {
                sbPage.AppendFormat("\"{0}\",", item.PageName);
            }
            sbPage.AppendFormat("\"{0}\"", info.ViewPage);

            html = html
                   .Replace("$domains$", sbDomain.ToString())
                   .Replace("$pages$", sbPage.ToString());
            return(html);
        }
示例#15
0
        private void Bind(int pageIndex = 1)
        {
            AdUserPagePara cip = new AdUserPagePara();

            cip.PageIndex = pageIndex - 1;
            cip.PageSize  = 10;
            if (!string.IsNullOrEmpty(ddlAdInfo.SelectedValue))
            {
                cip.AdPageId = int.Parse(ddlAdInfo.SelectedValue);
            }
            cip.AdPageId = int.Parse(hidAdId.Value);
            cip.AdUserId = Account.UserId;
            cip.OrderBy  = " id desc ";

            var list = AdUserPageBLL.Instance.GetModels(ref cip);

            rptTable.DataSource = list;
            rptTable.DataBind();

            apPager.RecordCount = cip.Recount.Value;
            apPager.PageSize    = cip.PageSize.Value;
        }
示例#16
0
        private void Bind(int pageIndex = 1)
        {
            AdUserPagePara cip = new AdUserPagePara();

            cip.PageIndex = pageIndex - 1;
            cip.PageSize  = 10;
            cip.AdPageId  = int.Parse(hidAdId.Value);
            cip.OrderBy   = " id desc ";

            var list = AdUserPageBLL.Instance.GetModels(ref cip);

            rptTable.DataSource = list;
            rptTable.DataBind();

            DN.WeiAd.Business.Entity.Analysis.FlowInfo finfo = new DN.WeiAd.Business.Entity.Analysis.FlowInfo();
            finfo.AdId = int.Parse(hidAdId.Value);
            finfo.Time = DateTime.Now;
            //var table = AnalysisAdBLL.Instance.GetAdFlowDetail(finfo);

            for (int i = 0; i < rptTable.Items.Count; i++)
            {
                Literal     ltPv          = (Literal)rptTable.Items[i].FindControl("ltPv");
                Literal     ltUv          = (Literal)rptTable.Items[i].FindControl("ltUv");
                Literal     ltIp          = (Literal)rptTable.Items[i].FindControl("ltIp");
                HiddenField hidFlowUserId = (HiddenField)rptTable.Items[i].FindControl("hidFlowUserId");

                //var row = table.Select(string.Format("FlowUserId={0}", hidFlowUserId.Value));
                //if(row!= null && row.Length >=1)
                //{
                //    ltPv.Text = row[0]["pvcount"].ToString();
                //    ltUv.Text = row[0]["uvcount"].ToString();
                //    ltIp.Text = row[0]["ipcount"].ToString();
                //}
            }

            apPager.RecordCount = cip.Recount.Value;
            apPager.PageSize    = cip.PageSize.Value;
        }
示例#17
0
        public override List <AdUserPageVO> GetModels(AdUserPagePara mp)
        {
            string where = GetConditionByPara(mp);

            CodeCommand command = new CodeCommand();

            string cmd = LOAD
                         .Replace("@WHERE", where)
                         .Replace("@ORDER", GetOrderByPara(mp));

            command.CommandText = cmd;

            var table = DbProxyFactory.Instance.Proxy.ExecuteTable(command);

            List <AdUserPageVO> list = new List <AdUserPageVO>();

            for (int i = 0; i < table.Rows.Count; i++)
            {
                list.Add(new AdUserPageVO(table.Rows[i]));
            }

            return(list);
        }
示例#18
0
 public override string GetOtherConditionByPara(AdUserPagePara mp)
 {
     return("");
 }