/// <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;

            return(_pURPurchaseHeaderWCF);
        }
Пример #2
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="PURPurchaseHeaderPrimaryKey">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 PURPurchaseLineCollection</returns>
        public PURPurchaseLineCollection SelectAllByForeignKeyPurchaseHeaderIDPaged(PURPurchaseHeaderPrimaryKey pk, int pageSize, int skipPages, string orderByStatement)
        {
            PURPurchaseLineCollection pURPurchaseLineCollection = new PURPurchaseLineCollection();

            foreach (POS.DataLayer.PURPurchaseLine _pURPurchaseLine in POS.DataLayer.PURPurchaseLineBase.SelectAllByForeignKeyPurchaseHeaderIDPaged(new POS.DataLayer.PURPurchaseHeaderPrimaryKey(pk.PurcaseHeaderID), pageSize, skipPages, orderByStatement))
            {
                _pURPurchaseLineWCF = new PURPurchaseLine();
                _pURPurchaseLineWCF.PurchaseLineID   = _pURPurchaseLine.PurchaseLineID;
                _pURPurchaseLineWCF.PurchaseHeaderID = _pURPurchaseLine.PurchaseHeaderID;
                _pURPurchaseLineWCF.ProductID        = _pURPurchaseLine.ProductID;
                _pURPurchaseLineWCF.TotalQty         = _pURPurchaseLine.TotalQty;
                _pURPurchaseLineWCF.BonusQty         = _pURPurchaseLine.BonusQty;
                _pURPurchaseLineWCF.DiscountRatio    = _pURPurchaseLine.DiscountRatio;
                _pURPurchaseLineWCF.DiscountAmount   = _pURPurchaseLine.DiscountAmount;
                _pURPurchaseLineWCF.Unitprice        = _pURPurchaseLine.Unitprice;
                _pURPurchaseLineWCF.CreatedDate      = _pURPurchaseLine.CreatedDate;
                _pURPurchaseLineWCF.CreatedBy        = _pURPurchaseLine.CreatedBy;
                _pURPurchaseLineWCF.UpdateDate       = _pURPurchaseLine.UpdateDate;
                _pURPurchaseLineWCF.UpdatedBy        = _pURPurchaseLine.UpdatedBy;
                _pURPurchaseLineWCF.IsDeleted        = _pURPurchaseLine.IsDeleted;
                _pURPurchaseLineWCF.DeleteDate       = _pURPurchaseLine.DeleteDate;
                _pURPurchaseLineWCF.DeletedBy        = _pURPurchaseLine.DeletedBy;

                pURPurchaseLineCollection.Add(_pURPurchaseLineWCF);
            }
            return(pURPurchaseLineCollection);
        }
        /// <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="PURPurchaseHeaderPrimaryKey">Primary Key information based on which data is to be fetched.</param>
        ///
        /// <returns>object of class BDSupplierAccountCollection</returns>
        public BDSupplierAccountCollection SelectAllByForeignKeyPurcaseInvoiceID(PURPurchaseHeaderPrimaryKey pk)
        {
            BDSupplierAccountCollection bDSupplierAccountCollection = new BDSupplierAccountCollection();

            foreach (POS.DataLayer.BDSupplierAccount _bDSupplierAccount in POS.DataLayer.BDSupplierAccountBase.SelectAllByForeignKeyPurcaseInvoiceID(new POS.DataLayer.PURPurchaseHeaderPrimaryKey(pk.PurcaseHeaderID)))
            {
                _bDSupplierAccountWCF = new BDSupplierAccount();
                _bDSupplierAccountWCF.SupplierAccountId = _bDSupplierAccount.SupplierAccountId;
                _bDSupplierAccountWCF.PurcaseInvoiceID  = _bDSupplierAccount.PurcaseInvoiceID;
                _bDSupplierAccountWCF.PurchaseDate      = _bDSupplierAccount.PurchaseDate;
                _bDSupplierAccountWCF.SupplierID        = _bDSupplierAccount.SupplierID;
                _bDSupplierAccountWCF.InvoiceNumber     = _bDSupplierAccount.InvoiceNumber;
                _bDSupplierAccountWCF.TotalPrice        = _bDSupplierAccount.TotalPrice;
                _bDSupplierAccountWCF.PaidAmount        = _bDSupplierAccount.PaidAmount;
                _bDSupplierAccountWCF.IsVoid            = _bDSupplierAccount.IsVoid;
                _bDSupplierAccountWCF.RemainingAmount   = _bDSupplierAccount.RemainingAmount;
                _bDSupplierAccountWCF.CreateDate        = _bDSupplierAccount.CreateDate;
                _bDSupplierAccountWCF.CreatedBy         = _bDSupplierAccount.CreatedBy;
                _bDSupplierAccountWCF.updateDate        = _bDSupplierAccount.updateDate;
                _bDSupplierAccountWCF.UpdatedBy         = _bDSupplierAccount.UpdatedBy;
                _bDSupplierAccountWCF.IsDeleted         = _bDSupplierAccount.IsDeleted;
                _bDSupplierAccountWCF.DeleteDate        = _bDSupplierAccount.DeleteDate;
                _bDSupplierAccountWCF.DeletedBy         = _bDSupplierAccount.DeletedBy;
                _bDSupplierAccountWCF.InvoiceType       = _bDSupplierAccount.InvoiceType;

                bDSupplierAccountCollection.Add(_bDSupplierAccountWCF);
            }
            return(bDSupplierAccountCollection);
        }
 ///<summary>
 ///This method will Delete the object from the database
 ///</summary>
 ///<param name="pk" type="PURPurchaseHeaderPrimaryKey">Primary Key information based on which data is to be fetched.</param>
 /// <returns>True if succeeded</returns>
 public bool Delete(PURPurchaseHeaderPrimaryKey pk)
 {
     return(POS.DataLayer.PURPurchaseHeaderBase.Delete(new POS.DataLayer.PURPurchaseHeaderPrimaryKey(pk.PurcaseHeaderID)));
 }
Пример #5
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);
            }
        }
        /// <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="PURPurchaseHeaderPrimaryKey">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 PURPurchaseReturnHeaderCollection</returns>
        public PURPurchaseReturnHeaderCollection SelectAllByForeignKeyOriginalHeaderIDPaged(PURPurchaseHeaderPrimaryKey pk, int pageSize, int skipPages, string orderByStatement)
        {
            PURPurchaseReturnHeaderCollection pURPurchaseReturnHeaderCollection = new PURPurchaseReturnHeaderCollection();

            foreach (POS.DataLayer.PURPurchaseReturnHeader _pURPurchaseReturnHeader in POS.DataLayer.PURPurchaseReturnHeaderBase.SelectAllByForeignKeyOriginalHeaderIDPaged(new POS.DataLayer.PURPurchaseHeaderPrimaryKey(pk.PurcaseHeaderID), pageSize, skipPages, orderByStatement))
            {
                _pURPurchaseReturnHeaderWCF = new PURPurchaseReturnHeader();
                _pURPurchaseReturnHeaderWCF.PurchaseReturnID = _pURPurchaseReturnHeader.PurchaseReturnID;
                _pURPurchaseReturnHeaderWCF.ReturnDate       = _pURPurchaseReturnHeader.ReturnDate;
                _pURPurchaseReturnHeaderWCF.OriginalHeaderID = _pURPurchaseReturnHeader.OriginalHeaderID;
                _pURPurchaseReturnHeaderWCF.CreatedBy        = _pURPurchaseReturnHeader.CreatedBy;
                _pURPurchaseReturnHeaderWCF.CreateDate       = _pURPurchaseReturnHeader.CreateDate;
                _pURPurchaseReturnHeaderWCF.UpdatedBy        = _pURPurchaseReturnHeader.UpdatedBy;
                _pURPurchaseReturnHeaderWCF.UpdateDate       = _pURPurchaseReturnHeader.UpdateDate;
                _pURPurchaseReturnHeaderWCF.IsDeleted        = _pURPurchaseReturnHeader.IsDeleted;
                _pURPurchaseReturnHeaderWCF.DeletedBy        = _pURPurchaseReturnHeader.DeletedBy;
                _pURPurchaseReturnHeaderWCF.DeleteDate       = _pURPurchaseReturnHeader.DeleteDate;

                pURPurchaseReturnHeaderCollection.Add(_pURPurchaseReturnHeaderWCF);
            }
            return(pURPurchaseReturnHeaderCollection);
        }
        /// <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="PURPurchaseHeaderPrimaryKey">Primary Key information based on which data is to be fetched.</param>
        ///
        /// <returns>object of class PURPurchaseReturnHeaderCollection</returns>
        public PURPurchaseReturnHeaderCollection SelectAllByForeignKeyOriginalHeaderID(PURPurchaseHeaderPrimaryKey pk)
        {
            PURPurchaseReturnHeaderCollection pURPurchaseReturnHeaderCollection = new PURPurchaseReturnHeaderCollection();

            foreach (POS.DataLayer.PURPurchaseReturnHeader _pURPurchaseReturnHeader in POS.DataLayer.PURPurchaseReturnHeaderBase.SelectAllByForeignKeyOriginalHeaderID(new POS.DataLayer.PURPurchaseHeaderPrimaryKey(pk.PurcaseHeaderID)))
            {
                _pURPurchaseReturnHeaderWCF = new PURPurchaseReturnHeader();
                _pURPurchaseReturnHeaderWCF.PurchaseReturnID = _pURPurchaseReturnHeader.PurchaseReturnID;
                _pURPurchaseReturnHeaderWCF.ReturnDate       = _pURPurchaseReturnHeader.ReturnDate;
                _pURPurchaseReturnHeaderWCF.OriginalHeaderID = _pURPurchaseReturnHeader.OriginalHeaderID;
                _pURPurchaseReturnHeaderWCF.CreatedBy        = _pURPurchaseReturnHeader.CreatedBy;
                _pURPurchaseReturnHeaderWCF.CreateDate       = _pURPurchaseReturnHeader.CreateDate;
                _pURPurchaseReturnHeaderWCF.UpdatedBy        = _pURPurchaseReturnHeader.UpdatedBy;
                _pURPurchaseReturnHeaderWCF.UpdateDate       = _pURPurchaseReturnHeader.UpdateDate;
                _pURPurchaseReturnHeaderWCF.IsDeleted        = _pURPurchaseReturnHeader.IsDeleted;
                _pURPurchaseReturnHeaderWCF.DeletedBy        = _pURPurchaseReturnHeader.DeletedBy;
                _pURPurchaseReturnHeaderWCF.DeleteDate       = _pURPurchaseReturnHeader.DeleteDate;

                pURPurchaseReturnHeaderCollection.Add(_pURPurchaseReturnHeaderWCF);
            }
            return(pURPurchaseReturnHeaderCollection);
        }
 /// <summary>
 /// This method will delete 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="PURPurchaseHeaderPrimaryKey">Primary Key information based on which data is to be deleted.</param>
 ///
 /// <returns>True if succeeded</returns>
 public bool DeleteAllByForeignKeyOriginalHeaderID(PURPurchaseHeaderPrimaryKey pk)
 {
     return(POS.DataLayer.PURPurchaseReturnHeaderBase.DeleteAllByForeignKeyOriginalHeaderID(new POS.DataLayer.PURPurchaseHeaderPrimaryKey(pk.PurcaseHeaderID)));
 }
 /// <summary>
 /// This method will delete 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="PURPurchaseHeaderPrimaryKey">Primary Key information based on which data is to be deleted.</param>
 ///
 /// <returns>True if succeeded</returns>
 public bool DeleteAllByForeignKeyPurcaseInvoiceID(PURPurchaseHeaderPrimaryKey pk)
 {
     return(POS.DataLayer.BDSupplierAccountBase.DeleteAllByForeignKeyPurcaseInvoiceID(new POS.DataLayer.PURPurchaseHeaderPrimaryKey(pk.PurcaseHeaderID)));
 }
Пример #10
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="PURPurchaseHeaderPrimaryKey">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 BDSupplierAccountCollection</returns>
        public BDSupplierAccountCollection SelectAllByForeignKeyPurcaseInvoiceIDPaged(PURPurchaseHeaderPrimaryKey pk, int pageSize, int skipPages, string orderByStatement)
        {
            BDSupplierAccountCollection bDSupplierAccountCollection = new BDSupplierAccountCollection();

            foreach (POS.DataLayer.BDSupplierAccount _bDSupplierAccount in POS.DataLayer.BDSupplierAccountBase.SelectAllByForeignKeyPurcaseInvoiceIDPaged(new POS.DataLayer.PURPurchaseHeaderPrimaryKey(pk.PurcaseHeaderID), pageSize, skipPages, orderByStatement))
            {
                _bDSupplierAccountWCF = new BDSupplierAccount();
                _bDSupplierAccountWCF.SupplierAccountId = _bDSupplierAccount.SupplierAccountId;
                _bDSupplierAccountWCF.PurcaseInvoiceID  = _bDSupplierAccount.PurcaseInvoiceID;
                _bDSupplierAccountWCF.PurchaseDate      = _bDSupplierAccount.PurchaseDate;
                _bDSupplierAccountWCF.SupplierID        = _bDSupplierAccount.SupplierID;
                _bDSupplierAccountWCF.InvoiceNumber     = _bDSupplierAccount.InvoiceNumber;
                _bDSupplierAccountWCF.TotalPrice        = _bDSupplierAccount.TotalPrice;
                _bDSupplierAccountWCF.PaidAmount        = _bDSupplierAccount.PaidAmount;
                _bDSupplierAccountWCF.IsVoid            = _bDSupplierAccount.IsVoid;
                _bDSupplierAccountWCF.RemainingAmount   = _bDSupplierAccount.RemainingAmount;
                _bDSupplierAccountWCF.CreateDate        = _bDSupplierAccount.CreateDate;
                _bDSupplierAccountWCF.CreatedBy         = _bDSupplierAccount.CreatedBy;
                _bDSupplierAccountWCF.updateDate        = _bDSupplierAccount.updateDate;
                _bDSupplierAccountWCF.UpdatedBy         = _bDSupplierAccount.UpdatedBy;
                _bDSupplierAccountWCF.IsDeleted         = _bDSupplierAccount.IsDeleted;
                _bDSupplierAccountWCF.DeleteDate        = _bDSupplierAccount.DeleteDate;
                _bDSupplierAccountWCF.DeletedBy         = _bDSupplierAccount.DeletedBy;
                _bDSupplierAccountWCF.Depit             = _bDSupplierAccount.Depit;
                _bDSupplierAccountWCF.Credit            = _bDSupplierAccount.Credit;
                _bDSupplierAccountWCF.LstDayToPay       = _bDSupplierAccount.LstDayToPay;
                _bDSupplierAccountWCF.ChequeNumber      = _bDSupplierAccount.ChequeNumber;
                _bDSupplierAccountWCF.InvoiceType       = _bDSupplierAccount.InvoiceType;

                bDSupplierAccountCollection.Add(_bDSupplierAccountWCF);
            }
            return(bDSupplierAccountCollection);
        }