public void UpdateClientInfo(ClientInfoDTO client) { if (client != null) { ClientPersons clientDB = new ClientPersons(); clientDB.id = client.Id; clientDB.name = client.Name; clientDB.email = client.Email; _mng.UpdateClientPersons(clientDB); } }
public ClientCompanyDTO GetClientInfo(Guid clientID) { ClientCompanyDTO clientInfo = new ClientCompanyDTO(); ClientPersons clientDB = _mng.GetClient(clientID); if (clientDB != null) { Companies companyDB = _mng.GetCompany(clientDB.companyID); if (companyDB != null) { clientInfo.Id = companyDB.id; clientInfo.Name = companyDB.name; IList <ClientCompanyPhoneDTO> phoneList = new List <ClientCompanyPhoneDTO>(); List <ClientPersonPhoneNumbbers> phoneListDB = _mng.GetClientPhonesList(clientID); if (phoneListDB != null && phoneListDB.Count != 0) { foreach (var phone in phoneListDB) { phoneList.Add(new ClientCompanyPhoneDTO() { PhoneCode = phone.operatorCode, PhoneNumber = phone.phoneNum }); } } clientInfo.ClientPersonsList = new List <ClientInfoDTO>(); clientInfo.ClientPersonsList.Add(new ClientInfoDTO() { Name = clientDB.name, Email = clientDB.email, CompanyPhonesList = phoneList }); } } return(clientInfo); }