Ejemplo n.º 1
0
        private static void AddOrderStructToList(OrderStruct[] os, ViewModel vm, bool pending)
        {
            for (int i = 0; i < os.Length; i++)
            {
                OrderModel om = new OrderModel
                {
                    CustomerName  = os[i].CustomerName,
                    OrderedAmount = os[i].OrderedAmount,
                    OrderDate     = DateTime.Parse(os[i].OrderDate)
                };
                MerchandiseModel mm = new MerchandiseModel
                {
                    Amount      = os[i].OrderedAmount,
                    ProductName = os[i].ProductName,
                    Supplier    = os[i].Supplier
                };

                om.Merch = mm;
                if (pending)
                {
                    om.IsPendingOrder = true;
                    vm.PendingOrder.Add(om);
                }
                else
                {
                    vm.Order.Add(om);
                }
            }
        }
Ejemplo n.º 2
0
        private static void AddMerchandiseStructToList(MerchandiseStruct[] ms, ViewModel vm)
        {
            for (int i = 0; i < ms.Length; i++)
            {
                MerchandiseModel mm = new MerchandiseModel
                {
                    ProductName = ms[i].ProductName,
                    Amount      = ms[i].Amount,
                    Supplier    = ms[i].Supplier
                };

                vm.ObsMerch.Add(mm);
            }
        }