public IActionResult Open(Guid id) { ViewBag.Companies = new MultiSelectList(dataManager.GetAllCompanies().Items, "Id", "Value"); FounderFullModel putModel = dataManager.GetFounderPutModel(id); return(View("Edit", putModel)); }
public FounderDto GetDto(FounderFullModel model) { return(new FounderDto() { Id = model.Id, FirstName = model.FirstName, LastName = model.LastName, MiddleName = model.MiddleName ?? string.Empty, Tin = model.Tin, RelatedCompaniesIds = model.CompaniesIds }); }
public IActionResult Edit(FounderFullModel model) { ViewBag.Companies = new MultiSelectList(dataManager.GetAllCompanies().Items, "Id", "Value"); IList <ValidationResult> results = new List <ValidationResult>(); ValidationContext context = new ValidationContext(model); if (!Validator.TryValidateObject(model, context, results, true)) { return(View(model)); } else { dataManager.UpdateFounder(model); return(RedirectToAction("Index")); } }
public ResponseBase CreateFounder(FounderFullModel model) { founderService.Create(entityConverter.GetDto(model)); return(new ResponseBase()); }