Exemplo n.º 1
0
        public int SavePURPurchaseOrder(PURPurchaseHeader pURPurchaseHeader, PURPurchaseLineCollection pURPurchaseLineCollection)
        {
            POS.DataLayer.PURPurchaseHeader _pURPurchaseHeader = new POS.DataLayer.PURPurchaseHeader();
            _pURPurchaseHeader.PurcaseHeaderID = pURPurchaseHeader.PurcaseHeaderID;
            _pURPurchaseHeader.PurchaseDate = DateTime.Now;
            _pURPurchaseHeader.SupplierID = pURPurchaseHeader.SupplierID;
            _pURPurchaseHeader.InventoryID = pURPurchaseHeader.InventoryID;
            _pURPurchaseHeader.InvoiceNumber = pURPurchaseHeader.InvoiceNumber;
            _pURPurchaseHeader.InvoiceDate = pURPurchaseHeader.InvoiceDate;
            // _pURPurchaseHeader.SellerID = GlobalVariables.CurrentUser.UserID;
            _pURPurchaseHeader.PaymentTypeID = pURPurchaseHeader.PaymentTypeID;
            _pURPurchaseHeader.TotalPrice = pURPurchaseHeader.TotalPrice;
            _pURPurchaseHeader.PaidAmount = pURPurchaseHeader.PaidAmount;
            _pURPurchaseHeader.RemainingAmount = pURPurchaseHeader.RemainingAmount;
            _pURPurchaseHeader.LastDayToPay = pURPurchaseHeader.LastDayToPay;
            _pURPurchaseHeader.ChequeNumber = pURPurchaseHeader.ChequeNumber;
            _pURPurchaseHeader.TotalDiscountAmount = pURPurchaseHeader.TotalDiscountAmount;
            _pURPurchaseHeader.TotalDiscountRatio = pURPurchaseHeader.TotalDiscountRatio;
            _pURPurchaseHeader.IsClosed = false;
            _pURPurchaseHeader.IsVoid = false;
            _pURPurchaseHeader.IsPrinted = false;
            _pURPurchaseHeader.ServicePrice = pURPurchaseHeader.ServicePrice;
            _pURPurchaseHeader.TaxTypeID = pURPurchaseHeader.TaxTypeID;
            _pURPurchaseHeader.RefuseReasonID = null;
            _pURPurchaseHeader.CreatedBy = GlobalVariables.CurrentUser.UserID;
            _pURPurchaseHeader.CreateDate = DateTime.Now;
            _pURPurchaseHeader.UpdatedBy = null;
            _pURPurchaseHeader.updateDate = null;
            _pURPurchaseHeader.IsDeleted = false;
            _pURPurchaseHeader.DeletedBy = null;
            _pURPurchaseHeader.DeleteDate = null;

            POS.DataLayer.PURPurchaseLineCollection _pURPurchaseLineCollection = new DataLayer.PURPurchaseLineCollection();
            foreach (PURPurchaseLine pURPurchaseLine in pURPurchaseLineCollection)
            {
                POS.DataLayer.PURPurchaseLine _pURPurchaseLine = new POS.DataLayer.PURPurchaseLine();
                _pURPurchaseLine.ProductID = pURPurchaseLine.ProductID;
                _pURPurchaseLine.TotalQty = pURPurchaseLine.TotalQty;
                _pURPurchaseLine.BonusQty = pURPurchaseLine.BonusQty;
                _pURPurchaseLine.DiscountAmount = pURPurchaseLine.DiscountAmount;
                _pURPurchaseLine.DiscountRatio = pURPurchaseLine.DiscountRatio;
                _pURPurchaseLine.Unitprice = pURPurchaseLine.Unitprice;
                _pURPurchaseLine.BatchNumber = pURPurchaseLine.BatchNumber;
                _pURPurchaseLine.ExpiryDate = pURPurchaseLine.ExpiryDate;
                _pURPurchaseLine.BatchQty = pURPurchaseLine.BatchQty;
                _pURPurchaseLine.CreatedBy = GlobalVariables.CurrentUser.UserID;
                _pURPurchaseLine.CreatedDate = DateTime.Now;
                _pURPurchaseLine.UpdatedBy = null;
                _pURPurchaseLine.UpdateDate = null;
                _pURPurchaseLine.IsDeleted = false;
                _pURPurchaseLine.DeletedBy = null;
                _pURPurchaseLine.DeleteDate = null;
                _pURPurchaseLineCollection.Add(_pURPurchaseLine);
            }
            POS.DataLayer.PURPurchaseLine pURPurchaseLineObj = new DataLayer.PURPurchaseLine();
            return pURPurchaseLineObj.SaveTransaction(_pURPurchaseHeader, _pURPurchaseLineCollection);
        }
Exemplo n.º 2
0
        public int SavePURPurchaseOrder(PURPurchaseHeader pURPurchaseHeader, PURPurchaseLineCollection pURPurchaseLineCollection)
        {
            POS.DataLayer.PURPurchaseHeader _pURPurchaseHeader = new POS.DataLayer.PURPurchaseHeader();
            _pURPurchaseHeader.PurcaseHeaderID = pURPurchaseHeader.PurcaseHeaderID;
            _pURPurchaseHeader.PurchaseDate    = DateTime.Now;
            _pURPurchaseHeader.SupplierID      = pURPurchaseHeader.SupplierID;
            _pURPurchaseHeader.InventoryID     = pURPurchaseHeader.InventoryID;
            _pURPurchaseHeader.InvoiceNumber   = pURPurchaseHeader.InvoiceNumber;
            _pURPurchaseHeader.InvoiceDate     = pURPurchaseHeader.InvoiceDate;
            // _pURPurchaseHeader.SellerID = GlobalVariables.CurrentUser.UserID;
            _pURPurchaseHeader.PaymentTypeID       = pURPurchaseHeader.PaymentTypeID;
            _pURPurchaseHeader.TotalPrice          = pURPurchaseHeader.TotalPrice;
            _pURPurchaseHeader.PaidAmount          = pURPurchaseHeader.PaidAmount;
            _pURPurchaseHeader.RemainingAmount     = pURPurchaseHeader.RemainingAmount;
            _pURPurchaseHeader.LastDayToPay        = pURPurchaseHeader.LastDayToPay;
            _pURPurchaseHeader.ChequeNumber        = pURPurchaseHeader.ChequeNumber;
            _pURPurchaseHeader.TotalDiscountAmount = pURPurchaseHeader.TotalDiscountAmount;
            _pURPurchaseHeader.TotalDiscountRatio  = pURPurchaseHeader.TotalDiscountRatio;
            _pURPurchaseHeader.IsClosed            = false;
            _pURPurchaseHeader.IsVoid         = false;
            _pURPurchaseHeader.IsPrinted      = false;
            _pURPurchaseHeader.ServicePrice   = pURPurchaseHeader.ServicePrice;
            _pURPurchaseHeader.TaxTypeID      = pURPurchaseHeader.TaxTypeID;
            _pURPurchaseHeader.RefuseReasonID = null;
            _pURPurchaseHeader.CreatedBy      = GlobalVariables.CurrentUser.UserID;
            _pURPurchaseHeader.CreateDate     = DateTime.Now;
            _pURPurchaseHeader.UpdatedBy      = null;
            _pURPurchaseHeader.updateDate     = null;
            _pURPurchaseHeader.IsDeleted      = false;
            _pURPurchaseHeader.DeletedBy      = null;
            _pURPurchaseHeader.DeleteDate     = null;

            POS.DataLayer.PURPurchaseLineCollection _pURPurchaseLineCollection = new DataLayer.PURPurchaseLineCollection();
            foreach (PURPurchaseLine pURPurchaseLine in pURPurchaseLineCollection)
            {
                POS.DataLayer.PURPurchaseLine _pURPurchaseLine = new POS.DataLayer.PURPurchaseLine();
                _pURPurchaseLine.ProductID      = pURPurchaseLine.ProductID;
                _pURPurchaseLine.TotalQty       = pURPurchaseLine.TotalQty;
                _pURPurchaseLine.BonusQty       = pURPurchaseLine.BonusQty;
                _pURPurchaseLine.DiscountAmount = pURPurchaseLine.DiscountAmount;
                _pURPurchaseLine.DiscountRatio  = pURPurchaseLine.DiscountRatio;
                _pURPurchaseLine.Unitprice      = pURPurchaseLine.Unitprice;
                _pURPurchaseLine.BatchNumber    = pURPurchaseLine.BatchNumber;
                _pURPurchaseLine.ExpiryDate     = pURPurchaseLine.ExpiryDate;
                _pURPurchaseLine.BatchQty       = pURPurchaseLine.BatchQty;
                _pURPurchaseLine.CreatedBy      = GlobalVariables.CurrentUser.UserID;
                _pURPurchaseLine.CreatedDate    = DateTime.Now;
                _pURPurchaseLine.UpdatedBy      = null;
                _pURPurchaseLine.UpdateDate     = null;
                _pURPurchaseLine.IsDeleted      = false;
                _pURPurchaseLine.DeletedBy      = null;
                _pURPurchaseLine.DeleteDate     = null;
                _pURPurchaseLineCollection.Add(_pURPurchaseLine);
            }
            POS.DataLayer.PURPurchaseLine pURPurchaseLineObj = new DataLayer.PURPurchaseLine();
            return(pURPurchaseLineObj.SaveTransaction(_pURPurchaseHeader, _pURPurchaseLineCollection));
        }
Exemplo n.º 3
0
        private PURPurchaseHeader CollectHeaderData()
        {
            PURPurchaseHeader _pURPurchaseHeader = new PURPurchaseHeader();

            if (CurrentHeaderID != 0 && CurrentHeaderID != null)
            {
                _pURPurchaseHeader.PurcaseHeaderID = CurrentHeaderID;
            }
            _pURPurchaseHeader.SupplierID      = Convert.ToInt32(cbx_Supplier.SelectedValue);
            _pURPurchaseHeader.InvoiceDate     = dtb_Date.Value.Date;
            _pURPurchaseHeader.InvoiceNumber   = txt_invoiceNumber.Text;
            _pURPurchaseHeader.PaidAmount      = string.IsNullOrEmpty(num_Paied.Text) ? 0 : Convert.ToDecimal(num_Paied.Text);
            _pURPurchaseHeader.RemainingAmount = string.IsNullOrEmpty(num_Remaining.Text) ? 0 : Convert.ToDecimal(num_Remaining.Text);
            _pURPurchaseHeader.PaymentTypeID   = Convert.ToInt32(cbx_PaymentType.SelectedValue);
            if ((int)cbx_PaymentType.SelectedValue == 2)
            {
                _pURPurchaseHeader.LastDayToPay = dtb_LastTimeToPay.Value.Date;
                _pURPurchaseHeader.ChequeNumber = null;
                //_pURPurchaseHeader.che
            }
            else if ((int)cbx_PaymentType.SelectedValue == 3)
            {
                _pURPurchaseHeader.LastDayToPay = null;
                _pURPurchaseHeader.ChequeNumber = Convert.ToDecimal(txt_chequeNumber.Text);
            }
            else
            {
                _pURPurchaseHeader.LastDayToPay = null;
                _pURPurchaseHeader.ChequeNumber = null;
            }
            _pURPurchaseHeader.ServicePrice = string.IsNullOrEmpty(num_OtherPayments.Text) ? 0 : Convert.ToDecimal(num_OtherPayments.Text);
            _pURPurchaseHeader.TaxTypeID    = cbx_TaxType.SelectedIndex == -1 ? null : (int?)(cbx_TaxType.SelectedValue);
            decimal total = Convert.ToDecimal(txt_Total.Text);

            // decimal discountRatio = (Convert.ToDecimal(txt_DiscountRatio.Text.Trim(new char[] { '%' })) / 100);
            _pURPurchaseHeader.TotalDiscountRatio  = Convert.ToDouble(txt_DiscountAmount.Text);
            _pURPurchaseHeader.TotalDiscountAmount = 0;
            _pURPurchaseHeader.TotalPrice          = Convert.ToDecimal(txt_Total.Text);
            _pURPurchaseHeader.InventoryID         = Convert.ToInt32(cbx_Inventory.SelectedValue);
            _pURPurchaseHeader.TotalPrice          = total;
            return(_pURPurchaseHeader);
        }
Exemplo n.º 4
0
        private void LoadLines(int HeaderID)
        {
            try
            {
                PURPurchaseHeaderPrimaryKey headerKey = new PURPurchaseHeaderPrimaryKey();
                headerKey.PurcaseHeaderID = HeaderID;
                PURPurchaseHeaderService headerService  = new PURPurchaseHeaderService();
                PURPurchaseHeader        selectedHeader = headerService.SelectOne(headerKey);

                PURPurchaseLineWrapper    LineService   = new PURPurchaseLineWrapper();
                PURPurchaseLineCollection selectedLines = LineService.SelectByHeaderID(HeaderID);
                LoadHeaderControls(selectedHeader);
                LoadGridLines(selectedLines);
            }
            catch (Exception ex)
            {
                MessageBox.Show("حدث خطأ برجاء تكرار العمليه مره اخرى واذا تكرر الخطا برجاءالاتصال بالشخص المصمم للبرنامج وارسال رسالة الخطا التى ستظهر بعد قليل له");
                MessageBox.Show(ex.Message);
            }
        }
Exemplo n.º 5
0
        private void LoadHeaderControls(PURPurchaseHeader Header)
        {
            dtb_Date.Value = Header.InvoiceDate.Value;
            cbx_Inventory.SelectedValue   = Header.InventoryID;
            cbx_Supplier.SelectedValue    = Header.SupplierID;
            cbx_PaymentType.SelectedValue = Header.PaymentTypeID;
            txt_Total.Text          = Header.TotalPrice.ToString();
            txt_DiscountAmount.Text = Header.TotalDiscountAmount.ToString();
            num_Paied.Text          = Header.PaidAmount.ToString();
            txt_invoiceNumber.Text  = Header.InvoiceNumber;
            num_Remaining.Text      = Header.RemainingAmount.ToString();
            if (Header.PaymentTypeID == 2)
            {
                dtb_LastTimeToPay.Value = Header.LastDayToPay.Value;
            }
            else if (Header.PaymentTypeID == 3)
            {
                txt_chequeNumber.Text = Header.ChequeNumber.ToString();
            }

            if (Header.TaxTypeID != null)
            {
                cbx_TaxType.SelectedValue = Header.TaxTypeID;
            }
            num_OtherPayments.Text = Header.ServicePrice.ToString();
            if (Header.IsClosed == true)
            {
                pnl_headerData.Enabled = false;
                // pnl_footer.Enabled = false;
                grb_lineData.Enabled      = false;
                btn_Save.Enabled          = false;
                btn_ClosePrint.Enabled    = false;
                btn_Print.Enabled         = false;
                cbx_Supplier.Enabled      = false;
                dtb_Date.Enabled          = false;
                cbx_TaxType.Enabled       = false;
                num_OtherPayments.Enabled = false;
                num_Paied.Enabled         = false;
            }
            // txt_DiscountRatio.Text = Header.TotalDiscountRatio.ToString();
        }
Exemplo n.º 6
0
        private PURPurchaseHeader CollectHeaderData()
        {
            PURPurchaseHeader _pURPurchaseHeader = new PURPurchaseHeader();

            _pURPurchaseHeader.SupplierID      = Convert.ToInt32(cbx_Supplier.SelectedValue);
            _pURPurchaseHeader.InvoiceDate     = dtb_Date.Value.Date;
            _pURPurchaseHeader.LastDayToPay    = dtb_LastTimeToPay.Value.Date;
            _pURPurchaseHeader.PaidAmount      = string.IsNullOrEmpty(num_Paied.Text) ? 0 : Convert.ToDecimal(num_Paied.Text);
            _pURPurchaseHeader.RemainingAmount = string.IsNullOrEmpty(num_Remaining.Text) ? 0 : Convert.ToDecimal(num_Remaining.Text);
            _pURPurchaseHeader.PaymentTypeID   = Convert.ToInt32(cbx_PaymentType.SelectedValue);
            _pURPurchaseHeader.ServicePrice    = string.IsNullOrEmpty(num_OtherPayments.Text) ? 0 : Convert.ToDecimal(num_OtherPayments.Text);
            _pURPurchaseHeader.TaxTypeID       = cbx_TaxType.SelectedIndex == -1 ? null : (int?)(cbx_TaxType.SelectedValue);
            decimal total         = Convert.ToDecimal(txt_Total.Text);
            decimal discountRatio = (Convert.ToDecimal(txt_DiscountRatio.Text.Trim(new char[] { '%' })) / 100);

            _pURPurchaseHeader.TotalDiscountAmount = total * discountRatio;
            _pURPurchaseHeader.TotalDiscountRatio  = (double)discountRatio;
            _pURPurchaseHeader.TotalPrice          = Convert.ToDecimal(txt_Total.Text);
            _pURPurchaseHeader.InventoryID         = Convert.ToInt32(cbx_Inventory.SelectedValue);
            return(_pURPurchaseHeader);
        }
Exemplo n.º 7
0
        public PURPurchaseHeaderCollection HeaderSearch(int InventoryID, DateTime FromDate, DateTime ToDate, string SupplierName, string InvoiceNumber)
        {
            PURPurchaseHeaderCollection PURPurcaseHeaderCollection = new PURPurchaseHeaderCollection();

            foreach (POS.DataLayer.PURPurchaseHeader _pURPurchaseHeader in POS.DataLayer.PURPurchaseHeader.HeaderSearch(InventoryID, FromDate, ToDate, SupplierName, InvoiceNumber))
            {
                PURPurchaseHeader _pURPurchaseHeaderWCF = new PURPurchaseHeader();

                _pURPurchaseHeaderWCF.PurcaseHeaderID = _pURPurchaseHeader.PurcaseHeaderID;
                _pURPurchaseHeaderWCF.PurchaseDate    = _pURPurchaseHeader.PurchaseDate;
                _pURPurchaseHeaderWCF.SupplierID      = _pURPurchaseHeader.SupplierID;
                _pURPurchaseHeaderWCF.SupplierName    = _pURPurchaseHeader.SupplierName;
                _pURPurchaseHeaderWCF.InvoiceNumber   = _pURPurchaseHeader.InvoiceNumber;
                _pURPurchaseHeaderWCF.InvoiceDate     = _pURPurchaseHeader.InvoiceDate;
                // _pURPurchaseHeaderWCF.SellerID = _pURPurchaseHeader.SellerID;
                _pURPurchaseHeaderWCF.PaymentTypeID       = _pURPurchaseHeader.PaymentTypeID;
                _pURPurchaseHeaderWCF.TotalPrice          = _pURPurchaseHeader.TotalPrice;
                _pURPurchaseHeaderWCF.PaidAmount          = _pURPurchaseHeader.PaidAmount;
                _pURPurchaseHeaderWCF.RemainingAmount     = _pURPurchaseHeader.RemainingAmount;
                _pURPurchaseHeaderWCF.LastDayToPay        = _pURPurchaseHeader.LastDayToPay;
                _pURPurchaseHeaderWCF.TotalDiscountAmount = _pURPurchaseHeader.TotalDiscountAmount;
                _pURPurchaseHeaderWCF.TotalDiscountRatio  = _pURPurchaseHeader.TotalDiscountRatio;
                _pURPurchaseHeaderWCF.IsClosed            = _pURPurchaseHeader.IsClosed;
                _pURPurchaseHeaderWCF.IsVoid         = _pURPurchaseHeader.IsVoid;
                _pURPurchaseHeaderWCF.IsPrinted      = _pURPurchaseHeader.IsPrinted;
                _pURPurchaseHeaderWCF.ServicePrice   = _pURPurchaseHeader.ServicePrice;
                _pURPurchaseHeaderWCF.TaxTypeID      = _pURPurchaseHeader.TaxTypeID;
                _pURPurchaseHeaderWCF.RefuseReasonID = _pURPurchaseHeader.RefuseReasonID;
                _pURPurchaseHeaderWCF.CreatedBy      = _pURPurchaseHeader.CreatedBy;
                _pURPurchaseHeaderWCF.CreateDate     = _pURPurchaseHeader.CreateDate;
                _pURPurchaseHeaderWCF.UpdatedBy      = _pURPurchaseHeader.UpdatedBy;
                _pURPurchaseHeaderWCF.updateDate     = _pURPurchaseHeader.updateDate;
                _pURPurchaseHeaderWCF.IsDeleted      = _pURPurchaseHeader.IsDeleted;
                _pURPurchaseHeaderWCF.DeletedBy      = _pURPurchaseHeader.DeletedBy;
                _pURPurchaseHeaderWCF.DeleteDate     = _pURPurchaseHeader.DeleteDate;

                PURPurcaseHeaderCollection.Add(_pURPurchaseHeaderWCF);
            }
            return(PURPurcaseHeaderCollection);
        }
Exemplo n.º 8
0
        public PURPurchaseHeaderCollection HeaderSearch(int InventoryID,DateTime FromDate,DateTime ToDate ,string SupplierName, string InvoiceNumber)
        {
            PURPurchaseHeaderCollection PURPurcaseHeaderCollection = new PURPurchaseHeaderCollection();
            foreach (POS.DataLayer.PURPurchaseHeader _pURPurchaseHeader in POS.DataLayer.PURPurchaseHeader.HeaderSearch(InventoryID,FromDate, ToDate ,SupplierName, InvoiceNumber))
            {
                PURPurchaseHeader _pURPurchaseHeaderWCF = new PURPurchaseHeader();

                _pURPurchaseHeaderWCF.PurcaseHeaderID = _pURPurchaseHeader.PurcaseHeaderID;
                _pURPurchaseHeaderWCF.PurchaseDate = _pURPurchaseHeader.PurchaseDate;
                _pURPurchaseHeaderWCF.SupplierID = _pURPurchaseHeader.SupplierID;
                _pURPurchaseHeaderWCF .SupplierName = _pURPurchaseHeader.SupplierName;
                _pURPurchaseHeaderWCF.InvoiceNumber = _pURPurchaseHeader.InvoiceNumber;
                _pURPurchaseHeaderWCF.InvoiceDate = _pURPurchaseHeader.InvoiceDate;
               // _pURPurchaseHeaderWCF.SellerID = _pURPurchaseHeader.SellerID;
                _pURPurchaseHeaderWCF.PaymentTypeID = _pURPurchaseHeader.PaymentTypeID;
                _pURPurchaseHeaderWCF.TotalPrice = _pURPurchaseHeader.TotalPrice;
                _pURPurchaseHeaderWCF.PaidAmount = _pURPurchaseHeader.PaidAmount;
                _pURPurchaseHeaderWCF.RemainingAmount = _pURPurchaseHeader.RemainingAmount;
                _pURPurchaseHeaderWCF.LastDayToPay = _pURPurchaseHeader.LastDayToPay;
                _pURPurchaseHeaderWCF.TotalDiscountAmount = _pURPurchaseHeader.TotalDiscountAmount;
                _pURPurchaseHeaderWCF.TotalDiscountRatio = _pURPurchaseHeader.TotalDiscountRatio;
                _pURPurchaseHeaderWCF.IsClosed = _pURPurchaseHeader.IsClosed;
                _pURPurchaseHeaderWCF.IsVoid = _pURPurchaseHeader.IsVoid;
                _pURPurchaseHeaderWCF.IsPrinted = _pURPurchaseHeader.IsPrinted;
                _pURPurchaseHeaderWCF.ServicePrice = _pURPurchaseHeader.ServicePrice;
                _pURPurchaseHeaderWCF.TaxTypeID = _pURPurchaseHeader.TaxTypeID;
                _pURPurchaseHeaderWCF.RefuseReasonID = _pURPurchaseHeader.RefuseReasonID;
                _pURPurchaseHeaderWCF.CreatedBy = _pURPurchaseHeader.CreatedBy;
                _pURPurchaseHeaderWCF.CreateDate = _pURPurchaseHeader.CreateDate;
                _pURPurchaseHeaderWCF.UpdatedBy = _pURPurchaseHeader.UpdatedBy;
                _pURPurchaseHeaderWCF.updateDate = _pURPurchaseHeader.updateDate;
                _pURPurchaseHeaderWCF.IsDeleted = _pURPurchaseHeader.IsDeleted;
                _pURPurchaseHeaderWCF.DeletedBy = _pURPurchaseHeader.DeletedBy;
                _pURPurchaseHeaderWCF.DeleteDate = _pURPurchaseHeader.DeleteDate;

                PURPurcaseHeaderCollection.Add(_pURPurchaseHeaderWCF);
            }
            return PURPurcaseHeaderCollection;
        }
Exemplo n.º 9
0
		/// <summary>
		/// This method will return an object representing the record matching the primary key information specified.
		/// </summary>
		///
		/// <param name="pk" type="PURPurchaseHeaderPrimaryKey">Primary Key information based on which data is to be fetched.</param>
		///
		/// <returns>object of class PURPurchaseHeader</returns>
		public PURPurchaseHeader SelectOne(PURPurchaseHeaderPrimaryKey pk)
		{
			_pURPurchaseHeaderWCF = new PURPurchaseHeader();
			_pURPurchaseHeader = POS.DataLayer.PURPurchaseHeaderBase.SelectOne(new POS.DataLayer.PURPurchaseHeaderPrimaryKey(pk.PurcaseHeaderID));
			
				_pURPurchaseHeaderWCF.PurcaseHeaderID = _pURPurchaseHeader.PurcaseHeaderID;
				_pURPurchaseHeaderWCF.PurchaseDate = _pURPurchaseHeader.PurchaseDate;
				_pURPurchaseHeaderWCF.PaymentTypeID = _pURPurchaseHeader.PaymentTypeID;
				_pURPurchaseHeaderWCF.SupplierID = _pURPurchaseHeader.SupplierID;
				_pURPurchaseHeaderWCF.InvoiceNumber = _pURPurchaseHeader.InvoiceNumber;
				_pURPurchaseHeaderWCF.CreateDate = _pURPurchaseHeader.CreateDate;
				_pURPurchaseHeaderWCF.CreatedBy = _pURPurchaseHeader.CreatedBy;
				_pURPurchaseHeaderWCF.updateDate = _pURPurchaseHeader.updateDate;
				_pURPurchaseHeaderWCF.UpdatedBy = _pURPurchaseHeader.UpdatedBy;
				_pURPurchaseHeaderWCF.IsDeleted = _pURPurchaseHeader.IsDeleted;
				_pURPurchaseHeaderWCF.DeleteDate = _pURPurchaseHeader.DeleteDate;
				_pURPurchaseHeaderWCF.TotalPrice = _pURPurchaseHeader.TotalPrice;
				_pURPurchaseHeaderWCF.ServicePrice = _pURPurchaseHeader.ServicePrice;
				_pURPurchaseHeaderWCF.PaidAmount = _pURPurchaseHeader.PaidAmount;
				_pURPurchaseHeaderWCF.IsClosed = _pURPurchaseHeader.IsClosed;
				_pURPurchaseHeaderWCF.IsVoid = _pURPurchaseHeader.IsVoid;
				_pURPurchaseHeaderWCF.IsPrinted = _pURPurchaseHeader.IsPrinted;
				_pURPurchaseHeaderWCF.RefuseReasonID = _pURPurchaseHeader.RefuseReasonID;
				_pURPurchaseHeaderWCF.TotalDiscountAmount = _pURPurchaseHeader.TotalDiscountAmount;
				_pURPurchaseHeaderWCF.TotalDiscountRatio = _pURPurchaseHeader.TotalDiscountRatio;
				_pURPurchaseHeaderWCF.TaxTypeID = _pURPurchaseHeader.TaxTypeID;
				_pURPurchaseHeaderWCF.RemainingAmount = _pURPurchaseHeader.RemainingAmount;
				_pURPurchaseHeaderWCF.LastDayToPay = _pURPurchaseHeader.LastDayToPay;
				_pURPurchaseHeaderWCF.DeletedBy = _pURPurchaseHeader.DeletedBy;
				_pURPurchaseHeaderWCF.Notes = _pURPurchaseHeader.Notes;
				_pURPurchaseHeaderWCF.InventoryID = _pURPurchaseHeader.InventoryID;
				_pURPurchaseHeaderWCF.InvoiceDate = _pURPurchaseHeader.InvoiceDate;
				_pURPurchaseHeaderWCF.ChequeNumber = _pURPurchaseHeader.ChequeNumber;
				
			return _pURPurchaseHeaderWCF;
		}
Exemplo n.º 10
0
        public bool SaveAccountUpdates(BDSupplierAccount _supplierAccount)
        {
            #region select area
            PURPurchaseHeaderPrimaryKey purchaseHeaderpk = new PURPurchaseHeaderPrimaryKey();
            purchaseHeaderpk.PurcaseHeaderID = _supplierAccount.PurcaseInvoiceID;
            PURPurchaseHeader _pURPurchaseHeader = _purchaseHeaderService.SelectOne(purchaseHeaderpk);

            BDSupplierAccountPrimaryKey supplierAccountpk = new BDSupplierAccountPrimaryKey();
            supplierAccountpk.SupplierAccountId = _supplierAccount.SupplierAccountId;
            BDSupplierAccount supplierAccount = SelectOne(supplierAccountpk);
            #endregion

            #region supplier account area
            POS.DataLayer.BDSupplierAccount supplierAccountDal = new POS.DataLayer.BDSupplierAccount();
            supplierAccountDal.CreateDate        = supplierAccount.CreateDate;
            supplierAccountDal.CreatedBy         = supplierAccount.CreatedBy;
            supplierAccountDal.DeleteDate        = supplierAccount.DeleteDate;
            supplierAccountDal.DeletedBy         = supplierAccount.DeletedBy;
            supplierAccountDal.InvoiceNumber     = supplierAccount.InvoiceNumber;
            supplierAccountDal.IsDeleted         = supplierAccount.IsDeleted;
            supplierAccountDal.IsVoid            = supplierAccount.IsVoid;
            supplierAccountDal.PurcaseInvoiceID  = supplierAccount.PurcaseInvoiceID;
            supplierAccountDal.PurchaseDate      = supplierAccount.PurchaseDate;
            supplierAccountDal.SupplierAccountId = supplierAccount.SupplierAccountId;
            supplierAccountDal.SupplierID        = supplierAccount.SupplierID;
            supplierAccountDal.updateDate        = supplierAccount.updateDate;
            supplierAccountDal.UpdatedBy         = supplierAccount.UpdatedBy;
            ////////// Updated area
            supplierAccountDal.PaidAmount      = _supplierAccount.PaidAmount;
            supplierAccountDal.RemainingAmount = _supplierAccount.RemainingAmount;
            supplierAccountDal.TotalPrice      = _supplierAccount.TotalPrice;
            #endregion

            #region purchase area

            POS.DataLayer.PURPurchaseHeader _purchaseHeaderDAL = new POS.DataLayer.PURPurchaseHeader();
            _purchaseHeaderDAL.PurcaseHeaderID     = _pURPurchaseHeader.PurcaseHeaderID;
            _purchaseHeaderDAL.PurchaseDate        = _pURPurchaseHeader.PurchaseDate;
            _purchaseHeaderDAL.SupplierID          = _pURPurchaseHeader.SupplierID;
            _purchaseHeaderDAL.SupplierName        = _pURPurchaseHeader.SupplierName;
            _purchaseHeaderDAL.InvoiceNumber       = _pURPurchaseHeader.InvoiceNumber;
            _purchaseHeaderDAL.InvoiceDate         = _pURPurchaseHeader.InvoiceDate;
            _purchaseHeaderDAL.PaymentTypeID       = _pURPurchaseHeader.PaymentTypeID;
            _purchaseHeaderDAL.LastDayToPay        = _pURPurchaseHeader.LastDayToPay;
            _purchaseHeaderDAL.TotalDiscountAmount = _pURPurchaseHeader.TotalDiscountAmount;
            _purchaseHeaderDAL.TotalDiscountRatio  = _pURPurchaseHeader.TotalDiscountRatio;
            _purchaseHeaderDAL.IsClosed            = _pURPurchaseHeader.IsClosed;
            _purchaseHeaderDAL.IsVoid         = _pURPurchaseHeader.IsVoid;
            _purchaseHeaderDAL.IsPrinted      = _pURPurchaseHeader.IsPrinted;
            _purchaseHeaderDAL.ServicePrice   = _pURPurchaseHeader.ServicePrice;
            _purchaseHeaderDAL.TaxTypeID      = _pURPurchaseHeader.TaxTypeID;
            _purchaseHeaderDAL.RefuseReasonID = _pURPurchaseHeader.RefuseReasonID;
            _purchaseHeaderDAL.CreatedBy      = _pURPurchaseHeader.CreatedBy;
            _purchaseHeaderDAL.CreateDate     = _pURPurchaseHeader.CreateDate;
            _purchaseHeaderDAL.UpdatedBy      = _pURPurchaseHeader.UpdatedBy;
            _purchaseHeaderDAL.updateDate     = _pURPurchaseHeader.updateDate;
            _purchaseHeaderDAL.IsDeleted      = _pURPurchaseHeader.IsDeleted;
            _purchaseHeaderDAL.DeletedBy      = _pURPurchaseHeader.DeletedBy;
            _purchaseHeaderDAL.DeleteDate     = _pURPurchaseHeader.DeleteDate;
            ///////////// updated area
            _purchaseHeaderDAL.TotalPrice      = _supplierAccount.TotalPrice;
            _purchaseHeaderDAL.PaidAmount      = _supplierAccount.PaidAmount;
            _purchaseHeaderDAL.RemainingAmount = _supplierAccount.RemainingAmount;
            #endregion

            POS.DataLayer.BDSupplierAccount supplierAccountObj = new DataLayer.BDSupplierAccount();
            return(supplierAccountObj.SaveAccountUpdates(_purchaseHeaderDAL, supplierAccountDal));
        }
Exemplo n.º 11
0
		/// <summary>
		/// This method will return a list of objects representing all records in the table.
		/// </summary>
		///
		/// <returns>list of objects of class PURPurchaseHeader in the form of object of PURPurchaseHeaderCollection </returns>
		public PURPurchaseHeaderCollection SelectAll()
		{
			PURPurchaseHeaderCollection pURPurchaseHeaderCollection = new PURPurchaseHeaderCollection();
			foreach (POS.DataLayer.PURPurchaseHeader _pURPurchaseHeader in POS.DataLayer.PURPurchaseHeaderBase.SelectAll())
			{
				_pURPurchaseHeaderWCF = new PURPurchaseHeader();
				
				_pURPurchaseHeaderWCF.PurcaseHeaderID = _pURPurchaseHeader.PurcaseHeaderID;
				_pURPurchaseHeaderWCF.PurchaseDate = _pURPurchaseHeader.PurchaseDate;
				_pURPurchaseHeaderWCF.PaymentTypeID = _pURPurchaseHeader.PaymentTypeID;
				_pURPurchaseHeaderWCF.SupplierID = _pURPurchaseHeader.SupplierID;
				_pURPurchaseHeaderWCF.InvoiceNumber = _pURPurchaseHeader.InvoiceNumber;
				_pURPurchaseHeaderWCF.CreateDate = _pURPurchaseHeader.CreateDate;
				_pURPurchaseHeaderWCF.CreatedBy = _pURPurchaseHeader.CreatedBy;
				_pURPurchaseHeaderWCF.updateDate = _pURPurchaseHeader.updateDate;
				_pURPurchaseHeaderWCF.UpdatedBy = _pURPurchaseHeader.UpdatedBy;
				_pURPurchaseHeaderWCF.IsDeleted = _pURPurchaseHeader.IsDeleted;
				_pURPurchaseHeaderWCF.DeleteDate = _pURPurchaseHeader.DeleteDate;
				_pURPurchaseHeaderWCF.TotalPrice = _pURPurchaseHeader.TotalPrice;
				_pURPurchaseHeaderWCF.ServicePrice = _pURPurchaseHeader.ServicePrice;
				_pURPurchaseHeaderWCF.PaidAmount = _pURPurchaseHeader.PaidAmount;
				_pURPurchaseHeaderWCF.IsClosed = _pURPurchaseHeader.IsClosed;
				_pURPurchaseHeaderWCF.IsVoid = _pURPurchaseHeader.IsVoid;
				_pURPurchaseHeaderWCF.IsPrinted = _pURPurchaseHeader.IsPrinted;
				_pURPurchaseHeaderWCF.RefuseReasonID = _pURPurchaseHeader.RefuseReasonID;
				_pURPurchaseHeaderWCF.TotalDiscountAmount = _pURPurchaseHeader.TotalDiscountAmount;
				_pURPurchaseHeaderWCF.TotalDiscountRatio = _pURPurchaseHeader.TotalDiscountRatio;
				_pURPurchaseHeaderWCF.TaxTypeID = _pURPurchaseHeader.TaxTypeID;
				_pURPurchaseHeaderWCF.RemainingAmount = _pURPurchaseHeader.RemainingAmount;
				_pURPurchaseHeaderWCF.LastDayToPay = _pURPurchaseHeader.LastDayToPay;
				_pURPurchaseHeaderWCF.DeletedBy = _pURPurchaseHeader.DeletedBy;
				_pURPurchaseHeaderWCF.Notes = _pURPurchaseHeader.Notes;
				_pURPurchaseHeaderWCF.InventoryID = _pURPurchaseHeader.InventoryID;
				_pURPurchaseHeaderWCF.InvoiceDate = _pURPurchaseHeader.InvoiceDate;
				_pURPurchaseHeaderWCF.ChequeNumber = _pURPurchaseHeader.ChequeNumber;
				
				pURPurchaseHeaderCollection.Add(_pURPurchaseHeaderWCF);
			}
			return pURPurchaseHeaderCollection;
		}
Exemplo n.º 12
0
		/// <summary>
		/// This method will return a list of objects representing the specified number of entries from the specified record number in the table 
		/// using the value of the field specified
		/// </summary>
		///
		/// <param name="field" type="string">Field of the class PURPurchaseHeader</param>
		/// <param name="fieldValue" type="object">Value for the field specified.</param>
		/// <param name="fieldValue2" type="object">Value for the field specified.</param>
		/// <param name="typeOperation" type="TypeOperation">Operator that is used if fieldValue2=null or fieldValue2="".</param>
		/// <param name="orderByStatement" type="string">The field value to number.</param>
		/// <param name="pageSize" type="int">Number of records returned.</param>
		/// <param name="skipPages" type="int">The number of missing pages.</param>
		///
		/// <returns>List of object of class PURPurchaseHeader in the form of an object of class PURPurchaseHeaderCollection</returns>
		public PURPurchaseHeaderCollection SelectByFieldPaged(string field, object fieldValue, object fieldValue2, TypeOperation typeOperation, int pageSize, int skipPages, string orderByStatement)
		{
			PURPurchaseHeaderCollection pURPurchaseHeaderCollection = new PURPurchaseHeaderCollection();
			foreach (POS.DataLayer.PURPurchaseHeader _pURPurchaseHeader in POS.DataLayer.PURPurchaseHeaderBase.SelectByFieldPaged(field, fieldValue, fieldValue2, typeOperation, pageSize, skipPages, orderByStatement))
			{
				_pURPurchaseHeaderWCF = new PURPurchaseHeader();
				
				_pURPurchaseHeaderWCF.PurcaseHeaderID = _pURPurchaseHeader.PurcaseHeaderID;
				_pURPurchaseHeaderWCF.PurchaseDate = _pURPurchaseHeader.PurchaseDate;
				_pURPurchaseHeaderWCF.PaymentTypeID = _pURPurchaseHeader.PaymentTypeID;
				_pURPurchaseHeaderWCF.SupplierID = _pURPurchaseHeader.SupplierID;
				_pURPurchaseHeaderWCF.InvoiceNumber = _pURPurchaseHeader.InvoiceNumber;
				_pURPurchaseHeaderWCF.CreateDate = _pURPurchaseHeader.CreateDate;
				_pURPurchaseHeaderWCF.CreatedBy = _pURPurchaseHeader.CreatedBy;
				_pURPurchaseHeaderWCF.updateDate = _pURPurchaseHeader.updateDate;
				_pURPurchaseHeaderWCF.UpdatedBy = _pURPurchaseHeader.UpdatedBy;
				_pURPurchaseHeaderWCF.IsDeleted = _pURPurchaseHeader.IsDeleted;
				_pURPurchaseHeaderWCF.DeleteDate = _pURPurchaseHeader.DeleteDate;
				_pURPurchaseHeaderWCF.TotalPrice = _pURPurchaseHeader.TotalPrice;
				_pURPurchaseHeaderWCF.ServicePrice = _pURPurchaseHeader.ServicePrice;
				_pURPurchaseHeaderWCF.PaidAmount = _pURPurchaseHeader.PaidAmount;
				_pURPurchaseHeaderWCF.IsClosed = _pURPurchaseHeader.IsClosed;
				_pURPurchaseHeaderWCF.IsVoid = _pURPurchaseHeader.IsVoid;
				_pURPurchaseHeaderWCF.IsPrinted = _pURPurchaseHeader.IsPrinted;
				_pURPurchaseHeaderWCF.RefuseReasonID = _pURPurchaseHeader.RefuseReasonID;
				_pURPurchaseHeaderWCF.TotalDiscountAmount = _pURPurchaseHeader.TotalDiscountAmount;
				_pURPurchaseHeaderWCF.TotalDiscountRatio = _pURPurchaseHeader.TotalDiscountRatio;
				_pURPurchaseHeaderWCF.TaxTypeID = _pURPurchaseHeader.TaxTypeID;
				_pURPurchaseHeaderWCF.RemainingAmount = _pURPurchaseHeader.RemainingAmount;
				_pURPurchaseHeaderWCF.LastDayToPay = _pURPurchaseHeader.LastDayToPay;
				_pURPurchaseHeaderWCF.DeletedBy = _pURPurchaseHeader.DeletedBy;
				_pURPurchaseHeaderWCF.Notes = _pURPurchaseHeader.Notes;
				_pURPurchaseHeaderWCF.InventoryID = _pURPurchaseHeader.InventoryID;
				_pURPurchaseHeaderWCF.InvoiceDate = _pURPurchaseHeader.InvoiceDate;
				_pURPurchaseHeaderWCF.ChequeNumber = _pURPurchaseHeader.ChequeNumber;
				
				pURPurchaseHeaderCollection.Add(_pURPurchaseHeaderWCF);
			}
			return pURPurchaseHeaderCollection;
		}
Exemplo n.º 13
0
		/// <summary>
		/// This method will get row(s) from the database using the value of the field specified 
		/// along with the details of the child table.
		/// </summary>
		///
		/// <param name="pk" type="BDSupplierPrimaryKey">Primary Key information based on which data is to be fetched.</param>
		/// <param name="pageSize" type="int">Number of records returned.</param>
		/// <param name="skipPages" type="int">The number of missing pages.</param>
		/// <param name="orderByStatement" type="string">The field value to number.</param>
		///
		/// <returns>object of class PURPurchaseHeaderCollection</returns>
		public PURPurchaseHeaderCollection SelectAllByForeignKeySupplierIDPaged(BDSupplierPrimaryKey pk, int pageSize, int skipPages, string orderByStatement)
		{
			PURPurchaseHeaderCollection pURPurchaseHeaderCollection=new PURPurchaseHeaderCollection();
			foreach (POS.DataLayer.PURPurchaseHeader _pURPurchaseHeader in POS.DataLayer.PURPurchaseHeaderBase.SelectAllByForeignKeySupplierIDPaged(new POS.DataLayer.BDSupplierPrimaryKey(pk.SupplierID), pageSize, skipPages, orderByStatement))
			{
				_pURPurchaseHeaderWCF = new PURPurchaseHeader();
				_pURPurchaseHeaderWCF.PurcaseHeaderID = _pURPurchaseHeader.PurcaseHeaderID;
				_pURPurchaseHeaderWCF.PurchaseDate = _pURPurchaseHeader.PurchaseDate;
				_pURPurchaseHeaderWCF.PaymentTypeID = _pURPurchaseHeader.PaymentTypeID;
				_pURPurchaseHeaderWCF.SupplierID = _pURPurchaseHeader.SupplierID;
				_pURPurchaseHeaderWCF.InvoiceNumber = _pURPurchaseHeader.InvoiceNumber;
				_pURPurchaseHeaderWCF.CreateDate = _pURPurchaseHeader.CreateDate;
				_pURPurchaseHeaderWCF.CreatedBy = _pURPurchaseHeader.CreatedBy;
				_pURPurchaseHeaderWCF.updateDate = _pURPurchaseHeader.updateDate;
				_pURPurchaseHeaderWCF.UpdatedBy = _pURPurchaseHeader.UpdatedBy;
				_pURPurchaseHeaderWCF.IsDeleted = _pURPurchaseHeader.IsDeleted;
				_pURPurchaseHeaderWCF.DeleteDate = _pURPurchaseHeader.DeleteDate;
				_pURPurchaseHeaderWCF.TotalPrice = _pURPurchaseHeader.TotalPrice;
				_pURPurchaseHeaderWCF.ServicePrice = _pURPurchaseHeader.ServicePrice;
				_pURPurchaseHeaderWCF.PaidAmount = _pURPurchaseHeader.PaidAmount;
				_pURPurchaseHeaderWCF.IsClosed = _pURPurchaseHeader.IsClosed;
				_pURPurchaseHeaderWCF.IsVoid = _pURPurchaseHeader.IsVoid;
				_pURPurchaseHeaderWCF.IsPrinted = _pURPurchaseHeader.IsPrinted;
				_pURPurchaseHeaderWCF.RefuseReasonID = _pURPurchaseHeader.RefuseReasonID;
				_pURPurchaseHeaderWCF.TotalDiscountAmount = _pURPurchaseHeader.TotalDiscountAmount;
				_pURPurchaseHeaderWCF.TotalDiscountRatio = _pURPurchaseHeader.TotalDiscountRatio;
				_pURPurchaseHeaderWCF.TaxTypeID = _pURPurchaseHeader.TaxTypeID;
				_pURPurchaseHeaderWCF.RemainingAmount = _pURPurchaseHeader.RemainingAmount;
				_pURPurchaseHeaderWCF.LastDayToPay = _pURPurchaseHeader.LastDayToPay;
				_pURPurchaseHeaderWCF.DeletedBy = _pURPurchaseHeader.DeletedBy;
				_pURPurchaseHeaderWCF.Notes = _pURPurchaseHeader.Notes;
				_pURPurchaseHeaderWCF.InventoryID = _pURPurchaseHeader.InventoryID;
				_pURPurchaseHeaderWCF.InvoiceDate = _pURPurchaseHeader.InvoiceDate;
				_pURPurchaseHeaderWCF.ChequeNumber = _pURPurchaseHeader.ChequeNumber;
				
				pURPurchaseHeaderCollection.Add(_pURPurchaseHeaderWCF);
			}
			return pURPurchaseHeaderCollection;
		}
Exemplo n.º 14
0
		/// <summary>
		/// This method will insert one new row into the database using the property Information
		/// </summary>
		///
		/// <param name="pURPurchaseHeader" type="PURPurchaseHeader">This PURPurchaseHeader  will be inserted in the database.</param>
		///
		/// <returns>True if succeeded</returns>
		public bool Insert(PURPurchaseHeader pURPurchaseHeader)
		{
			_pURPurchaseHeader = new POS.DataLayer.PURPurchaseHeader();
			_pURPurchaseHeader.PurcaseHeaderID=pURPurchaseHeader.PurcaseHeaderID;
			_pURPurchaseHeader.PurchaseDate=pURPurchaseHeader.PurchaseDate;
			_pURPurchaseHeader.PaymentTypeID=pURPurchaseHeader.PaymentTypeID;
			_pURPurchaseHeader.SupplierID=pURPurchaseHeader.SupplierID;
			_pURPurchaseHeader.InvoiceNumber=pURPurchaseHeader.InvoiceNumber;
			_pURPurchaseHeader.CreateDate=pURPurchaseHeader.CreateDate;
			_pURPurchaseHeader.CreatedBy=pURPurchaseHeader.CreatedBy;
			_pURPurchaseHeader.updateDate=pURPurchaseHeader.updateDate;
			_pURPurchaseHeader.UpdatedBy=pURPurchaseHeader.UpdatedBy;
			_pURPurchaseHeader.IsDeleted=pURPurchaseHeader.IsDeleted;
			_pURPurchaseHeader.DeleteDate=pURPurchaseHeader.DeleteDate;
			_pURPurchaseHeader.TotalPrice=pURPurchaseHeader.TotalPrice;
			_pURPurchaseHeader.ServicePrice=pURPurchaseHeader.ServicePrice;
			_pURPurchaseHeader.PaidAmount=pURPurchaseHeader.PaidAmount;
			_pURPurchaseHeader.IsClosed=pURPurchaseHeader.IsClosed;
			_pURPurchaseHeader.IsVoid=pURPurchaseHeader.IsVoid;
			_pURPurchaseHeader.IsPrinted=pURPurchaseHeader.IsPrinted;
			_pURPurchaseHeader.RefuseReasonID=pURPurchaseHeader.RefuseReasonID;
			_pURPurchaseHeader.TotalDiscountAmount=pURPurchaseHeader.TotalDiscountAmount;
			_pURPurchaseHeader.TotalDiscountRatio=pURPurchaseHeader.TotalDiscountRatio;
			_pURPurchaseHeader.TaxTypeID=pURPurchaseHeader.TaxTypeID;
			_pURPurchaseHeader.RemainingAmount=pURPurchaseHeader.RemainingAmount;
			_pURPurchaseHeader.LastDayToPay=pURPurchaseHeader.LastDayToPay;
			_pURPurchaseHeader.DeletedBy=pURPurchaseHeader.DeletedBy;
			_pURPurchaseHeader.Notes=pURPurchaseHeader.Notes;
			_pURPurchaseHeader.InventoryID=pURPurchaseHeader.InventoryID;
			_pURPurchaseHeader.InvoiceDate=pURPurchaseHeader.InvoiceDate;
			_pURPurchaseHeader.ChequeNumber=pURPurchaseHeader.ChequeNumber;
			
			return _pURPurchaseHeader.Insert();
		}