public void AddUpdatePurchaseInvoiceDetail(PurchaseInvoiceDetail purchaseinvoicedetail)
        {
            PurchaseInvoiceDetailData data = new PurchaseInvoiceDetailData();

            try
            {
                data.AddUpdatePurchaseInvoiceDetail(purchaseinvoicedetail);
                // this.PurchaseOrderStatusChanged += new OrderEventsHandler(PurchaseInvoiceDetail_OrderStatusChanged);

                PurchaseInvoiceHeader           head = new PurchaseInvoiceHeader();
                PurchaseInvoiceHeaderCollection col  = new PurchaseInvoiceHeaderCollection();

                head = head.GetPurchaseInvoiceHeader(purchaseinvoicedetail.InvoiceID);

                /*this.OrderStatusChanged += new OrderEventsHandler(PurchaseInvoiceHeader_OrderStatusChanged);*/
                // if (head.Status == (byte)OrderStatus.Received)
                // {
                //    OnPurchaseOrderStatusChanged(purchaseinvoicedetail.ProductID, purchaseinvoicedetail.Quantity);

                // }
                UpdateInvoiceTotal(purchaseinvoicedetail.InvoiceID);
            }
            catch (Exception ex)
            {
                log.Write(ex.Message, "AddUpdatePurchaseInvoiceDetail");
                throw (ex);
            }
            finally
            {
                data = null;
            }
        }
Esempio n. 2
0
        public int PurchaseInvoiceHeaderExists(int purchaseOrderID)
        {
            PurchaseInvoiceHeaderData       data = new PurchaseInvoiceHeaderData();
            PurchaseInvoiceHeaderCollection col  = new PurchaseInvoiceHeaderCollection();

            string where = "[PurchaseOrderID]=" + purchaseOrderID;
            string orderBy = String.Empty;

            try
            {
                col = data.GetAllPurchaseInvoiceHeaderDynamicCollection(where, orderBy);
                if (col.Count > 0)
                {
                    return(col[0].InvoiceID);
                }
                else
                {
                    return(0);
                }
            }
            catch
            {
                return(0);
            }
        }
Esempio n. 3
0
        public PurchaseInvoiceHeaderCollection GetPurchaseInvoiceHeaders(string where, string orderBy)
        {
            PurchaseInvoiceHeaderData       data = new PurchaseInvoiceHeaderData();
            PurchaseInvoiceHeaderCollection col  = new PurchaseInvoiceHeaderCollection();

            try
            {
                col = data.GetAllPurchaseInvoiceHeaderDynamicCollection(where, orderBy);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                data = null;
            }
            return(col);
        }