Sub Activity_Create(FirstTime As Boolean)
Dim Cur As Cursor
DateTime.DateFormat = DisplayFormat
AHL.Initialize3 ("en", "IN")
'Do not forget to load the layout file created with the visual designer. For example:
If FirstTime Then
SQL.Initialize(File.DirRootExternal, AppDB, True)
SelectedDate = "02 Nov 2014"' DateTime.Date(DateTime.Now)
End If
Activity.LoadLayout("ExpenseEntry")
lblCurrency.Text = AHL.CurrencySymbol
tbl.Initialize(Me,"tbl", 1, Gravity.LEFT ,True)
tbl.AddToActivity(Activity, 0, pnlEntry.Height + 10dip, 100%x, 100%y-pnlEntry.Height)
tbl.RowHeight = 40dip
tbl.TextSize = 18
tbl.LineWidth = 1dip
tbl.RowColor1 = Colors.White
tbl.RowColor2 = Colors.RGB(188, 243, 240)
tbl.HeaderColor = Colors.RGB(30,178,170)
tbl.TableColor = Colors.White
tbl.StatusLabelTextSize = 20
lblDate.Text = SelectedDate
Cur = SQL.ExecQuery("SELECT name FROM sqlite_master WHERE type='table' AND name='Expense'")
If Cur.RowCount = 0 Then
Dim m As Map
m.Initialize
m.Put("ID", DBsub.DB_INTEGER)
m.Put("dtExpense", DBsub.DB_TEXT)
m.Put("Item", DBsub.DB_TEXT)
m.Put("Quantity", DBsub.DB_REAL)
m.Put("Cost", DBsub.DB_REAL)
m.Put("Tag", DBsub.DB_TEXT)
DBsub.CreateTable(SQL, "Expense",m ,"ID")
Else
DisplayList(SelectedDate)
End If
End Sub