public ActionResult TypeListByCar(string t, string b, string m, string y) { string tid = HttpUtility.HtmlEncode(t); string bb = HttpUtility.HtmlEncode(b); string mm = HttpUtility.HtmlEncode(m); string yy = HttpUtility.HtmlEncode(y); Cparts_Service.CarBll carBll = new Cparts_Service.CarBll(); DAO.CarM carinfo = carBll.GetModel(bb, mm, yy); TypeListByCarViewModel vm = new TypeListByCarViewModel(); ProductBll proBll = new ProductBll(); if (carinfo != null) { vm.childenrCate = proBll.GetChildenCateListByType(t, carinfo.id.ToString()); } if (t == "-1") { CommonModule.CommonBll bll = new CommonModule.CommonBll(); vm.topCate = bll.GetList(); } vm.parentCate = proBll.GetParentCateListByType(t); vm.Carinfo = carinfo; return(View(vm)); }
public ActionResult cList(string t, string b, string m, string y, string h) { if (b == "0" && m == "0" && y == "0" && h != "0") { ProductBll proList = new ProductBll(); ProductList list = proList.GetListByType(t, null, h); return(View("~/Views/Product/pList.cshtml", list)); } string tid = HttpUtility.HtmlEncode(t); string bb = HttpUtility.HtmlEncode(b); string mm = HttpUtility.HtmlEncode(m); string yy = HttpUtility.HtmlEncode(y); Cparts_Service.CarBll carBll = new Cparts_Service.CarBll(); DAO.CarM carinfo = carBll.GetModel(bb, mm, yy); TypeListByCarViewModel vm = new TypeListByCarViewModel(); ProductBll proBll = new ProductBll(); if (carinfo != null) { vm.childenrCate = proBll.GetChildenCateListByType(t, carinfo.id.ToString()); } if (vm.childenrCate.Count > 0) { CommonModule.CommonBll bll = new CommonModule.CommonBll(); vm.topCate = bll.GetList(); vm.parentCate = proBll.GetParentCateListByType(t); vm.Carinfo = carinfo; return(View(vm)); } else { ProductBll proList = new ProductBll(); ProductList list = proList.GetListByType(t, carinfo.id.ToString(), null); return(View("~/Views/Product/pList.cshtml", list)); } }