-
Notifications
You must be signed in to change notification settings - Fork 0
/
blocktransactionServices.cs
49 lines (45 loc) · 2.01 KB
/
blocktransactionServices.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SQLite;
namespace MasterNodoOCB
{
class blocktransactionServices
{
public static IEnumerable<blocktransaction> GetAll()
{
var result = new List<blocktransaction>();
using (var ctx = DbContext.GetInstance())
{
var query = "SELECT * FROM blocktransaction";
using (var command = new SQLiteCommand(query, ctx))
{
using (var reader = command.ExecuteReader())
{
while (reader.Read())
{
result.Add(new blocktransaction
{
track = Convert.ToInt32(reader["track"].ToString()),
height = Convert.ToInt32(reader["height"].ToString()),
tracking = reader["tracking"].ToString(),
addressinput = reader["addressinput"].ToString(),
addressoutput = reader["addressoutput"].ToString(),
type = reader["type"].ToString(),
typeo = reader["typeo"].ToString(),
status = reader["status"].ToString(),
amountoutput = reader["amountoutput"].ToString(),
amountinput = reader["amountinput"].ToString(),
commission = reader["commission"].ToString(),
datetimetrack = Convert.ToDateTime(reader["datetimetrack"]),
confirmation = Convert.ToInt32(reader["confirmation"].ToString()),
});
}
}
}
}
return result;
}
}
}