예제 #1
0
        Int32 DisplayOrders(string CustomerNameFilter)
        {
            Int32  OrderNo;      //var to store the primary key
            String CustomerName; //var to store the Device Name
            String ItemName;     //var to store the Device Name
            Int32  Invoice;      //var to store the primary key

            ;                    //create an instance of the phone class
            clsOrderCollection Order = new clsOrderCollection();

            Order.ReportByCustomerName(CustomerNameFilter);
            Int32 RecordCount;                                      //var to store the count of records
            Int32 Index = 0;                                        //var to store the index for the loop

            RecordCount = Order.Count;                              // get the count of records
            lstOrders.Items.Clear();                                //clear the list box
            while (Index < RecordCount)                             //while there are records to process
            {
                OrderNo      = Order.OrderList[Index].OrderNo;      //get the primary key
                CustomerName = Order.OrderList[Index].CustomerName; //get the Device Name
                ItemName     = Order.OrderList[Index].ItemName;     //get the Operating System
                Invoice      = Order.OrderList[Index].Invoice;      //get the Price
                //create a new entry for the list box
                ListItem NewEntry = new ListItem(CustomerName + ", " + ItemName + ", " + Invoice, OrderNo.ToString());
                lstOrders.Items.Add(NewEntry); //add the phone to the list
                Index++;                       //move the index to the next record
            }
            return(RecordCount);               //return the count of the records found
        }