Пример #1
0
        /// <summary>
        /// Called when Button SendToViewModel is clicked
        /// </summary>
        private void OnAdd()
        {

            ProductInfo productInfo = new ProductInfo();
            productInfo.setUnitPrice(Price);
            productInfo.setQuantity(OrderItemQuantity);
            productInfo.setDiscount(OrderItemDiscount);
            productInfo.setPurchaseOrderNo(productInfo.getPurchaseOrderNo());

            List productList = new ArrayList();
            productList.add(productInfo);

            SaleInfo saleInfo = new SaleInfo();
            CustomerInfo customerInfo = new CustomerInfo();
            saleInfo.setProductList(productList);
            saleInfo.setCustomerUserId(customerInfo.getUserInfo().getId());
            saleInfo.setOrderNo(saleInfo.getOrderNo());
            saleInfo.setStatusId(saleInfo.getStatusId());
            saleInfo.setRemarks(saleInfo.getRemarks());

            SaleManager saleManager = new SaleManager();
            saleManager.addSaleOrder(saleInfo);

            MessageBox.Show("Save Successfully");
        }
Пример #2
0
        /// <summary>
        /// Called when Button SendToViewModel is clicked
        /// </summary>
        private void OnAdd()
        {

            //productInfo.setId(productInfo.getId());
            //productInfo.setUnitPrice(productInfo.getUnitPrice());
            //productInfo.setQuantity(productInfo.getQuantity());
            //productInfo.setDiscount(productInfo.getDiscount());

            java.util.List productList = new java.util.ArrayList();
                      
            for(int i = 0; i < ProductItemList.Count; i ++){
                ProductInfo productInfo = new ProductInfo();
                ProductInfoNJ productInfoNJ = ProductItemList.ElementAt(i);
                productInfo.setId(productInfoNJ.ProductId);
                productInfo.setUnitPrice(productInfoNJ.Price);
                productInfo.setQuantity(productInfoNJ.Quantity);
                productInfo.setDiscount(productInfoNJ.Discount);
                productList.add(productInfo);
            }

            PurchaseInfo purchaseInfo = new PurchaseInfo();
            purchaseInfo.setProductList(productList);
            purchaseInfo.setSupplierUserId(SupplierUserId);
            purchaseInfo.setOrderNo(purchaseInfo.getOrderNo());
            purchaseInfo.setStatusId(purchaseInfo.getStatusId());
            purchaseInfo.setRemarks(purchaseInfo.getRemarks());
            purchaseInfo.setOrderDate(purchaseInfo.getOrderDate());
            purchaseInfo.setRequestShippedDate(purchaseInfo.getRequestShippedDate());

            PurchaseManager purchaseManager = new PurchaseManager();
            purchaseManager.addPurchaseOrder(purchaseInfo);
            

            MessageBox.Show("Save Successfully");
        }