//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); } }
/* * This method will display selected sale info * @author A.K.M. Nazmul Islam on 26th january 2016 */ public void OnSelectSaleOrderEvent(SaleInfoNJ saleInfoNJ) { SaleManager saleManager = new SaleManager(); ResultEvent resultEvent = saleManager.getSaleOrderInfo(saleInfoNJ.OrderNo); if (resultEvent.getResponseCode() == Responses.RESPONSE_CODE_SUCCESS) { SaleInfo saleInfo = (SaleInfo)resultEvent.getResult(); SaleInfoNJ tempSaleInfoNJ = new SaleInfoNJ(); tempSaleInfoNJ.OrderNo = saleInfo.getOrderNo(); tempSaleInfoNJ.StatusId = saleInfo.getStatusId(); tempSaleInfoNJ.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(); tempSaleInfoNJ.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(); tempSaleInfoNJ.CustomerInfoNJ = customerInfoNJ; SaleInfoNJ = tempSaleInfoNJ; } else { MessageBox.Show(resultEvent.getMessage()); } }
/* * This method will reset sale order info * @author nazmul hasan on 26th january 2017 */ private void OnReset() { SaleInfoNJ = new SaleInfoNJ(); }