示例#1
0
    //--------------------------------------------------------------------------------

    private void ShowGrid()
    {
        try
        {
            ProductTypes m_ProductTypes = new ProductTypes();
            m_ProductTypes.ProductTypeName = txtSearch.Text;
            string DateFrom = txtDateFrom.Text;
            string DateTo   = txtDateTo.Text;
            int    RowCount = 0;
            List <ProductTypes> l_ProductTypes = m_ProductTypes.GetPage("", "", ddlOrderBy.SelectedValue, m_grid.PageSize, CustomPaging.PageIndex - 1, ref RowCount);

            m_grid.DataSource = l_ProductTypes;
            m_grid.DataBind();
            lblTong.Text           = RowCount.ToString();
            CustomPaging.TotalPage = (RowCount == 0) ? 1 : (RowCount % m_grid.PageSize == 0) ? RowCount / m_grid.PageSize : (RowCount - RowCount % m_grid.PageSize) / m_grid.PageSize + 1;
        }
        catch (Exception ex)
        {
            sms.utils.Log.writeLog(ex.ToString(), ((new System.Diagnostics.StackTrace()).GetFrames()[0]).GetMethod().Name);
        }
    }