public ActionResult Save(ModelInfoViewModel model) { var modelDto = new DtoModel { Id = model.Id, Name = model.Name, BrandId = model.BrandId }; _modelService.SaveModel(modelDto); return(RedirectToAction("Details", "Brand", new { @brandId = model.BrandId })); }
public ActionResult Edit(int brandedModelId) { var brandedModel = _modelService.GetModel(brandedModelId); var model = new ModelInfoViewModel { Id = brandedModel.Id, Name = brandedModel.Name, BrandId = brandedModel.BrandId }; ViewBag.Title = "Редактирование модели автомобиля"; return(View(model)); }
public void Init(PFE.Model.Model model, MainForm main) { viewModel = new ModelInfoViewModel(model, main); loadExistingSurveys(); textBoxEvaluationContext.DataBindings.Add("Text", viewModel.model, "evaluationContext", true, DataSourceUpdateMode.OnPropertyChanged); }