コード例 #1
0
 protected override void FillStatistics(AdgroupInfoEntity entity, ViewAdgroupInfoEntity statistics)
 {
     statistics.ID            = entity.ID;
     statistics.AccountName   = entity.AccountName;
     statistics.CampaignId    = entity.CampaignId ?? 0;
     statistics.CampaignName  = EntityWebHelper.GetNameById <CampaignInfoEntity>(entity.CampaignId);
     statistics.AdgroupName   = entity.Name;
     statistics.MaxPrice      = entity.MaxPrice ?? 0;
     statistics.NegativeWords = GetTotalNegativeWords(new string[] { entity.NegativeWords, entity.ExactNegativeWords }).ToString();
     statistics.Pause         = ParamWebHelper.GetDiscriptionById(3, entity.Pause.ToString());
     statistics.Status        = ParamWebHelper.GetDiscriptionById(7, entity.Status.ToString());
 }
コード例 #2
0
 protected override void FillStatistics(KeywordInfoEntity entity, ViewKeywordInfoEntity statistics)
 {
     statistics.ID = entity.ID;
     statistics.AccountName = entity.AccountName;
     statistics.CampaignId = entity.CampaignId ?? 0;
     statistics.CampaignName = EntityWebHelper.GetNameById<CampaignInfoEntity>(entity.CampaignId);
     statistics.AdgroupId = entity.AdgroupId ?? 0;
     statistics.AdgroupName = EntityWebHelper.GetNameById<AdgroupInfoEntity>(entity.AdgroupId);
     statistics.Keyword = entity.Keyword;
     statistics.Price = entity.Price ?? 0;
     statistics.DestinationUrl = entity.DestinationUrl;
     statistics.MatchType = ParamWebHelper.GetDiscriptionById(8, entity.MatchType.ToString());
     statistics.Quality = ParamWebHelper.GetDiscriptionById(10, entity.Quality.ToString());
     statistics.Pause = ParamWebHelper.GetDiscriptionById(3, entity.Pause.ToString());
     statistics.Status = ParamWebHelper.GetDiscriptionById(9, entity.Status.ToString());
 }
コード例 #3
0
        //根据id获取地区
        private string GetAreaById(string paraValue)
        {
            //分割字符串

            string[] paraStr = paraValue.Split(new[] { "||" }, StringSplitOptions.RemoveEmptyEntries);
            var      areaSb  = new StringBuilder();

            foreach (var s in paraStr)
            {
                string area = ParamWebHelper.GetDiscriptionById(1, s);
                if (!string.IsNullOrEmpty(area))
                {
                    areaSb.Append("," + area);
                }
            }
            return(areaSb.Remove(0, 1).ToString());
        }
コード例 #4
0
        protected override void FillStatistics(CampaignInfoEntity entity, ViewCampaignInfoEntity statistics)
        {
            statistics.ID           = entity.ID;
            statistics.AccountName  = entity.AccountName;
            statistics.CampaignName = entity.Name;
            statistics.Budget       = entity.Budget.ToString();
            // 计划推广地域和账户推广地域比对,相同用的就是账户地域,否则是计划地域
            statistics.RegionTarget = string.IsNullOrEmpty(statistics.RegionTarget) ? "" : GetRegionTarget(entity.RegionTarget);
            // 只需要个数
            statistics.ExcludeIp = string.IsNullOrEmpty(statistics.ExcludeIp) ? "" : entity.ExcludeIp.Split(new string[] { "||" }, StringSplitOptions.RemoveEmptyEntries).Length.ToString();
            // 2个字段的个数求和
            statistics.NegativeWords = string.IsNullOrEmpty(statistics.NegativeWords) ? "" : GetTotalNegativeWords(new string[] { entity.NegativeWords, entity.ExactNegativeWords }).ToString();
            // 推广时段,检查数据中包含数字0-24
            bool IsScheduleAll = true;

            if (!string.IsNullOrEmpty(entity.Schedule))
            {
                string[] schedules = entity.Schedule.Split(new string[] { "||" }, StringSplitOptions.RemoveEmptyEntries);
                foreach (var hour in ParamWebHelper.Hours)
                {
                    foreach (var schedule in schedules)
                    {
                        if (schedule.IndexOf(hour) < 0)
                        {
                            IsScheduleAll = false;
                            break;
                        }
                    }

                    if (!IsScheduleAll)
                    {
                        break;
                    }
                }
            }

            statistics.Schedule = IsScheduleAll ? "全时段" : "自定义";

            statistics.BudgetOfflineTime = entity.BudgetOfflineTime;
            statistics.ShowProb          = ParamWebHelper.GetDiscriptionById(6, entity.ShowProb.ToString());
            statistics.Pause             = ParamWebHelper.GetDiscriptionById(3, entity.Pause.ToString());
            statistics.JoinContent       = ParamWebHelper.GetDiscriptionById(4, entity.JoinContent.ToString());
            statistics.ContentPrice      = entity.ContentPrice.ToString();
            statistics.Status            = ParamWebHelper.GetDiscriptionById(5, entity.Status.ToString());
        }
コード例 #5
0
        protected override void FillStatistics(CreativeInfoEntity entity, ViewCreativeInfoEntity statistics)
        {
            statistics.ID           = entity.ID;
            statistics.AccountName  = entity.AccountName;
            statistics.CampaignId   = entity.CampaignId ?? 0;
            statistics.CampaignName = EntityWebHelper.GetNameById <CampaignInfoEntity>(entity.CampaignId ?? 0);
            statistics.AdgroupId    = entity.AdgroupId ?? 0;
            statistics.AdgroupName  = EntityWebHelper.GetNameById <AdgroupInfoEntity>(entity.AdgroupId ?? 0);
            // 拼装Title
            StringBuilder sbTitle = new StringBuilder();

            sbTitle.Append(GetColorfulInfo("<a href='#' onclick='javascript:void(0);' style='font-size:14px;text-decoration:underline;'>" + entity.Title + "</a>"));
            sbTitle.Append("<br/>");
            sbTitle.Append(GetColorfulInfo(entity.Description1));
            sbTitle.Append(GetColorfulInfo(entity.Description2));
            sbTitle.Append("<br/>");
            sbTitle.AppendFormat("<a href='{1}' alt=''>{0}</a>", entity.DisplayUrl, entity.DestinationUrl);
            statistics.Title  = sbTitle.ToString();
            statistics.Pause  = ParamWebHelper.GetDiscriptionById(3, entity.Pause.ToString());
            statistics.Status = ParamWebHelper.GetDiscriptionById(11, entity.Status.ToString());
        }