示例#1
0
        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;
        }
示例#2
0
        public void Hide_All_Receipt_Objects()
        {
            receipt_node iterator = root;

            while (iterator != null)
            {
                iterator.receipt.Info.Hide_Info();
                iterator = iterator.next;
            }
        }
示例#3
0
        public void Deselect_All_Infos()
        {
            receipt_node iterator = root;

            while (iterator != null)
            {
                iterator.receipt.Info.Deselect_Receipt_Info();
                iterator = iterator.next;
            }
        }
示例#4
0
        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;
            }
        }
示例#5
0
        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);
        }
示例#6
0
        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();
        }
示例#7
0
        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);
        }
示例#8
0
 public Receipt_List()
 {
     root = null;
 }
示例#9
0
 public receipt_node(Receipt r)
 {
     this.receipt = r;
     this.next    = null;
 }