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 }); } }
/// <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); }
/// <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); }
/// <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); }
/// <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); }
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)); }
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)); }
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)); }
/// <summary> /// 更新广告位置 /// </summary> public static void UpdateAdvertPosition(AdvertPositionInfo advertPositionInfo) { BrnMall.Core.BMAData.RDBS.UpdateAdvertPosition(advertPositionInfo); }
/// <summary> /// 更新广告位置 /// </summary> public static void UpdateAdvertPosition(AdvertPositionInfo advertPositionInfo) { OWZX.Core.BSPData.RDBS.UpdateAdvertPosition(advertPositionInfo); }
/// <summary> /// 创建广告位置 /// </summary> public static void CreateAdvertPosition(AdvertPositionInfo advertPositionInfo) { BrnMall.Data.Adverts.CreateAdvertPosition(advertPositionInfo); }
/// <summary> /// 创建广告位置 /// </summary> public static void CreateAdvertPosition(AdvertPositionInfo advertPositionInfo) { BrnShop.Core.BSPData.RDBS.CreateAdvertPosition(advertPositionInfo); }
/// <summary> /// 创建广告位置 /// </summary> public static void CreateAdvertPosition(AdvertPositionInfo advertPositionInfo) { NStore.Core.BMAData.RDBS.CreateAdvertPosition(advertPositionInfo); }
/// <summary> /// 更新广告位置 /// </summary> public static void UpdateAdvertPosition(AdvertPositionInfo advertPositionInfo) { BonSite.Core.BSData.RDBS.UpdateAdvertPosition(advertPositionInfo); }
/// <summary> /// 更新广告位置 /// </summary> public static void UpdateAdvertPosition(AdvertPositionInfo advertPositionInfo) { BrnShop.Data.Adverts.UpdateAdvertPosition(advertPositionInfo); }
/// <summary> /// 更新广告位置 /// </summary> public static void UpdateAdvertPosition(AdvertPositionInfo advertPositionInfo) { BonSite.Data.Adverts.UpdateAdvertPosition(advertPositionInfo); }
/// <summary> /// 创建广告位置 /// </summary> public static void CreateAdvertPosition(AdvertPositionInfo advertPositionInfo) { NStore.Data.Adverts.CreateAdvertPosition(advertPositionInfo); }