public async Task <int> SaveTaskAsync(TaskDBInfo Task, int barcode, int OPNumber) { TaskDBInfo queryResult = await _database.Table <TaskDBInfo>() .Where(i => i.serviceVisitID == Task.serviceVisitID && i.barcode == barcode) .FirstOrDefaultAsync(); if (queryResult != null) { Console.WriteLine("Update"); Console.WriteLine(Task.taskTypeDescription); return(await _database.UpdateAsync(Task)); } else { try { Console.WriteLine("Insert"); Console.WriteLine(Task.taskTypeDescription); return(await _database.InsertAsync(Task)); } catch (Exception e) { Console.WriteLine(e.Message); Console.WriteLine(e.StackTrace); Console.WriteLine(e.Data); Console.WriteLine(e.Source); Console.WriteLine(e.TargetSite); Console.WriteLine(e.InnerException); Console.WriteLine(e.GetBaseException()); Console.WriteLine(e.HelpLink); } return(await _database.InsertAsync(Task)); } }
public Task <int> DeleteTaskAsync(TaskDBInfo Task) { return(_database.DeleteAsync(Task)); }
public Task <int> UpdateTaskAsync(TaskDBInfo Task) { return(_database.UpdateAsync(Task)); }