public Offers() { InitializeComponent(); _offersApiClient = new OffersApiClient(); dt = new DataTable(); AddColumns(); _clientApiClient = new ClientApiClient(); _realtorApiClient = new RealtorApiClient(); _realtiesApiClient = new RealtiesApiClient(); List <ClientEntity> clientEntities = _clientApiClient.GetClients(); client.DataSource = clientEntities; client.DisplayMember = "GetInitials"; client.ValueMember = "id"; List <RealtorEntity> realtorEntities = _realtorApiClient.GetRealtors(); realtor.DataSource = realtorEntities; realtor.DisplayMember = "GetInitials"; realtor.ValueMember = "id"; List <RealtyTypeEntity> realtyTypeEntities = _realtiesApiClient.GetTypes(); realtyTypeEntities.Remove(realtyTypeEntities.Find(x => x.Id == 4)); type.DataSource = realtyTypeEntities; type.DisplayMember = "Name"; type.ValueMember = "Id"; List <ClientEntity> comboClientEntities = _clientApiClient.GetClients(); comboClientEntities.Add(new ClientEntity { name = " ", id = 0, patronymic = " ", surname = "Любой", phone = " ", email = " " }); comboClient.DataSource = comboClientEntities; comboClient.DisplayMember = "GetInitials"; comboClient.ValueMember = "id"; var comboRealtorEntities = _realtorApiClient.GetRealtors(); comboRealtorEntities.Add(new RealtorEntity { name = " ", id = 0, part_percentage = 0, patronymic = " ", surname = "Любой" }); rieltor.DataSource = comboRealtorEntities; rieltor.DisplayMember = "GetInitials"; rieltor.ValueMember = "id"; }
public OffersAdd(Offers owner) { InitializeComponent(); _offers = owner; FormClosing += OffersAdd_FormClosing; _offersApiClient = new OffersApiClient(); _clientApiClient = new ClientApiClient(); _realtorApiClient = new RealtorApiClient(); _realtiesApiClient = new RealtiesApiClient(); List <ClientEntity> clientEntities = _clientApiClient.GetClients(); client.DataSource = clientEntities; client.DisplayMember = "GetInitials"; client.ValueMember = "id"; List <RealtorEntity> realtorEntities = _realtorApiClient.GetRealtors(); realtor.DataSource = realtorEntities; realtor.DisplayMember = "GetInitials"; realtor.ValueMember = "id"; List <RealtyTypeEntity> realtyTypeEntities = _realtiesApiClient.GetTypes(); type.DataSource = realtyTypeEntities; type.DisplayMember = "Name"; type.ValueMember = "Id"; }
private void InitCombos() { List <ClientEntity> clientEntities = _clientApiClient.GetClients(); client.DataSource = clientEntities; client.DisplayMember = "GetInitials"; client.ValueMember = "id"; List <RealtorEntity> realtorEntities = _realtorApiClient.GetRealtors(); realtor.DataSource = realtorEntities; realtor.DisplayMember = "GetInitials"; realtor.ValueMember = "id"; List <RealtyTypeEntity> realtyTypeEntities = _realtiesApiClient.GetTypes(); type.DataSource = realtyTypeEntities; type.DisplayMember = "Name"; type.ValueMember = "Id"; List <ClientEntity> comboClientEntities = _clientApiClient.GetClients(); comboClientEntities.Add(new ClientEntity { name = " ", id = 0, patronymic = " ", surname = "Любой", phone = " ", email = " " }); comboClient.DataSource = comboClientEntities; comboClient.DisplayMember = "GetInitials"; comboClient.ValueMember = "id"; List <RealtorEntity> comboRealtorEntities = _realtorApiClient.GetRealtors(); comboRealtorEntities.Add(new RealtorEntity { name = " ", id = 0, part_percentage = 0, patronymic = " ", surname = "Любой" }); rieltor.DataSource = comboRealtorEntities; rieltor.DisplayMember = "GetInitials"; rieltor.ValueMember = "id"; }