/// <summary> /// 获得帮助列表 /// </summary> /// <returns></returns> public static List<HelpInfo> GetHelpList() { List<HelpInfo> helplist = new List<HelpInfo>(); IDataReader reader = BrnMall.Core.BMAData.RDBS.GetHelpList(); while (reader.Read()) { HelpInfo helpInfo = new HelpInfo(); helpInfo.Id = TypeHelper.ObjectToInt(reader["id"]); helpInfo.Pid = TypeHelper.ObjectToInt(reader["pid"]); helpInfo.Title = reader["title"].ToString(); helpInfo.Url = reader["url"].ToString(); helpInfo.Description = reader["description"].ToString(); helpInfo.DisplayOrder = TypeHelper.ObjectToInt(reader["displayorder"]); helplist.Add(helpInfo); } reader.Close(); return helplist; }
public ActionResult AddHelpCategory(HelpCategoryModel model) { if (ModelState.IsValid) { HelpInfo helpInfo = new HelpInfo() { Pid = 0, Title = model.HelpCategoryTitle, Url = "", Description = "", DisplayOrder = model.DisplayOrder }; AdminHelps.CreateHelp(helpInfo); AddMallAdminLog("添加帮助分类", "添加帮助分类,帮助分类为:" + model.HelpCategoryTitle); return PromptView("帮助分类添加成功"); } ViewData["referer"] = MallUtils.GetMallAdminRefererCookie(); return View(model); }
public ActionResult AddHelp(HelpModel model) { if (ModelState.IsValid) { HelpInfo helpInfo = new HelpInfo() { Pid = model.Pid, Title = model.HelpTitle, Url = model.Url == null ? "" : model.Url, Description = model.Description ?? "", DisplayOrder = model.DisplayOrder }; AdminHelps.CreateHelp(helpInfo); AddMallAdminLog("添加帮助", "添加帮助,帮助为:" + model.HelpTitle); return PromptView("帮助添加成功"); } Load(); return View(model); }
/// <summary> /// 更新帮助 /// </summary> public void UpdateHelp(HelpInfo helpInfo) { DbParameter[] parms = { GenerateInParam("@pid", SqlDbType.Int, 4, helpInfo.Pid), GenerateInParam("@title", SqlDbType.NChar,60,helpInfo.Title), GenerateInParam("@url", SqlDbType.NChar,200,helpInfo.Url), GenerateInParam("@description", SqlDbType.NText, 0, helpInfo.Description), GenerateInParam("@displayorder", SqlDbType.Int,4,helpInfo.DisplayOrder), GenerateInParam("@id", SqlDbType.Int, 4, helpInfo.Id) }; string commandText = string.Format("UPDATE [{0}helps] SET [pid]=@pid,[title]=@title,[url]=@url,[description]=@description,[displayorder]=@displayorder WHERE [id]=@id", RDBSHelper.RDBSTablePre); RDBSHelper.ExecuteNonQuery(CommandType.Text, commandText, parms); }
/// <summary> /// 创建帮助 /// </summary> public void CreateHelp(HelpInfo helpInfo) { DbParameter[] parms = { GenerateInParam("@pid", SqlDbType.Int, 4, helpInfo.Pid), GenerateInParam("@title", SqlDbType.NChar,60,helpInfo.Title), GenerateInParam("@url", SqlDbType.NChar,200,helpInfo.Url), GenerateInParam("@description", SqlDbType.NText, 0, helpInfo.Description), GenerateInParam("@displayorder", SqlDbType.Int,4,helpInfo.DisplayOrder) }; string commandText = string.Format("INSERT INTO [{0}helps]([pid],[title],[url],[description],[displayorder]) VALUES(@pid,@title,@url,@description,@displayorder)", RDBSHelper.RDBSTablePre); RDBSHelper.ExecuteNonQuery(CommandType.Text, commandText, parms); }
/// <summary> /// 更新帮助 /// </summary> public static void UpdateHelp(HelpInfo helpInfo) { BrnMall.Core.BMAData.RDBS.UpdateHelp(helpInfo); }
/// <summary> /// 更新帮助 /// </summary> public static void UpdateHelp(HelpInfo helpInfo) { BrnMall.Data.Helps.UpdateHelp(helpInfo); BrnMall.Core.BMACache.Remove(CacheKeys.MALL_HELP_LIST); }