//constructor public ManageSalesOrderList() { //loading sale list SaleManager saleManager = new SaleManager(); for (Iterator i = saleManager.getAllSaleOrders().iterator(); i.hasNext();) { SaleInfo saleInfo = (SaleInfo)i.next(); SaleInfoNJ saleInfoNJ = new SaleInfoNJ(); saleInfoNJ.OrderNo = saleInfo.getOrderNo(); saleInfoNJ.StatusId = saleInfo.getStatusId(); saleInfoNJ.Remarks = saleInfo.getRemarks(); for (Iterator j = saleInfo.getProductList().iterator(); j.hasNext();) { ProductInfo productInfo = (ProductInfo)j.next(); ProductInfoNJ productInfoNJ = new ProductInfoNJ(); productInfoNJ.Id = productInfo.getId(); productInfoNJ.Name = productInfo.getName(); productInfoNJ.Code = productInfo.getCode(); productInfoNJ.UnitPrice = productInfo.getUnitPrice(); productInfoNJ.Quantity = productInfo.getQuantity(); saleInfoNJ.ProductList.Add(productInfoNJ); } CustomerInfo customerInfo = new CustomerInfo(); CustomerInfoNJ customerInfoNJ = new CustomerInfoNJ(); customerInfoNJ.ProfileInfoNJ.Id = saleInfo.getCustomerInfo().getProfileInfo().getId(); customerInfoNJ.ProfileInfoNJ.FirstName = saleInfo.getCustomerInfo().getProfileInfo().getFirstName(); customerInfoNJ.ProfileInfoNJ.LastName = saleInfo.getCustomerInfo().getProfileInfo().getLastName(); saleInfoNJ.CustomerInfoNJ = customerInfoNJ; SaleOrderList.Add(saleInfoNJ); } }
private void OnSearch() { SaleManager saleManager = new SaleManager(); SaleOrderList.Clear(); for (Iterator i = saleManager.searchAllSaleOrders(SearchSaleByOderNo).iterator(); i.hasNext();) { SaleInfo saleInfo = (SaleInfo)i.next(); SaleInfoNJ saleInfoNJ = new SaleInfoNJ(); saleInfoNJ.OrderNo = saleInfo.getOrderNo(); saleInfoNJ.CustomerUserId = saleInfo.getCustomerUserId(); saleInfoNJ.StatusId = saleInfo.getStatusId(); saleInfoNJ.SaleDate = saleInfo.getSaleDate(); saleInfoNJ.Discount = saleInfo.getDiscount(); saleInfoNJ.Remarks = saleInfo.getRemarks(); SaleOrderList.Add(saleInfoNJ); } }