Esempio n. 1
0
 /// <summary>
 /// 创建广告位置
 /// </summary>
 public static void CreateAdvertPosition(AdvertPositionInfo advertPositionInfo)
 {
     BrnShop.Data.Adverts.CreateAdvertPosition(advertPositionInfo);
 }
Esempio n. 2
0
        public ActionResult AddAdvertPosition(AdvertPositionModel model)
        {
            if (ModelState.IsValid)
            {
                AdvertPositionInfo advertPositionInfo = new AdvertPositionInfo()
                {
                    Title = model.Title,
                    Description = model.Description ?? ""
                };

                AdminAdverts.CreateAdvertPosition(advertPositionInfo);
                AddAdminOperateLog("添加广告位置", "添加广告位置,广告位置为:" + model.Title);
                return PromptView("广告位置添加成功");
            }
            ViewData["referer"] = ShopUtils.GetAdminRefererCookie();
            return View(model);
        }
Esempio n. 3
0
        /// <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;
        }
Esempio n. 4
0
 /// <summary>
 /// 更新广告位置
 /// </summary>
 public static void UpdateAdvertPosition(AdvertPositionInfo advertPositionInfo)
 {
     BrnShop.Core.BSPData.RDBS.UpdateAdvertPosition(advertPositionInfo);
 }
Esempio n. 5
0
 /// <summary>
 /// 创建广告位置
 /// </summary>
 public void CreateAdvertPosition(AdvertPositionInfo advertPositionInfo)
 {
     DbParameter[] param = {
                              GenerateInParam("@title",SqlDbType.NChar, 50, advertPositionInfo.Title),
                              GenerateInParam("@description",SqlDbType.NChar, 150, advertPositionInfo.Description)
                            };
     string commandText = String.Format("INSERT INTO [{0}advertpositions]([title],[description]) VALUES(@title,@description)",
                                         RDBSHelper.RDBSTablePre);
     RDBSHelper.ExecuteNonQuery(CommandType.Text, commandText, param);
 }
Esempio n. 6
0
 /// <summary>
 /// 更新广告位置
 /// </summary>
 public void UpdateAdvertPosition(AdvertPositionInfo advertPositionInfo)
 {
     DbParameter[] param = {
                              GenerateInParam("@title",SqlDbType.NChar, 50, advertPositionInfo.Title),
                              GenerateInParam("@description",SqlDbType.NChar, 150, advertPositionInfo.Description),
                              GenerateInParam("@adposid",SqlDbType.SmallInt, 2, advertPositionInfo.AdPosId)
                            };
     string commandText = String.Format("UPDATE [{0}advertpositions] SET [title]=@title,[description]=@description WHERE [adposid]=@adposid",
                                         RDBSHelper.RDBSTablePre);
     RDBSHelper.ExecuteNonQuery(CommandType.Text, commandText, param);
 }