public PurchaseOrderDetail GetPODetailsByPONum(string pon)
        {
            var q = (from r in edm.PurchaseOrderDetails where r.PONumber == pon select r);
            PurchaseOrderDetail pod = new PurchaseOrderDetail();
            pod = q.First<PurchaseOrderDetail>();

            return pod;
        }
        public PurchaseOrderDetail GetPODetailsByPOID(int poid)
        {
            var q = (from r in edm.PurchaseOrderDetails where r.PODetailID == poid select r);
            PurchaseOrderDetail d = new PurchaseOrderDetail();
            d = q.First<PurchaseOrderDetail>();

            return d;
        }
        //change new type
        public int addNewPOD(string poNum, string icode, int orderqty)
        {
            PurchaseOrderDetail pod = new PurchaseOrderDetail();

            pod.PONumber = poNum;
            pod.Item_Code = icode;
            pod.Order_Qty = orderqty;

            edm.PurchaseOrderDetails.AddObject(pod);
            this.edm.SaveChanges();

            int podid = pod.PODetailID;
            return podid;
        }
 /// <summary>
 /// Create a new PurchaseOrderDetail object.
 /// </summary>
 /// <param name="pODetailID">Initial value of the PODetailID property.</param>
 /// <param name="pONumber">Initial value of the PONumber property.</param>
 /// <param name="item_Code">Initial value of the Item_Code property.</param>
 /// <param name="order_Qty">Initial value of the Order_Qty property.</param>
 public static PurchaseOrderDetail CreatePurchaseOrderDetail(global::System.Int32 pODetailID, global::System.String pONumber, global::System.String item_Code, global::System.Int32 order_Qty)
 {
     PurchaseOrderDetail purchaseOrderDetail = new PurchaseOrderDetail();
     purchaseOrderDetail.PODetailID = pODetailID;
     purchaseOrderDetail.PONumber = pONumber;
     purchaseOrderDetail.Item_Code = item_Code;
     purchaseOrderDetail.Order_Qty = order_Qty;
     return purchaseOrderDetail;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the PurchaseOrderDetails EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToPurchaseOrderDetails(PurchaseOrderDetail purchaseOrderDetail)
 {
     base.AddObject("PurchaseOrderDetails", purchaseOrderDetail);
 }