Adding value from two Combobox to listbox

  • Thread starter Thread starter Patrykk1797
  • Start date Start date
P

Patrykk1797

Guest
Hi, I would like to add value from combobox depending on the value from second. For example if I select from one "Individual salary Report" and on the second ID5, the program will take salary from SalaryID5. I don't know which method to use on this program. The effect of the end should display messagebox "Salary for ID5 is ...."


namespace WpfApp1
{
/// <summary>
/// Logika interakcji dla klasy MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
DataContext = this;
Users = new List<ReportPanel>
{


new ReportPanel {ID = "1"},
new ReportPanel {ID = "2"},
new ReportPanel {ID = "3"},
new ReportPanel {ID = "4"},
new ReportPanel {ID = "5"},
new ReportPanel {ID = "6"},
new ReportPanel {ID = "7"},
new ReportPanel {ID = "8"},
new ReportPanel {ID = "9"},
new ReportPanel {ID = "10"},
};

DataContext = this;
Reports = new List<ReportGenerator>
{
new ReportGenerator {Report = "Salaries Report" , EmountSA = 77500,},
new ReportGenerator {Report = "All Movies Report", EmountAMR = 560},
new ReportGenerator {Report = "Incomes Report", EmountIR = 4000},
new ReportGenerator {Report = "Food Sale Report", EmountFSR = 19000},
new ReportGenerator {Report = "Salary Report", EmountSR = 35000 },
new ReportGenerator {Report = "Individual Work Time Report",
WorkTimeID1 =150,
WorkTimeID2= 160,
WorkTimeID3= 168,
WorkTimeID4= 161,
WorkTimeID5= 159,
WorkTimeID6= 184,
WorkTimeID7= 70,
WorkTimeID8= 188,
WorkTimeID9= 162,
WorkTimeID10= 169,

},

new ReportGenerator {Report = "Individual Salary Report",
SalaryID1 = 2150,
SalaryID2 = 3150,
SalaryID3 = 2450,
SalaryID4 = 2250,
SalaryID5 = 2100,
SalaryID6 = 2400,
SalaryID7 = 1550,
SalaryID8 = 3000,
SalaryID9 = 2850,
SalaryID10 = 2900,

},

};


}
public List<ReportGenerator> Reports { get; set; }

public List<ReportPanel> Users { get; set; }


private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{

}



private void ComboBox_SelectionChanged_1(object sender, SelectionChangedEventArgs e)
{

}

private void Button_Click(object sender, RoutedEventArgs e)
{




}
}


}

Continue reading...
 
Back
Top