Projects section usable, Sticky headers added
This commit is contained in:
@@ -1180,6 +1180,47 @@ class UserOperations {
|
||||
await executeQueries();
|
||||
}
|
||||
|
||||
static Future<void> UndoProjectStep(Project project, ProjectStep step) async {
|
||||
|
||||
project.steps.forEach((element) {
|
||||
if(element.stepName == step.stepName){
|
||||
element.finishedDate = null;
|
||||
}
|
||||
});
|
||||
|
||||
Map<String, String> queryBody = <String, String>{
|
||||
'name': username+project.name,
|
||||
'username': username,
|
||||
'steps': jsonEncode(project.steps),
|
||||
};
|
||||
|
||||
if (cacheEnabled) {
|
||||
//Add Query
|
||||
Map<String, Object> query = {Queries.colLink: 'update_projectSteps', Queries.colData: jsonEncode(queryBody)};
|
||||
|
||||
print("adding new query ${query[Queries.colLink]} : ${jsonEncode(queryBody)}");
|
||||
|
||||
await cacheDb.insert('Queries', query);
|
||||
await cacheDb.rawUpdate("UPDATE Projects SET steps='${jsonEncode(project.steps)}' WHERE ${Project.colName}='${project.name}'");
|
||||
//update Cache
|
||||
// Map<String, Object> data = {Project.colName: username+name, Project.colCat: category, Project.colSteps: jsonEncode(steps),Project.colEta: eta, Project.colDeadline: deadline.toString()};
|
||||
// await cacheDb.insert('Projects', data);
|
||||
await refreshUserData(forceOffline: true);
|
||||
} else {
|
||||
try {
|
||||
http.Response queryResponse = (await http.post(Uri.parse('http://161.97.127.136/task_tracker/update_projectSteps.php'), body: queryBody));
|
||||
print("Query executed : Results{${queryResponse.body}");
|
||||
if (queryResponse.body.toLowerCase().contains("success")) {
|
||||
//Success
|
||||
}
|
||||
} catch (e) {
|
||||
print('NC: Error completing prjctStep $e}');
|
||||
}
|
||||
}
|
||||
|
||||
await executeQueries();
|
||||
}
|
||||
|
||||
static Future<void> deleteTask(String name, {bulk = false}) async {
|
||||
Map<String, String> queryBody = <String, String>{
|
||||
'id': username + name,
|
||||
|
||||
Reference in New Issue
Block a user