public ActionResult AddProductConsultType(ProductConsultTypeModel model) { if (ModelState.IsValid) { ProductConsultTypeInfo productConsultTypeInfo = new ProductConsultTypeInfo() { Title = model.Title, DisplayOrder = model.DisplayOrder }; AdminProductConsults.CreateProductConsultType(productConsultTypeInfo); AddAdminOperateLog("添加商品咨询类型", "添加商品咨询类型,商品咨询类型为:" + model.Title.Trim()); return PromptView("商品咨询类型添加成功"); } ViewData["referer"] = ShopUtils.GetAdminRefererCookie(); return View(model); }
/// <summary> /// 更新商品咨询类型 /// </summary> public void UpdateProductConsultType(ProductConsultTypeInfo productConsultTypeInfo) { DbParameter[] parms = { GenerateInParam("@title", SqlDbType.NChar,30,productConsultTypeInfo.Title), GenerateInParam("@displayorder", SqlDbType.Int,4,productConsultTypeInfo.DisplayOrder), GenerateInParam("@consulttypeid", SqlDbType.TinyInt, 1, productConsultTypeInfo.ConsultTypeId) }; string commandText = string.Format("UPDATE [{0}productconsulttypes] SET [title]=@title,[displayorder]=@displayorder WHERE [consulttypeid]=@consulttypeid", RDBSHelper.RDBSTablePre); RDBSHelper.ExecuteNonQuery(CommandType.Text, commandText, parms); }
/// <summary> /// 创建商品咨询类型 /// </summary> public void CreateProductConsultType(ProductConsultTypeInfo productConsultTypeInfo) { DbParameter[] parms = { GenerateInParam("@title", SqlDbType.NChar,30,productConsultTypeInfo.Title), GenerateInParam("@displayorder", SqlDbType.Int,4,productConsultTypeInfo.DisplayOrder) }; string commandText = string.Format("INSERT INTO [{0}productconsulttypes]([title],[displayorder]) VALUES(@title,@displayorder)", RDBSHelper.RDBSTablePre); RDBSHelper.ExecuteNonQuery(CommandType.Text, commandText, parms); }