public void DataBinding() { //Hämta frånvaro typer attendancecategories = DbOperations.GetAttendances(); comboBoxAbscence.ItemsSource = attendancecategories; comboBoxAbscence.DisplayMemberPath = "Fullinformation"; comboBoxAbscence.SelectedIndex = 0; //Hämta veckor weeks = DbOperations.GetWeek(); comboBoxWeek.ItemsSource = weeks; comboBoxWeek.DisplayMemberPath = "InformationWeek"; //Hämta dagar Weeks week = new Weeks(); week.Week = 1; dates = DbOperations.GetDays(week); comboBoxDay.ItemsSource = dates; comboBoxDay.DisplayMemberPath = "InformationDay"; }
private void ComboBoxWeek_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (comboBoxWeek.SelectedItem != null) { Weeks week = (Weeks)comboBoxWeek.SelectedItem; dates = DbOperations.GetDays(week); comboBoxDay.ItemsSource = dates; comboBoxDay.DisplayMemberPath = "InformationDay"; } }
//Hämtar alla datum public static List <Date> GetDays(Weeks week) { var weeks = week.Week; using (IDbConnection connection = new NpgsqlConnection(ConnString.ConnVal("dbConn"))) { var output = connection.Query <Date>($@"SELECT dates.id, week, dates.day FROM dates WHERE week=@Week GROUP BY dates.id, week, dates.day ORDER BY dates.id ASC", new { Week = weeks }).ToList(); return(output); } }
public void DataBinding() { //Hämta barn children = DbOperations.GetChildrenOfGuardian(); comboBoxChildren.ItemsSource = children; comboBoxChildren.DisplayMemberPath = "Fullinformation"; comboBoxChildren.SelectedIndex = 0; //Hämta barn se children = DbOperations.GetChildrenOfGuardian(); comboBoxChildren2.ItemsSource = children; comboBoxChildren2.DisplayMemberPath = "Fullinformation"; comboBoxChildren2.SelectedIndex = 0; //Hämta frånvaro typer attendancecategories = DbOperations.GetAttendances(); comboBoxAbscence.ItemsSource = attendancecategories; comboBoxAbscence.DisplayMemberPath = "Fullinformation"; comboBoxAbscence.SelectedIndex = 0; //Hämta veckor weeks = DbOperations.GetWeek(); comboBoxWeek.ItemsSource = weeks; comboBoxWeek.DisplayMemberPath = "InformationWeek"; //Hämta dagar Weeks week = new Weeks(); week.Week = 1; dates = DbOperations.GetDays(week); comboBoxDay.ItemsSource = dates; comboBoxDay.DisplayMemberPath = "InformationDay"; Activechild.Setactivechild((Child)comboBoxChildren.SelectedItem); }
public void DataBinding() { //Hämta barn children = DbOperations.GetChildrenOfGuardian(); comboBoxChildren.ItemsSource = children; comboBoxChildren.DisplayMemberPath = "Fullinformation"; comboBoxChildren.SelectedIndex = 0; comboBoxChildMeals.ItemsSource = children; comboBoxChildMeals.DisplayMemberPath = "Fullinformation"; comboBoxChildMeals.SelectedIndex = 0; comboBoxChildren2.ItemsSource = children; comboBoxChildren2.DisplayMemberPath = "Fullinformation"; comboBoxChildren2.SelectedIndex = 0; //Hämta veckor weeks = DbOperations.GetWeek(); comboBoxWeek.ItemsSource = weeks; comboBoxWeek.DisplayMemberPath = "InformationWeek"; //Hämta dagar Weeks week = new Weeks(); week.Week = 1; dates = DbOperations.GetDays(week); comboBoxDay.ItemsSource = dates; comboBoxDay.DisplayMemberPath = "InformationDay"; //Hämta Morgon/Kväll attendancecategories = DbOperations.GetFritidsMorningEvening(); comboBoxType.ItemsSource = attendancecategories; comboBoxType.DisplayMemberPath = "Fullinformation"; }