private void LoadData(PilihanWaitingList pilihan) { DropDownListPilihanWaitingList.SelectedValue = ((int)pilihan).ToString(); using (DataClassesDatabaseDataContext db = new DataClassesDatabaseDataContext()) { RepeaterWaitingList.DataSource = db.TBWaitingLists .Where(item => item.EnumStatusReservasi == (int)pilihan) .OrderBy(item => item.TanggalMasuk) .ToArray(); RepeaterWaitingList.DataBind(); } }
protected void DropDownListPilihanWaitingList_SelectedIndexChanged(object sender, EventArgs e) { if (DropDownListPilihanWaitingList.SelectedValue != "0") { LoadData((PilihanWaitingList)Parse.Int(DropDownListPilihanWaitingList.SelectedValue)); } else { using (DataClassesDatabaseDataContext db = new DataClassesDatabaseDataContext()) { RepeaterWaitingList.DataSource = db.TBWaitingLists .OrderBy(item => item.TanggalMasuk) .ToArray(); RepeaterWaitingList.DataBind(); } } }