public ActionResult List() { var typeList = ParamWebHelper.GetParamDtsInfo(2).Select(x => new { Type = x.ParamValue, Name = x.ParamDtsName }).ToList(); ViewBag.TypeList = new SelectList(typeList, "Type", "Name"); return(View()); }
public virtual ActionResult GetStatus() { int index = GetIndexOfStatus(); List <ParamDtsInfoEntity> models = ParamWebHelper.GetParamDtsInfo(index); models.Insert(0, new ParamDtsInfoEntity { ParamDtsName = "全部状态", ParamValue = "0" }); return(Json(models, JsonRequestBehavior.AllowGet)); }
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()); }
//更具地区获取id private string GetParaValueByArea(string dtsName) { string[] paraStr = dtsName.Split(','); var idSb = new StringBuilder(); foreach (var s in paraStr) { string id = ParamWebHelper.GetValueByDtsName(1, s); if (!string.IsNullOrEmpty(id)) { idSb.Append("||" + id); } } return(idSb.Remove(0, 2).ToString()); }
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()); }
//根据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()); }
protected override List <SideMenuInfoEntity> GetSideMenu(string[] args) { var db = CoreDBContext.GetContext(); ParamWebHelper.GetParamDtsInfo(14); var parameters = ParamWebHelper.GetParamDtsInfo(14); List <SideMenuInfoEntity> list = new List <SideMenuInfoEntity>(); foreach (var item in parameters) { list.Add(new SideMenuInfoEntity { ID = long.Parse(item.ParamValue), MenuName = item.ParamDtsName, ParentMenuID = 0 }); string name = args[0]; var query = from x in db.Set <AccountInfoEntity>() where SqlFunctions.StringConvert((decimal)x.CategoryValue).Trim() == item.ParamValue && (from y in db.Set <UserInfoEntity>() where y.UserName == name && y.ID == x.UserId select y).Any() select x; foreach (var account in query) { list.Add(new SideMenuInfoEntity { ID = account.ID, MenuName = account.AccountChnName, ParentMenuID = int.Parse(item.ParamValue), Controller = "Baidu", Action = "Index", Parameters = account.ID + "/" + account.AccountName }); } } return(list); }
public override ActionResult Edit(long id) { var model = Repository.FindByID(id); //绑定DropdownList var typeList = ParamWebHelper.GetParamDtsInfo(2).Select(x => new { Type = x.ParamValue, Name = x.ParamDtsName }).ToList(); ViewBag.TypeList = new SelectList(typeList, "Type", "Name"); //解密 model.Token = CryptHelper.DESDecode(model.Token); model.AccountPwd = CryptHelper.DESDecode(model.AccountPwd); if (!string.IsNullOrEmpty(model.RegionTarget)) { model.RegionTarget = GetAreaById(model.RegionTarget); } return(View(model)); }
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 = GetRegionTarget(entity.RegionTarget); // 只需要个数 statistics.ExcludeIp = entity.ExcludeIp.Split(new string[] { "||" }, StringSplitOptions.RemoveEmptyEntries).Length.ToString(); // 2个字段的个数求和 statistics.NegativeWords = GetTotalNegativeWords(new string[] { entity.NegativeWords, entity.ExactNegativeWords }).ToString(); // 推广时段,检查数据中包含数字0-24 bool IsScheduleAll = true; 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()); }
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()); }
//获取Account下拉框类型 public ActionResult LoadTypeData() { var temp = ParamWebHelper.GetParamDtsInfo(2); return(Json(temp, JsonRequestBehavior.AllowGet)); }
//获取ckb列表 public JsonResult GetCkbData(int id) { var result = ParamWebHelper.GetParamDtsInfo(id); return(Json(result, JsonRequestBehavior.AllowGet)); }