/// <summary> /// 创建店铺行业 /// </summary> public void CreateStoreIndustry(StoreIndustryInfo storeIndustryInfo) { DbParameter[] param = { GenerateInParam("@title",SqlDbType.NChar, 150, storeIndustryInfo.Title), GenerateInParam("@displayorder",SqlDbType.Int,4,storeIndustryInfo.DisplayOrder) }; string commandText = String.Format("INSERT INTO [{0}storeindustries] ([title],[displayorder]) VALUES(@title,@displayorder)", RDBSHelper.RDBSTablePre); RDBSHelper.ExecuteNonQuery(CommandType.Text, commandText, param); }
/// <summary> /// 更新店铺行业 /// </summary> public void UpdateStoreIndustry(StoreIndustryInfo storeIndustryInfo) { DbParameter[] param = { GenerateInParam("@title",SqlDbType.NChar, 150, storeIndustryInfo.Title), GenerateInParam("@displayorder",SqlDbType.Int,4,storeIndustryInfo.DisplayOrder), GenerateInParam("@storeiid", SqlDbType.SmallInt, 2, storeIndustryInfo.StoreIid) }; string commandText = String.Format("UPDATE [{0}storeindustries] SET [title]=@title,[displayorder]=@displayorder WHERE [storeiid]=@storeiid", RDBSHelper.RDBSTablePre); RDBSHelper.ExecuteNonQuery(CommandType.Text, commandText, param); }
/// <summary> /// 获得店铺行业列表 /// </summary> public static List<StoreIndustryInfo> GetStoreIndustryList() { List<StoreIndustryInfo> storeIndustrylist = new List<StoreIndustryInfo>(); IDataReader reader = BrnMall.Core.BMAData.RDBS.GetStoreIndustryList(); while (reader.Read()) { StoreIndustryInfo storeIndustryInfo = new StoreIndustryInfo(); storeIndustryInfo.StoreIid = TypeHelper.ObjectToInt(reader["storeiid"]); storeIndustryInfo.Title = reader["title"].ToString(); storeIndustryInfo.DisplayOrder = TypeHelper.ObjectToInt(reader["displayorder"]); storeIndustrylist.Add(storeIndustryInfo); } reader.Close(); return storeIndustrylist; }
public ActionResult Add(StoreIndustryModel model) { if (AdminStoreIndustries.GetStoreIidByTitle(model.IndustryTitle) > 0) ModelState.AddModelError("IndustryTitle", "行业标题已经存在"); if (ModelState.IsValid) { StoreIndustryInfo storeIndustryInfo = new StoreIndustryInfo() { Title = model.IndustryTitle, DisplayOrder = model.DisplayOrder }; AdminStoreIndustries.CreateStoreIndustry(storeIndustryInfo); AddMallAdminLog("添加店铺行业", "添加店铺行业,店铺行业为:" + model.IndustryTitle); return PromptView("店铺行业添加成功"); } ViewData["referer"] = MallUtils.GetMallAdminRefererCookie(); return View(model); }
/// <summary> /// 更新店铺行业 /// </summary> public static void UpdateStoreIndustry(StoreIndustryInfo storeIndustryInfo) { BrnMall.Data.StoreIndustries.UpdateStoreIndustry(storeIndustryInfo); BrnMall.Core.BMACache.Remove(CacheKeys.MALL_STORE_INDUSTRYLIST); }
/// <summary> /// 更新店铺行业 /// </summary> public static void UpdateStoreIndustry(StoreIndustryInfo storeIndustryInfo) { BrnMall.Core.BMAData.RDBS.UpdateStoreIndustry(storeIndustryInfo); }