コード例 #1
0
        public ActionResult Index()
        {
            var model = new CarFormStub();

            model.FillCarModelOptions(RepoCarModel.FindAll());
            model.FillCarBrandOptions(RepoCarBrand.FindAll());

            ViewBag.ListBrand        = new JavaScriptSerializer().Serialize(model.CarBrandOptions);
            ViewBag.ListModel        = new JavaScriptSerializer().Serialize(model.CarModelOptions);
            ViewBag.ListTransmission = new JavaScriptSerializer().Serialize(model.CarTransmissionOptions);
            ViewBag.ListModelYear    = new JavaScriptSerializer().Serialize(model.YearOptions);

            return(View());
        }
コード例 #2
0
        public string Binding()
        {
            //kamus
            GridRequestParameters param = GridRequestParameters.Current;

            List <car_brand> items = RepoCarBrand.FindAll(param.Skip, param.Take, (param.Sortings != null ? param.Sortings.ToList() : null), param.Filters);
            int total = RepoCarBrand.Count(param.Filters);

            return(new JavaScriptSerializer().Serialize(new { total = total, data = new CarBrandPresentationStub().MapList(items) }));
        }