public IHttpActionResult EditContractor(ContractorUserDTO edited)
 {
     _contractorService.EditContractor(edited);
     if (ModelState.IsValid)
     {
         return(Ok());
     }
     else
     {
         return(BadRequest());
     }
 }
Exemplo n.º 2
0
        public void EditContractor(ContractorUserDTO edited)
        {
            var contractor = _userRepo.GetSpecificContractor(edited.Id);

            contractor.Name         = edited.Name;
            contractor.Title        = edited.Title;
            contractor.CompanyName  = edited.CompanyName;
            contractor.Email        = edited.Email;
            contractor.PhoneNumber  = edited.PhoneNumber;
            contractor.PhoneNumber2 = edited.PhoneNumber2;

            _userRepo.SaveChanges();
        }
Exemplo n.º 3
0
        public ContractorUserDTO GetContractorForEdit(string id)
        {
            var contractor = _userRepo.GetSpecificContractor(id);

            var dto = new ContractorUserDTO()
            {
                Id           = contractor.Id,
                Name         = contractor.Name,
                Title        = contractor.Title,
                CompanyName  = contractor.CompanyName,
                Email        = contractor.Email,
                PhoneNumber  = contractor.PhoneNumber,
                PhoneNumber2 = contractor.PhoneNumber2,
            };

            return(dto);
        }