Esempio n. 1
0
 private void Search()
 {
     try
     {
         tempInput           = searchPersonNivyInputControl1.GetInput();
         personNivyData      = dcoreSearch.GetSearchPersonNivyTemplate(tempInput, itemsPerPage, page, out count);
         gvResult.DataSource = personNivyData;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Esempio n. 2
0
        private void Search()
        {
            try
            {
                if (!tempInput.CheckSameValue(inputSearch.GetInput()))
                {
                    tempInput           = inputSearch.GetInput();
                    personNivyData      = dcore.GetSearchPersonNivyTemplate(tempInput, itemsPerPage, page, out count);
                    gvResult.DataSource = personNivyData;
                }
                else
                {
                    tempInput           = inputSearch.GetInput();
                    personNivyData      = dcore.GetSearchPersonNivyTemplate(tempInput, itemsPerPage, page, out count);
                    gvResult.DataSource = personNivyData;
                }

                if (count <= itemsPerPage)
                {
                    totalPage = Function.CalTotalPage(count, itemsPerPage);
                    labelCountSearchRecord.Text = Convert.ToString(count) + " Record(s)";
                    labelPaging.Text            = page.ToString() + "/" + totalPage.ToString();
                }
                else
                {
                    totalPage = Function.CalTotalPage(count, itemsPerPage);
                    labelCountSearchRecord.Text = Convert.ToString((page * itemsPerPage) - itemsPerPage + 1) + " - " + Convert.ToString(page * itemsPerPage) + " of " + Convert.ToString(count) + " Record(s)";
                    labelPaging.Text            = page.ToString() + "/" + totalPage.ToString();
                }
                EnableButtonPage();
                gvResult.Focus();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }