Example #1
0
        /// <summary>
        /// 刷新广告版块Js文件
        /// </summary>
        /// <param name="adZone"></param>
        public void RefreshAdZoneJsFile(EAdZone adZone, string js)
        {
            string jsPath = HttpContext.Current.Server.MapPath(@"\IAB");

            if (!Directory.Exists(jsPath))
            {
                Directory.CreateDirectory(jsPath);
            }

            jsPath = Path.Combine(jsPath, adZone.AdZoneJSName);

            if (File.Exists(jsPath))
            {
                File.Delete(jsPath);
            }

            using (FileStream fs = new FileStream(jsPath, FileMode.Create, FileAccess.Write))
            {
                using (StreamWriter sw = new StreamWriter(fs, Encoding.UTF8))
                {
                    sw.Write(js);
                }
            }
        }
Example #2
0
 /// <summary>
 /// 保存广告版块
 /// </summary>
 /// <typeparam name="TEntity"></typeparam>
 /// <param name="entity"></param>
 /// <returns></returns>
 public int SaveAdZone(EAdZone adZone)
 {
     return _rep.Save(adZone, p => p.Id == adZone.Id);
 }
Example #3
0
 /// <summary>
 /// 添加广告版块
 /// </summary>
 /// <typeparam name="TEntity"></typeparam>
 /// <param name="entity"></param>
 /// <returns></returns>
 public int AddAdZone(EAdZone adZone)
 {
     return _rep.Add(adZone);
 }