You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: investmoney/investmoney/src/DAO/TransactionDao.cs
+19-61Lines changed: 19 additions & 61 deletions
Original file line number
Diff line number
Diff line change
@@ -34,46 +34,8 @@ public int calculateMaked(List<Wallet> wallet, int user, string dia, string mes,
34
34
varvalueTotal=0.0;
35
35
36
36
varl=0.0;
37
-
//string sqlV = "SELECT ticker, SUM(amount) as soma, SUM((price * amount)) as vendido, date FROM transactions GROUP BY ticker HAVING DATE(substr(date,7,4)||'-'||substr(date,4,2)||'-'||substr(date,1,2)) BETWEEN DATE('" + dateStart + "') AND DATE('" + dateEnd + "') and type = 'V' and user_id = '" + user + "' ;";
38
-
// string sqlC = "SELECT ticker, SUM(amount) as soma, SUM((price * amount)) as vendido, date FROM transactions GROUP BY ticker HAVING DATE(substr(date,7,4)||'-'||substr(date,4,2)||'-'||substr(date,1,2)) BETWEEN DATE('" + dateStart + "') AND DATE('" + dateEnd + "') and type = 'C' and user_id = '" + user + "' ;";
39
-
// var vend = connection.Query(sqlV, new DynamicParameters()).AsList();
40
-
41
-
//var comp = connection.Query(sqlC, new DynamicParameters()).AsList();
42
-
ActiveDaoactiveDa=newActiveDao();
43
-
varactivesNames=activeDa.GetActivesNames();
44
-
45
-
foreach(variteminactivesNames)
46
-
{
47
-
stringtotalVenda="SELECT SUM((price * amount)) as soma, SUM(amount) as amount FROM transactions WHERE DATE(substr(date,7,4)||'-'||substr(date,4,2)||'-'||substr(date,1,2)) BETWEEN DATE('"+dateStart+"') AND DATE('"+dateEnd+"') and type = 'V' and user_id = '"+user+"' and ticker = '"+item+"' ;";
stringconsultaTotal="SELECT SUM((price * amount)) as soma FROM transactions WHERE DATE(substr(date,7,4)||'-'||substr(date,4,2)||'-'||substr(date,1,2)) BETWEEN DATE('"+dateStart+"') AND DATE('"+dateEnd+"') and type = 'C' and user_id = '"+user+"' and ticker = '"+item+"' ;";
@@ -125,14 +87,9 @@ public int calculateMaked(List<Wallet> wallet, int user, string dia, string mes,
125
87
}
126
88
127
89
128
-
<<<<<<< HEAD
129
90
}
130
91
131
92
returnConvert.ToInt32(l);
132
-
=======
133
-
}*/
134
-
135
-
>>>>>>>0712d1bac803ce7321485c1f2b30ab07c1d0224b
136
93
137
94
}
138
95
}
@@ -145,21 +102,23 @@ public int calculateMakedNotRealizado(List<Wallet> wallet, int user, string dia,
145
102
{
146
103
vardateStart=$"{ano}-{mes}-{dia}";
147
104
vardateEnd=$"{ano}-{mes}-30";
148
-
varl=0.0;
149
-
varvalueTotal=0.0;
150
-
151
105
106
+
varl=0.0;
152
107
if(wallet.Count()>0)
153
108
{
154
109
155
110
foreach(variteminwallet)
156
111
{
157
112
stringconsultaCompra="SELECT SUM(amount) as soma, date FROM transactions WHERE DATE(substr(date,7,4)||'-'||substr(date,4,2)||'-'||substr(date,1,2)) BETWEEN DATE('"+dateStart+"') AND DATE('"+dateEnd+"') and type = 'C' and user_id = '"+user+"' and ticker = '"+item.ticker+"' ;";
113
+
stringconsultaVenda="SELECT SUM(amount) as soma FROM transactions WHERE DATE(substr(date,7,4)||'-'||substr(date,4,2)||'-'||substr(date,1,2)) BETWEEN DATE('"+dateStart+"') AND DATE('"+dateEnd+"') and type = 'V' and user_id = '"+user+"' and ticker = '"+item.ticker+"' ;";
158
114
stringconsultaTotal="SELECT SUM((price * amount)) as soma FROM transactions WHERE DATE(substr(date,7,4)||'-'||substr(date,4,2)||'-'||substr(date,1,2)) BETWEEN DATE('"+dateStart+"') AND DATE('"+dateEnd+"') and type = 'C' and user_id = '"+user+"' and ticker = '"+item.ticker+"' ;";
159
115
116
+
varqtdVend=connection.Query<int>("select SUM(amount) as soma from transactions where type = 'V' and user_id = '"+user+"' and ticker = '"+item.ticker+"' and date BETWEEN '01/09/2021' AND '30/09/2021' ",newDynamicParameters());
0 commit comments