Exemplo n.º 1
0
 private void populateItems(OrderInfoDTO o, Dictionary <int, string[]> items)
 {
     foreach (KeyValuePair <int, string[]> entry in items)
     {
         ItemOrderInfoDTO i = new ItemOrderInfoDTO();
         i.item_id   = entry.Key.ToString();
         i.item_name = entry.Value[0];
         i.quantity  = entry.Value[1];
         o.items.Add(i);
     }
 }
Exemplo n.º 2
0
        public void populateOrder(string orderID, string userID, string fname, string lname, string total, string date, Dictionary <int, string[]> items)
        {
            OrderInfoDTO o = new OrderInfoDTO();

            o.orderID   = orderID;
            o.userID    = userID;
            o.firstName = fname;
            o.lastName  = lname;
            o.total     = total;
            o.date      = date;
            populateItems(o, items);

            orders.Add(o);
        }
Exemplo n.º 3
0
        private void populateOrders(string uID)
        {
            OrderInfoDTO order;
            var          itemTable = DBAccess.getPastTenOrders(uID);

            if (!(itemTable is null))
            {
                foreach (DataRow row in itemTable.Rows)
                {
                    order         = new OrderInfoDTO();
                    order.orderID = row.ItemArray[0].ToString();
                    order.total   = row.ItemArray[1].ToString();
                    order.date    = row.ItemArray[2].ToString();

                    order.populateItems(order.orderID);
                    orders.Add(order);
                }
            }
        }