Example #1
0
 private void update_member()
 {
     if (comboBox1.SelectedItem != null & dateTimePicker1.Value != null)
     {
         decimal id_khu_san = v_current_id_khu_San;
         string time = string.Format("{0:yyyy/MM/dd}", v_current_date);
         MyNetwork.requestChiTietSan(id_khu_san, time, (object data) =>
         {
             this.Invoke(new Action(() =>
             {
                 var san = new ChiTietSan();
                 san = (ChiTietSan)data;
                 v_list_san = san.Data;
                 draw_grid();
             }));
         });
         this.Text = "Lịch đặt sân ngày " + string.Format("{0:dd/MM/yyy}", dateTimePicker1.Value);
     }
 }
 private void update_list_san_co_the_dat()
 {
     if (id_khu_san != 0)
     {
         MyNetwork.requestChiTietSan(id_khu_san, string.Format("{0:yyyy/MM/dd}", ngay_da), (object data) =>
         {
             this.Invoke(new Action(() =>
             {
                 v_list_san_co_the_dat = new List<San>();
                 var khuSan = new LibraryApi.ChiTietSan();
                 khuSan = (LibraryApi.ChiTietSan)data;
                 List<List<Dictionary<string, object>>> list_ks = new List<List<Dictionary<string, object>>>();
                 list_ks = (List<List<Dictionary<string, object>>>)khuSan.Data;
                 foreach (List<Dictionary<string, object>> item in list_ks)
                 {
                     KhungGio kg =(KhungGio)comb_khung_gio.SelectedItem;
                     if (item[kg.id]["ten_khach_hang"].ToString() == "")
                     {
                         v_list_san_co_the_dat.Add(new San(item[0]["ten_san"].ToString(), item[1]["id_san"].ToString()));
                     }
                 }
                 data_to_san_co_the_dat();
             }));
         });
     }
 }