コード例 #1
0
        public ActionResult Edit(string cid)
        {
            ViewBag.Brands      = BrandService.GetBrandAll().Where(t => t.IsUse == 1).ToList();
            ViewBag.Store       = StoreService.GetStoreAll().Where(t => t.Status == 1).ToList();
            ViewBag.CarModel    = BaseDataService.GetBaseDataAll().Where(t => t.PCode == "C00" && t.Status == 1).ToList();
            ViewBag.MaxPicCount = ConfigurationManager.AppSettings["MaxPicCount"].ToString();
            if (!string.IsNullOrEmpty(cid))
            {
                ViewBag.Car = CarService.GetCarEntityById(cid.ToLong(0));
            }
            else
            {
                ViewBag.Car = new CarEntity();
            }

            return(View());
        }
コード例 #2
0
        public ActionResult Index(string name, int status = -1)
        {
            List <BrandEntity> mList = null;

            if (!string.IsNullOrEmpty(name) || status > -1)
            {
                mList = BrandService.GetBrandByRule(name, status);
            }
            else
            {
                mList = BrandService.GetBrandAll();
            }
            ViewBag.Brands = mList;
            ViewBag.Name   = name ?? "";
            ViewBag.Status = status;
            return(View());
        }