Exemple #1
0
        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
     });
 }
Exemple #3
0
        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"));
            }
        }
Exemple #4
0
 public ResponseBase CreateFounder(FounderFullModel model)
 {
     founderService.Create(entityConverter.GetDto(model));
     return(new ResponseBase());
 }