internal void InsertFront(Alarms new_node) { new_node.setNextAlarmInfo(head); head = new_node; head.Head = true; head.NextAlarm.Head = false; repoA.SaveAlarmAsync(head.NextAlarm); repoA.SaveAlarmAsync(head); repoA.SaveChangesAsync(); size++; }
internal void RemoveAfter(Alarms prev_node, Alarms toDelete) { if (prev_node == null) { Console.WriteLine("The given previous node Cannot be null"); return; } prev_node.setNextAlarmInfo(toDelete.NextAlarm); //or prev_node.NextAlarm.NextAlarm; repoA.DeleteAlarm(toDelete); repoA.SaveAlarmAsync(prev_node); repoA.SaveChangesAsync(); size--; }
public void InsertAfter(Alarms prev_node, Alarms new_node) { if (prev_node == null) { Console.WriteLine("The given previous node Cannot be null"); return; } new_node.setNextAlarmInfo(prev_node.NextAlarm); prev_node.setNextAlarmInfo(new_node); repoA.SaveAlarmAsync(prev_node); repoA.SaveAlarmAsync(new_node); repoA.SaveChangesAsync(); size++; }
internal void InsertLast(Alarms new_node) { if (head == null) { head = new_node; current = head; current.Head = true; } else { Alarms lastNode = GetLastNode(); lastNode.setNextAlarmInfo(new_node); current = lastNode.NextAlarm; repoA.SaveAlarmAsync(lastNode); } repoA.SaveAlarmAsync(current); repoA.SaveChangesAsync(); size++; }