mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
Bug fix offline actions
This commit is contained in:
@@ -115,15 +115,7 @@ export class SqliteService {
|
||||
DateEnd varchar(255),
|
||||
Detail varchar(255),
|
||||
Description varchar(255),
|
||||
DateIndex varchar(255),
|
||||
DatePublication varchar(255),
|
||||
DocumentId INTERGER,
|
||||
FileBase64 Text,
|
||||
FileExtension varchar(255),
|
||||
Message varchar(255),
|
||||
OrganicEntityId INTERGER,
|
||||
OriginalFileName varchar(255),
|
||||
Title varchar(255)
|
||||
publications Text
|
||||
)`, [])
|
||||
.then((res) => {
|
||||
console.log("Sucess action Table created: ", res)
|
||||
@@ -136,10 +128,10 @@ export class SqliteService {
|
||||
|
||||
//addactions
|
||||
public addactions(data) {
|
||||
console.log('Action insert', data)
|
||||
this.dbInstance.executeSql(`
|
||||
INSERT OR IGNORE INTO ${this.actions} (ActionType,DateBegin,DateEnd,Description,Detail,ProcessId,DateIndex,DatePublication,DocumentId,FileBase64,FileExtension,Message,OrganicEntityId,OriginalFileName,Title)
|
||||
VALUES ('${data.ActionType}','${data.DateBegin}', '${data.DateEnd}','${data.Description}','${data.Detail}','${data.ProcessId}','${data.DateIndex}','${data.DatePublication},'${data.DocumentId}',
|
||||
'${data.FileBase64}','${data.FileExtension}','${data.Message}','${data.OrganicEntityId}','${data.OriginalFileName}','${data.Title}')`, [])
|
||||
INSERT OR IGNORE INTO ${this.actions} (ActionType,DateBegin,DateEnd,Description,Detail,ProcessId,publications)
|
||||
VALUES ('${data.ActionType}','${data.DateBegin}', '${data.DateEnd}','${data.Description}','${data.Detail}','${data.ProcessId}','${data.publications}')`, [])
|
||||
.then(() => {
|
||||
console.log("action add with Success");
|
||||
|
||||
@@ -192,8 +184,9 @@ export class SqliteService {
|
||||
|
||||
//updateActions
|
||||
public updateactions(id,data) {
|
||||
console.log("update action data", data )
|
||||
this.dbInstance.executeSql(`
|
||||
UPDATE ${this.actions} SET DateIndex = ?, DatePublication = ?,DocumentId = ?,FileBase64 = ?,FileExtension = ?,Message = ?,OrganicEntityId = ?,OriginalFileName = ?,Title = ? WHERE ProcessId = ${id}`,data)
|
||||
UPDATE ${this.actions} SET publications = ? WHERE ProcessId = ${id}`,[data])
|
||||
.then(() => {
|
||||
console.log("action update with Success");
|
||||
|
||||
@@ -403,6 +396,21 @@ export class SqliteService {
|
||||
});
|
||||
}
|
||||
|
||||
//getActionById
|
||||
getActionById(id) {
|
||||
return this.dbInstance.executeSql(`SELECT * FROM ${this.actions} WHERE ProcessId = ? `, [id]).then((res) => {
|
||||
this.ALLACTIONS = [];
|
||||
if (res.rows.length > 0) {
|
||||
for (var i = 0; i < res.rows.length; i++) {
|
||||
this.ALLACTIONS.push(res.rows.item(i))
|
||||
}
|
||||
return this.ALLACTIONS;
|
||||
}
|
||||
}, (e) => {
|
||||
console.log(" Get actions by processId error", JSON.stringify(e));
|
||||
});
|
||||
}
|
||||
|
||||
//getEventBy id
|
||||
getEventById(id) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user