public static WCFReceivingGoodData Make(string creationDate, string poId, string itemCode, string quantity, string description, string supplierName) { WCFReceivingGoodData goods = new WCFReceivingGoodData(); goods.creationDate = creationDate; goods.poId = poId; goods.itemCode = itemCode; goods.quantity = quantity; goods.description = description; goods.supplierName = supplierName; return(goods); }
////////ReceivingGoods public WCFReceivingGoodData[] ReceivingGoods(string poid) { //string msg = ""; List <WCFReceivingGoodData> goodslist = new List <WCFReceivingGoodData>(); Dictionary <PurchaseOrderDetail, PurchaseOrder> dictionary = Data.RecievingGoodsList(poid); List <PurchaseOrderDetail> polist = new List <PurchaseOrderDetail>(); foreach (KeyValuePair <PurchaseOrderDetail, PurchaseOrder> detail in dictionary) { polist.Add(detail.Key); } PurchaseOrder po = dictionary[polist[0]]; foreach (PurchaseOrderDetail d in polist) { int receivedqty = Data.GetTotalGoodsReceived(po.POID, d.ItemCode); int pendingqty = (int)d.Quantity - receivedqty; if (pendingqty > 0) { WCFReceivingGoodData good = WCFReceivingGoodData.Make(po.CreationDate.HasValue ? po.CreationDate.Value.ToString("dd-MMM-yyyy") : null, d.POID.ToString(), d.ItemCode, pendingqty.ToString(), d.Catalogue.Description, po.Supplier.SupplierName); goodslist.Add(good); } } //catch (Exception e) //{ // msg = e.Message; //} //msg = "ok"; //return msg; return(goodslist.ToArray <WCFReceivingGoodData>()); }