Beispiel #1
0
 private void updateAccessDB()
 {
     //dgvAccessInfo.DataSource = m_accessDB.GetAccessInfoDBTable(m_user.Id);
     dgvAccessInfo.DataSource = m_accessDB.GetAccessInfoDBTable(m_user.Id, currentPage, GetPageCount());
     dgvAccessInfo.Refresh();
     total = Int32.Parse(dgvAccessInfo.Rows[0].Cells["count"].Value.ToString());
 }
Beispiel #2
0
 private void RebindGridForPageChange(string keyword)
 {
     total = 0;
     try
     {
         DataTable tmp;
         if (tabAvg.IsSelected)
         {
             tmp = m_avrMgr.SelectAccessHistoryInfo(dtpAvgDate.SelectedDate.Value);
             dgvAvgInfo.ItemsSource = tmp.DefaultView;
         }
         else if (tabAccess.IsSelected)
         {
             //dt = m_userDB.GetUserDBTable(keyword, currentPage, GetPageCount());
             //dgvAccessUser.DataSource = dt;
             //dgvAccessUser.Refresh();
             //total = Int32.Parse(dgvAccessUser.Rows[0].Cells["count"].Value.ToString());
             tmp = m_accessDB.GetAccessInfoDBTable(m_user.Id, currentPage, GetPageCount());
             dgvAccessInfo.ItemsSource = tmp.DefaultView;
             Total = Int32.Parse(tmp.Rows[0].ItemArray[6].ToString());
         }
         else if (tabUser.IsSelected)
         {
             tmp = m_userDB.GetUserDBTable(keyword, currentPage, GetPageCount());
             dgvUser.ItemsSource = tmp.DefaultView;
             Total = Int32.Parse(tmp.Rows[0].ItemArray[6].ToString());
         }
         else if (tabCar.IsSelected)
         {
             tmp = m_carDB.GetCarInfoDBTable(keyword, currentPage, GetPageCount());
             dgvCar.ItemsSource = tmp.DefaultView;
             Total = Int32.Parse(tmp.Rows[0].ItemArray[3].ToString());
         }
         else if (tabHistory.IsSelected)
         {
             tmp = m_historyDB.GetAccessHisDBTable(keyword, currentPage, GetPageCount());
             dgvHistory.ItemsSource = tmp.DefaultView;
             Total = Int32.Parse(tmp.Rows[0].ItemArray[5].ToString());
         }
         pageTotal = Convert.ToInt32(Math.Ceiling(Total * 1.0 / ((GetPageCount()) < 1 ? 1 : GetPageCount())));
     }
     catch (Exception e)
     {
         Console.WriteLine(e.Message);
     }
 }