/// <summary> /// 一级分类 /// </summary> /// <returns></returns> public ActionResult Index() { ViveViewModel viewmode = new ViveViewModel(); viewmode.TopSorts = SortService.GetEntities(s => s.UpCode != null); return(View(viewmode)); }
/// <summary> /// 二级分类 /// </summary> /// <param name="upcode"></param> /// <returns></returns> public ActionResult ChiSort(string upcode) { ViveViewModel viewmode = new ViveViewModel(); //Contains 匹配数据库中是否出现的字符 相当于模糊查询 viewmode.LowSorts = SortService.GetEntities(r => r.Code.Contains(upcode)); return(View(viewmode)); }
public string sp_joinshopcart(ViveViewModel viewModel) { SqlParameter msg = new SqlParameter { ParameterName = "@msg", Direction = ParameterDirection.Output, Size = 50, SqlDbType = SqlDbType.NVarChar }; SqlParameter[] sqlpar = { new SqlParameter("@id", viewModel), new SqlParameter("@qq", viewModel) }; _dbContext.Database.ExecuteSqlCommand("exec sp_joinshopcart", sqlpar); return(msg.Value.ToString()); }