public FormNewInsuranceCase() { InitializeComponent(); GetAllInsuranceCategoriesCommand command = new GetAllInsuranceCategoriesCommand(); List <InsuranceCategory> categoryList = command.getAllInsuranceCategories(); insurancePoliceDropDown.Items.AddRange(categoryList.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()); } }