public void Delete_Receipt_from_List(int receipt_id) { receipt_node iterator = root; if (root == null) { return; } if (root.receipt.Receipt_id == receipt_id) { root.receipt.Delete(); root.receipt = null; root = root.next; return; } while (iterator.next.receipt.Receipt_id != receipt_id) { iterator = iterator.next; if (iterator.next == null) { MessageBox.Show("CANT FOUND"); return; } } iterator.next.receipt.Delete(); iterator.next.receipt = null; iterator.next = iterator.next.next; return; }
public void Hide_All_Receipt_Objects() { receipt_node iterator = root; while (iterator != null) { iterator.receipt.Info.Hide_Info(); iterator = iterator.next; } }
public void Deselect_All_Infos() { receipt_node iterator = root; while (iterator != null) { iterator.receipt.Info.Deselect_Receipt_Info(); iterator = iterator.next; } }
public void Draw_All_Receipts() { Receipt.point_y = 5; Receipt.point_x = 25; receipt_node iterator = root; while (iterator != null) { iterator.receipt.Info.Draw_Receipt_Obj(ref Receipt.point_x, ref Receipt.point_y); iterator.receipt.Info.Show(); iterator = iterator.next; } }
public void Add_Receipt_to_List(Receipt receipt) { if (root == null) { root = new receipt_node(receipt); return; } receipt_node iterator = root; while (iterator.next != null) { iterator = iterator.next; } iterator.next = new receipt_node(receipt); }
public void Delete_All_List() { receipt_node iterator = root; receipt_node current; while (iterator != null) { current = iterator.next; iterator.receipt.Info.Dispose(); iterator.receipt = null; iterator = current; } root = null; GC.WaitForPendingFinalizers(); GC.Collect(); }
public Receipt Find_Receipt_By_ID(int receipt_id) { if (root == null) { return(null); } receipt_node iterator = root; while (iterator.receipt.Receipt_id != receipt_id) { if (iterator.next == null) { return(null); } iterator = iterator.next; } return(iterator.receipt); }
public Receipt_List() { root = null; }
public receipt_node(Receipt r) { this.receipt = r; this.next = null; }