'v1.2.5 - added sales to date bashboard on home.aspx

Imports System.Web.Configuration

Partial Public Class home
  Inherits System.Web.UI.Page

  Private Shared intDateColumn As Integer
  Private Shared dblRows As Double = 0
  Private Shared strGVFilter As String = ""

  Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    If Not Page.IsPostBack Then dblRows = 0

  End Sub

  Private Sub Page_LoadComplete(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.LoadComplete

    If Not Page.IsPostBack Then
      Dim arrFilter(0) As String
      intDateColumn = 0 'gvZZ.Columns.Count - 2
      refPeriod.Text = Date.Now.ToString("yyyyMM")
      gvZZ.PageSize = 32
      'sdsX.SelectParameters.Item(0) = New System.Web.UI.WebControls.Parameter()
    End If

    dblRows = gvZZ.PageIndex * gvZZ.PageSize     '< has to run for every action				
  End Sub

  Private Sub gvZZ_Sorting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewSortEventArgs) Handles gvZZ.Sorting
    sdsZ.FilterExpression = strGVFilter
    dblRows = 0
  End Sub

  Private Sub gvZZ_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles gvZZ.RowDataBound

    If e.Row.RowType = DataControlRowType.DataRow Then

      Try
        'dblRows += 1
        'e.Row.Cells(0).Text = dblRows
        e.Row.Cells(intDateColumn).Text = sqlDB.SqlDate(e.Row.Cells(intDateColumn).Text & "0000", "d MMMM yyyy")  ' "d MMM yyyy HH:mm")
      Catch ex As Exception
        e.Row.Cells(intDateColumn).Text = "" 'Date.Now.ToString("n/a")
      End Try
    End If
  End Sub

End Class