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()); }
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) })); }