示例#1
0
文件: Data.cs 项目: jtneumann/CS4B
 // to add a new order row to an existing order
 public OrderRow AddOrderRow(OrderRow orderRow)
 {
     try
     {
         int newId = orderRows.Count.Equals(0) ? 1 :
                     orderRows.Max(o => o.OrderRowId) + 1;
         orderRow.OrderRowId = newId;
         orderRows.Add(orderRow);
         return(orderRow);
     }
     catch (Exception ex)
     {
         throw new ApplicationException(
                   "Could not add the order row", ex);
     }
 }
示例#2
0
文件: Data.cs 项目: jtneumann/CS4B
 // To remove an order row instance from the orderRows collection in the Data class
 public bool RemoveOrderRow(OrderRow orderRow)
 {
     return(orderRows.Remove(orderRow));
 }