Example #1
0
        private void initEntity(int inventoryId)
        {
            INVInventoryPrimaryKey pk = new INVInventoryPrimaryKey();

            pk.InventoryID         = inventoryId;
            _invInventory          = _invInventoryWrapper.SelectOne(pk);
            txt_InventoryName.Text = _invInventory.InventoryName;
            txt_Notes.Text         = _invInventory.Notes;
        }
Example #2
0
		/// <summary>
		/// This method will return an object representing the record matching the primary key information specified.
		/// </summary>
		///
		/// <param name="pk" type="INVInventoryPrimaryKey">Primary Key information based on which data is to be fetched.</param>
		///
		/// <returns>object of class INVInventory</returns>
		public INVInventory SelectOne(INVInventoryPrimaryKey pk)
		{
			_iNVInventoryWCF = new INVInventory();
			_iNVInventory = POS.DataLayer.INVInventoryBase.SelectOne(new POS.DataLayer.INVInventoryPrimaryKey(pk.InventoryID));
			
				_iNVInventoryWCF.InventoryID = _iNVInventory.InventoryID;
				_iNVInventoryWCF.InventoryName = _iNVInventory.InventoryName;
				_iNVInventoryWCF.Notes = _iNVInventory.Notes;
				_iNVInventoryWCF.IsBasic = _iNVInventory.IsBasic;
				
			return _iNVInventoryWCF;
		}
Example #3
0
        public override void btn_Delete_Click(object sender, EventArgs e)
        {
            int?productGroupID = 0;

            if (dgrid_Result.Rows[dgrid_Result.SelectedCells[0].RowIndex].Cells["InventoryID"].Value != null)
            {
                if (MessageBox.Show("هل نت متأكد من حذف المخزن؟", "تحذير", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    productGroupID = Convert.ToInt32(dgrid_Result.Rows[dgrid_Result.SelectedCells[0].RowIndex].Cells["InventoryID"].Value);
                    INVInventoryPrimaryKey productGroupPK = new INVInventoryPrimaryKey();
                    productGroupPK.InventoryID = productGroupID;
                    _invInventoryWrapper.Delete(productGroupPK);
                }
                else
                {
                    return;
                }
            }
            else
            {
                MessageBox.Show("لابد من اختيار مخزن");
            }
            InitiateGrid();
        }
		/// <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="INVInventoryPrimaryKey">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 SALSalesReturnHeaderCollection</returns>
		public SALSalesReturnHeaderCollection SelectAllByForeignKeyInventoryIDPaged(INVInventoryPrimaryKey pk, int pageSize, int skipPages, string orderByStatement)
		{
			SALSalesReturnHeaderCollection sALSalesReturnHeaderCollection=new SALSalesReturnHeaderCollection();
			foreach (POS.DataLayer.SALSalesReturnHeader _sALSalesReturnHeader in POS.DataLayer.SALSalesReturnHeaderBase.SelectAllByForeignKeyInventoryIDPaged(new POS.DataLayer.INVInventoryPrimaryKey(pk.InventoryID), pageSize, skipPages, orderByStatement))
			{
				_sALSalesReturnHeaderWCF = new SALSalesReturnHeader();
				_sALSalesReturnHeaderWCF.SlaesReturnHeaderID = _sALSalesReturnHeader.SlaesReturnHeaderID;
				_sALSalesReturnHeaderWCF.ReturnDate = _sALSalesReturnHeader.ReturnDate;
				_sALSalesReturnHeaderWCF.OriginalSalesHeadeID = _sALSalesReturnHeader.OriginalSalesHeadeID;
				_sALSalesReturnHeaderWCF.CreatedBy = _sALSalesReturnHeader.CreatedBy;
				_sALSalesReturnHeaderWCF.CreateDate = _sALSalesReturnHeader.CreateDate;
				_sALSalesReturnHeaderWCF.UpdatedBy = _sALSalesReturnHeader.UpdatedBy;
				_sALSalesReturnHeaderWCF.UpdateDate = _sALSalesReturnHeader.UpdateDate;
				_sALSalesReturnHeaderWCF.IsDeleted = _sALSalesReturnHeader.IsDeleted;
				_sALSalesReturnHeaderWCF.DeletedBy = _sALSalesReturnHeader.DeletedBy;
				_sALSalesReturnHeaderWCF.DeleteDate = _sALSalesReturnHeader.DeleteDate;
				_sALSalesReturnHeaderWCF.IsClosed = _sALSalesReturnHeader.IsClosed;
				_sALSalesReturnHeaderWCF.IsVoid = _sALSalesReturnHeader.IsVoid;
				_sALSalesReturnHeaderWCF.InventoryID = _sALSalesReturnHeader.InventoryID;
				_sALSalesReturnHeaderWCF.ReturnMoney = _sALSalesReturnHeader.ReturnMoney;
				
				sALSalesReturnHeaderCollection.Add(_sALSalesReturnHeaderWCF);
			}
			return sALSalesReturnHeaderCollection;
		}
		/// <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="INVInventoryPrimaryKey">Primary Key information based on which data is to be deleted.</param>
		///
		/// <returns>True if succeeded</returns>
		public bool DeleteAllByForeignKeyInventoryID(INVInventoryPrimaryKey pk)
		{
			return POS.DataLayer.SALSalesReturnHeaderBase.DeleteAllByForeignKeyInventoryID(new POS.DataLayer.INVInventoryPrimaryKey(pk.InventoryID));
		}
		/// <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="INVInventoryPrimaryKey">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 SALSalesHeaderCollection</returns>
		public SALSalesHeaderCollection SelectAllByForeignKeyInventoryIDPaged(INVInventoryPrimaryKey pk, int pageSize, int skipPages, string orderByStatement)
		{
			SALSalesHeaderCollection sALSalesHeaderCollection=new SALSalesHeaderCollection();
			foreach (POS.DataLayer.SALSalesHeader _sALSalesHeader in POS.DataLayer.SALSalesHeaderBase.SelectAllByForeignKeyInventoryIDPaged(new POS.DataLayer.INVInventoryPrimaryKey(pk.InventoryID), pageSize, skipPages, orderByStatement))
			{
				_sALSalesHeaderWCF = new SALSalesHeader();
				_sALSalesHeaderWCF.SalesHeaderID = _sALSalesHeader.SalesHeaderID;
				_sALSalesHeaderWCF.SalesDate = _sALSalesHeader.SalesDate;
				_sALSalesHeaderWCF.CustomerID = _sALSalesHeader.CustomerID;
				_sALSalesHeaderWCF.InvoiceNumber = _sALSalesHeader.InvoiceNumber;
				_sALSalesHeaderWCF.InvoiceDate = _sALSalesHeader.InvoiceDate;
				_sALSalesHeaderWCF.SellerID = _sALSalesHeader.SellerID;
				_sALSalesHeaderWCF.PaymentTypeID = _sALSalesHeader.PaymentTypeID;
				_sALSalesHeaderWCF.TotalPrice = _sALSalesHeader.TotalPrice;
				_sALSalesHeaderWCF.PaidAmount = _sALSalesHeader.PaidAmount;
				_sALSalesHeaderWCF.RemainingAmount = _sALSalesHeader.RemainingAmount;
				_sALSalesHeaderWCF.LastDayToPay = _sALSalesHeader.LastDayToPay;
				_sALSalesHeaderWCF.TotalDiscountAmount = _sALSalesHeader.TotalDiscountAmount;
				_sALSalesHeaderWCF.TotalDiscountRatio = _sALSalesHeader.TotalDiscountRatio;
				_sALSalesHeaderWCF.IsClosed = _sALSalesHeader.IsClosed;
				_sALSalesHeaderWCF.IsVoid = _sALSalesHeader.IsVoid;
				_sALSalesHeaderWCF.IsPrinted = _sALSalesHeader.IsPrinted;
				_sALSalesHeaderWCF.ServicePrice = _sALSalesHeader.ServicePrice;
				_sALSalesHeaderWCF.TaxTypeID = _sALSalesHeader.TaxTypeID;
				_sALSalesHeaderWCF.RefuseReasonID = _sALSalesHeader.RefuseReasonID;
				_sALSalesHeaderWCF.CreatedBy = _sALSalesHeader.CreatedBy;
				_sALSalesHeaderWCF.CreateDate = _sALSalesHeader.CreateDate;
				_sALSalesHeaderWCF.UpdatedBy = _sALSalesHeader.UpdatedBy;
				_sALSalesHeaderWCF.UpdateDate = _sALSalesHeader.UpdateDate;
				_sALSalesHeaderWCF.IsDeleted = _sALSalesHeader.IsDeleted;
				_sALSalesHeaderWCF.DeletedBy = _sALSalesHeader.DeletedBy;
				_sALSalesHeaderWCF.DeletDate = _sALSalesHeader.DeletDate;
				_sALSalesHeaderWCF.InventoryID = _sALSalesHeader.InventoryID;
				_sALSalesHeaderWCF.FinalPrice = _sALSalesHeader.FinalPrice;
				_sALSalesHeaderWCF.ChequeNumber = _sALSalesHeader.ChequeNumber;
				
				sALSalesHeaderCollection.Add(_sALSalesHeaderWCF);
			}
			return sALSalesHeaderCollection;
		}
Example #7
0
		///<summary>
		///This method will Delete the object from the database
		///</summary>
		///<param name="pk" type="INVInventoryPrimaryKey">Primary Key information based on which data is to be fetched.</param>
		/// <returns>True if succeeded</returns>
		public bool Delete(INVInventoryPrimaryKey pk)
		{
			return POS.DataLayer.INVInventoryBase.Delete(new POS.DataLayer.INVInventoryPrimaryKey(pk.InventoryID));
		}
		/// <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="INVInventoryPrimaryKey">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 SelectAllByForeignKeyInventoryIDPaged(INVInventoryPrimaryKey pk, int pageSize, int skipPages, string orderByStatement)
		{
			PURPurchaseHeaderCollection pURPurchaseHeaderCollection=new PURPurchaseHeaderCollection();
			foreach (POS.DataLayer.PURPurchaseHeader _pURPurchaseHeader in POS.DataLayer.PURPurchaseHeaderBase.SelectAllByForeignKeyInventoryIDPaged(new POS.DataLayer.INVInventoryPrimaryKey(pk.InventoryID), 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;
		}