예제 #1
0
 public ResultInfo <AdvertPositionInfo> GetAdvertPositionById(int adPosId)
 {
     try
     {
         AdvertPositionInfo result = null;
         if (adPosId > 0)
         {
             result = NStore.Data.Adverts.GetAdvertPositionById(adPosId);
         }
         return(new ResultInfo <AdvertPositionInfo>()
         {
             Code = 0,
             Msg = "",
             Data = result
         });
     }
     catch (Exception ex)
     {
         return(new ResultInfo <AdvertPositionInfo>
         {
             Code = 400,
             Msg = ex.Message,
             Data = null
         });
     }
 }
예제 #2
0
파일: Adverts.cs 프로젝트: thfthf2/NStore
        /// <summary>
        /// 从IDataReader创建AdvertPositionInfo
        /// </summary>
        public static AdvertPositionInfo BuildAdvertPositionFromReader(IDataReader reader)
        {
            AdvertPositionInfo advertPositionInfo = new AdvertPositionInfo();

            advertPositionInfo.AdPosId     = TypeHelper.ObjectToInt(reader["adposid"]);
            advertPositionInfo.Title       = reader["title"].ToString();
            advertPositionInfo.Description = reader["description"].ToString();

            return(advertPositionInfo);
        }
예제 #3
0
파일: Adverts.cs 프로젝트: hzl091/BrnShop
        /// <summary>
        /// 获得广告位置
        /// </summary>
        /// <param name="adPosId">广告位置id</param>
        /// <returns></returns>
        public static AdvertPositionInfo GetAdvertPositionById(int adPosId)
        {
            AdvertPositionInfo advertPositionInfo = null;
            IDataReader        reader             = BrnMall.Core.BMAData.RDBS.GetAdvertPositionById(adPosId);

            if (reader.Read())
            {
                advertPositionInfo = BuildAdvertPositionFromReader(reader);
            }
            reader.Close();
            return(advertPositionInfo);
        }
예제 #4
0
파일: Adverts.cs 프로젝트: hzl091/BrnShop
        /// <summary>
        /// 获得全部广告位置
        /// </summary>
        /// <returns></returns>
        public static List <AdvertPositionInfo> GetAllAdvertPosition()
        {
            List <AdvertPositionInfo> advertPositionList = new List <AdvertPositionInfo>();
            IDataReader reader = BrnMall.Core.BMAData.RDBS.GetAllAdvertPosition();

            while (reader.Read())
            {
                AdvertPositionInfo advertPositionInfo = BuildAdvertPositionFromReader(reader);
                advertPositionList.Add(advertPositionInfo);
            }
            reader.Close();
            return(advertPositionList);
        }
예제 #5
0
파일: Adverts.cs 프로젝트: nuet/OWZXAPP
        /// <summary>
        /// 获得广告位置列表
        /// </summary>
        /// <param name="pageSize">每页数</param>
        /// <param name="pageNumber">当前页数</param>
        /// <returns></returns>
        public static List <AdvertPositionInfo> GetAdvertPositionList(int pageSize, int pageNumber)
        {
            List <AdvertPositionInfo> advertPositionList = new List <AdvertPositionInfo>();
            IDataReader reader = OWZX.Core.BSPData.RDBS.GetAdvertPositionList(pageSize, pageNumber);

            while (reader.Read())
            {
                AdvertPositionInfo advertPositionInfo = BuildAdvertPositionFromReader(reader);
                advertPositionList.Add(advertPositionInfo);
            }
            reader.Close();
            return(advertPositionList);
        }
예제 #6
0
        public ActionResult EditAdvertPosition(int adPosId = -1)
        {
            AdvertPositionInfo advertPositionInfo = Adverts.GetAdvertPositionById(adPosId);

            if (advertPositionInfo == null)
            {
                return(PromptView("广告位置不存在"));
            }

            AdvertPositionModel model = new AdvertPositionModel();

            model.Title       = advertPositionInfo.Title;
            model.Description = advertPositionInfo.Description;

            ViewData["referer"] = SiteUtils.GetAdminRefererCookie();
            return(View(model));
        }
예제 #7
0
        public ActionResult AddAdvertPosition(AdvertPositionModel model)
        {
            if (ModelState.IsValid)
            {
                AdvertPositionInfo advertPositionInfo = new AdvertPositionInfo()
                {
                    Title       = model.Title,
                    Description = model.Description ?? ""
                };

                Adverts.CreateAdvertPosition(advertPositionInfo);
                AddAdminOperateLog("添加广告位置", "添加广告位置,广告位置为:" + model.Title);
                return(PromptView("广告位置添加成功"));
            }
            ViewData["referer"] = SiteUtils.GetAdminRefererCookie();
            return(View(model));
        }
예제 #8
0
        public ActionResult EditAdvertPosition(AdvertPositionModel model, int adPosId = -1)
        {
            AdvertPositionInfo advertPositionInfo = Adverts.GetAdvertPositionById(adPosId);

            if (advertPositionInfo == null)
            {
                return(PromptView("广告位置不存在"));
            }

            if (ModelState.IsValid)
            {
                advertPositionInfo.Title       = model.Title;
                advertPositionInfo.Description = model.Description ?? "";

                Adverts.UpdateAdvertPosition(advertPositionInfo);
                AddAdminOperateLog("修改广告位置", "修改广告位置,广告位置ID为:" + adPosId);
                return(PromptView("广告位置修改成功"));
            }

            ViewData["referer"] = SiteUtils.GetAdminRefererCookie();
            return(View(model));
        }
예제 #9
0
파일: Adverts.cs 프로젝트: hzl091/BrnShop
 /// <summary>
 /// 更新广告位置
 /// </summary>
 public static void UpdateAdvertPosition(AdvertPositionInfo advertPositionInfo)
 {
     BrnMall.Core.BMAData.RDBS.UpdateAdvertPosition(advertPositionInfo);
 }
예제 #10
0
파일: Adverts.cs 프로젝트: nuet/OWZXAPP
 /// <summary>
 /// 更新广告位置
 /// </summary>
 public static void UpdateAdvertPosition(AdvertPositionInfo advertPositionInfo)
 {
     OWZX.Core.BSPData.RDBS.UpdateAdvertPosition(advertPositionInfo);
 }
예제 #11
0
 /// <summary>
 /// 创建广告位置
 /// </summary>
 public static void CreateAdvertPosition(AdvertPositionInfo advertPositionInfo)
 {
     BrnMall.Data.Adverts.CreateAdvertPosition(advertPositionInfo);
 }
예제 #12
0
 /// <summary>
 /// 创建广告位置
 /// </summary>
 public static void CreateAdvertPosition(AdvertPositionInfo advertPositionInfo)
 {
     BrnShop.Core.BSPData.RDBS.CreateAdvertPosition(advertPositionInfo);
 }
예제 #13
0
파일: Adverts.cs 프로젝트: thfthf2/NStore
 /// <summary>
 /// 创建广告位置
 /// </summary>
 public static void CreateAdvertPosition(AdvertPositionInfo advertPositionInfo)
 {
     NStore.Core.BMAData.RDBS.CreateAdvertPosition(advertPositionInfo);
 }
예제 #14
0
 /// <summary>
 /// 更新广告位置
 /// </summary>
 public static void UpdateAdvertPosition(AdvertPositionInfo advertPositionInfo)
 {
     BonSite.Core.BSData.RDBS.UpdateAdvertPosition(advertPositionInfo);
 }
예제 #15
0
 /// <summary>
 /// 更新广告位置
 /// </summary>
 public static void UpdateAdvertPosition(AdvertPositionInfo advertPositionInfo)
 {
     BrnShop.Data.Adverts.UpdateAdvertPosition(advertPositionInfo);
 }
예제 #16
0
 /// <summary>
 /// 更新广告位置
 /// </summary>
 public static void UpdateAdvertPosition(AdvertPositionInfo advertPositionInfo)
 {
     BonSite.Data.Adverts.UpdateAdvertPosition(advertPositionInfo);
 }
예제 #17
0
 /// <summary>
 /// 创建广告位置
 /// </summary>
 public static void CreateAdvertPosition(AdvertPositionInfo advertPositionInfo)
 {
     NStore.Data.Adverts.CreateAdvertPosition(advertPositionInfo);
 }