public List <int> SearchByClient(string Client) { List <int> Result = new List <int>(); for (int i = 0; i < OrderList.Count; i++) { if (OrderList[i].OrderNo == Client) { Result.Add(i); } } if (Result.Count == 0) { SearchException e = new SearchException("404 Not Found"); throw e; } return(Result); }
public List <int> SearchByItemName(string ItemName) { List <int> Result = new List <int>(); for (int i = 0; i < OrderList.Count; i++) { for (int j = 0; j < OrderList[i].OrderContent.Count; j++) { if (OrderList[i].OrderContent[j].ItemName == ItemName) { Result.Add(i); break; } } } if (Result.Count == 0) { SearchException e = new SearchException("404 Not Found"); throw e; } return(Result); }