Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
T
Thick-Common
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
潘栩锋
Thick-Common
Commits
d3604d26
Commit
d3604d26
authored
Nov 13, 2019
by
潘栩锋
🚴
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改 BufferError
parent
5e2479d3
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
11 deletions
+9
-11
BufferError.cs
...ect.FLY.OBJComponents/OBJComponents/Server/BufferError.cs
+2
-3
BufferSQLite.cs
...ct.FLY.OBJComponents/OBJComponents/Server/BufferSQLite.cs
+7
-8
No files found.
Project.FLY.OBJComponents/OBJComponents/Server/BufferError.cs
View file @
d3604d26
...
...
@@ -14,11 +14,10 @@ namespace FLY.OBJComponents.Server
{
public
class
BufferError
:
BufferSQLite
<
FlyData_WarningHistory
,
DB_Error
>
{
public
void
Init
(
IErrorDBModel
dBModel
)
public
void
Init
(
DBTable
<
DB_Error
>
dbTable
)
{
base
.
Init
(
d
BModel
.
TbError
,
mapLc2Db
,
mapDb2Lc
);
base
.
Init
(
d
bTable
,
mapLc2Db
,
mapDb2Lc
);
}
static
DB_Error
mapLc2Db
(
FlyData_WarningHistory
lc
)
{
return
new
DB_Error
()
...
...
Project.FLY.OBJComponents/OBJComponents/Server/BufferSQLite.cs
View file @
d3604d26
...
...
@@ -145,9 +145,8 @@ namespace FLY.OBJComponents.Server
where
TDb
:
IDbBase
,
new
()
{
SQLiteDbContext
dbModel
;
DBTable
<
TDb
>
dbTable
;
SQLiteHelper
sqliteHelper
;
public
int
NewestID
=>
Count
-
1
;
public
int
Count
{
get
;
private
set
;
}
...
...
@@ -165,15 +164,15 @@ namespace FLY.OBJComponents.Server
{
}
public
void
Init
(
SQLiteDbContext
dbModel
,
DBTable
<
TDb
>
dbTable
)
public
void
Init
(
DBTable
<
TDb
>
dbTable
)
{
this
.
dbModel
=
dbModel
;
this
.
dbTable
=
dbTable
;
this
.
sqliteHelper
=
dbTable
.
sqliteHelper
;
Load
();
}
void
Load
()
{
var
n
=
dbModel
.
sqliteHelper
.
ExecuteScalar
(
$"SELECT COUNT(*) FROM
{
dbTable
.
TableName
}
"
);
var
n
=
sqliteHelper
.
ExecuteScalar
(
$"SELECT COUNT(*) FROM
{
dbTable
.
TableName
}
"
);
int
count
=
System
.
Convert
.
ToInt32
(
n
);
Count
=
count
;
}
...
...
@@ -186,7 +185,7 @@ namespace FLY.OBJComponents.Server
//SQLs
List
<
string
>
sqls
=
new
List
<
string
>();
sqls
.
Add
(
SQLiteHelper
.
GetInsertCommandText
(
db
));
dbModel
.
sqliteHelper
.
QueryTranAsync
(
sqls
);
sqliteHelper
.
QueryTranAsync
(
sqls
);
Count
++;
}
...
...
@@ -201,7 +200,7 @@ namespace FLY.OBJComponents.Server
//SQLs
sqls
.
Add
(
SQLiteHelper
.
GetInsertCommandText
(
db
));
}
dbModel
.
sqliteHelper
.
QueryTranAsync
(
sqls
);
sqliteHelper
.
QueryTranAsync
(
sqls
);
Count
+=
dbs
.
Count
();
}
...
...
@@ -213,7 +212,7 @@ namespace FLY.OBJComponents.Server
//SQLs
List
<
string
>
sqls
=
new
List
<
string
>();
sqls
.
Add
(
$"DELETE FROM
{
dbTable
.
TableName
}
"
);
dbModel
.
sqliteHelper
.
QueryTranAsync
(
sqls
);
sqliteHelper
.
QueryTranAsync
(
sqls
);
Count
=
0
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment