public IndividualClientInfo() { InitializeComponent(); GetAllIndividualClients command = new GetAllIndividualClients(); List <Individual> individualList = command.getAllIndividualInfo(); name.Items.AddRange(individualList.ToArray()); }
private void clientType_SelectedIndexChanged(object sender, EventArgs e) { if (clientType.SelectedItem.Equals("юр. лицо")) { name.Text = "Выберите компанию"; name.Items.Clear(); GetAllLegalClientsInfo command = new GetAllLegalClientsInfo(); List <LegalPerson> legalPersonList = command.getAllLegalPersonInfo(); name.Items.AddRange(legalPersonList.ToArray()); } if (clientType.SelectedItem.Equals("физ. лицо")) { name.Text = "Выберите ФИО"; name.Items.Clear(); GetAllIndividualClients command = new GetAllIndividualClients(); List <Individual> individualList = command.getAllIndividualInfo(); name.Items.AddRange(individualList.ToArray()); } }
private void clientType_SelectedIndexChanged(object sender, EventArgs e) { groupBoxIndividual.Visible = false; groupBoxLegal.Visible = false; if (clientType.SelectedItem.Equals("юр. лицо")) { groupBoxLegal.Visible = true; //add all legal client's companies to dropdown GetAllLegalClientsInfo command1 = new GetAllLegalClientsInfo(); List <LegalPerson> legalPersonList = command1.getAllLegalPersonInfo(); companyComboBox.Items.AddRange(legalPersonList.ToArray()); //add all police categories GetAllInsuranceCategoriesCommand command2 = new GetAllInsuranceCategoriesCommand(); List <InsuranceCategory> categoryList = command2.getAllInsuranceCategories(); policeCategoryComboBox.Items.AddRange(categoryList.ToArray()); //add insurer names to dropdown GetAllInsurers command3 = new GetAllInsurers(); List <Insurer> insurerList = command3.getAllInsurers(); insurerComboBox.Items.AddRange(insurerList.ToArray()); } if (clientType.SelectedItem.Equals("физ. лицо")) { groupBoxIndividual.Visible = true; //add all individual clients fsl to dropdown GetAllIndividualClients command1 = new GetAllIndividualClients(); List <Individual> individualList = command1.getAllIndividualInfo(); fslNameIndividualComboBox.Items.AddRange(individualList.ToArray()); //add all police categories GetAllInsuranceCategoriesCommand command2 = new GetAllInsuranceCategoriesCommand(); List <InsuranceCategory> categoryList = command2.getAllInsuranceCategories(); policeCategoryIndividualComboBox.Items.AddRange(categoryList.ToArray()); //add insurer names to dropdown GetAllInsurers command3 = new GetAllInsurers(); List <Insurer> insurerList = command3.getAllInsurers(); insurerIdIndividualComboBox.Items.AddRange(insurerList.ToArray()); } }