Beispiel #1
0
 Order SelectByCust(OrderSet orderset, string cust)
 {
     for (int i = 0; i < orderset.length; i++)
     {
         if (orderset.order[i].OrderCustomer == cust)
         {
             return(orderset.order[i]);
         }
     }
     return(orderset.order[0]);
 }
Beispiel #2
0
 Order SelectByName(OrderSet orderset, string name)
 {
     for (int i = 0; i < orderset.length; i++)
     {
         if (orderset.order[i].OrderName == name)
         {
             return(orderset.order[i]);
         }
     }
     return(orderset.order[0]);
 }
Beispiel #3
0
 Order SelectByNumber(OrderSet orderset, int number)
 {
     for (int i = 0; i < orderset.length; i++)
     {
         if (orderset.order[i].OrderNumber == number)
         {
             return(orderset.order[i]);
         }
     }
     return(orderset.order[0]);
 }
Beispiel #4
0
 void DelOrder(OrderSet orderset, int n)
 {
     if (n < length)
     {
         orderset.order[length - 1].OrderNumber   = 0;
         orderset.order[length - 1].OrderName     = null;
         orderset.order[length - 1].OrderCustomer = null;
     }
     else
     {
         Console.WriteLine("There is something wrong about your input");
     }
 }
Beispiel #5
0
 void AddOrder(OrderSet orderset, Order order)
 {
     length++;
     orderset.order[length - 1] = order;
 }