// Fill the combobox based on the combobox type public ObservableCollection <string> FillCombobox(ComboboxType type) { ObservableCollection <string> comboboxItems = new ObservableCollection <string>(); using (SQLiteConnection connection = new SQLiteConnection(connString)) { connection.Open(); if (type == ComboboxType.Afdeling) { string query = "SELECT Department FROM Device GROUP BY Department"; SQLiteCommand command = new SQLiteCommand(query, connection); SQLiteDataReader dr = command.ExecuteReader(); while (dr.Read()) { comboboxItems.Add(dr["Department"].ToString()); } } else if (type == ComboboxType.DeviceType) { string query = "SELECT Name FROM DeviceType"; SQLiteCommand command = new SQLiteCommand(query, connection); SQLiteDataReader dr = command.ExecuteReader(); while (dr.Read()) { comboboxItems.Add(dr["Name"].ToString()); } } else if (type == ComboboxType.DeviceTypeAll) { string query = "SELECT Name FROM DeviceType"; SQLiteCommand command = new SQLiteCommand(query, connection); SQLiteDataReader dr = command.ExecuteReader(); comboboxItems.Add("Alle device-types"); while (dr.Read()) { comboboxItems.Add(dr["Name"].ToString()); } } else if (type == ComboboxType.Medewerker) { string query = "SELECT Voornaam FROM Medewerker"; SQLiteCommand command = new SQLiteCommand(query, connection); SQLiteDataReader dr = command.ExecuteReader(); while (dr.Read()) { comboboxItems.Add(dr["Voornaam"].ToString()); } } } return(comboboxItems); }
// Fill the combobox based on the combobox type public static ObservableCollection <string> FillCombobox(ComboboxType type) { ObservableCollection <string> comboboxItems = new ObservableCollection <string>(); if (type == ComboboxType.Status) { comboboxItems = new ObservableCollection <string>(); comboboxItems.Add("Open"); comboboxItems.Add("In behandeling"); comboboxItems.Add("Afgehandeld"); } else if (type == ComboboxType.StatusAll) { comboboxItems = new ObservableCollection <string>(); comboboxItems.Add("Alle storingen"); comboboxItems.Add("Open"); comboboxItems.Add("In behandeling"); comboboxItems.Add("Afgehandeld"); } else if (type == ComboboxType.Employee) { // EmployeeDataService employeeDataService = new EmployeeDataService(); // comboboxItems = employeeDataService.GetAllEmployees(); } else if (type == ComboboxType.PrioritySeverity) { comboboxItems = new ObservableCollection <string>(); comboboxItems.Add("0"); comboboxItems.Add("1"); comboboxItems.Add("2"); comboboxItems.Add("3"); } return(comboboxItems); }
public ObservableCollection <string> GetComboboxItemsByComboboxType(ComboboxType type) { throw new NotImplementedException(); }
public ObservableCollection <string> FillCombobox(ComboboxType type) { //return conn.FillCombobox(type); return(_problemRepository.GetComboboxItemsByComboboxType(type)); }