コード例 #1
0
    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();
        }
    }
コード例 #2
0
 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();
         }
     }
 }