Esempio n. 1
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 INVProductStock</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 INVProductStock in the form of an object of class INVProductStockCollection</returns>
        public INVProductStockCollection SelectByFieldPaged(string field, object fieldValue, object fieldValue2, TypeOperation typeOperation, int pageSize, int skipPages, string orderByStatement)
        {
            INVProductStockCollection iNVProductStockCollection = new INVProductStockCollection();

            foreach (POS.DataLayer.INVProductStock _iNVProductStock in POS.DataLayer.INVProductStockBase.SelectByFieldPaged(field, fieldValue, fieldValue2, typeOperation, pageSize, skipPages, orderByStatement))
            {
                _iNVProductStockWCF = new INVProductStock();

                _iNVProductStockWCF.ProductStockID = _iNVProductStock.ProductStockID;
                _iNVProductStockWCF.ProductID      = _iNVProductStock.ProductID;
                _iNVProductStockWCF.TotalQty       = _iNVProductStock.TotalQty;
                _iNVProductStockWCF.StockTypeID    = _iNVProductStock.StockTypeID;
                _iNVProductStockWCF.OpeningQty     = _iNVProductStock.OpeningQty;
                _iNVProductStockWCF.OpennigDate    = _iNVProductStock.OpennigDate;
                _iNVProductStockWCF.CreateDate     = _iNVProductStock.CreateDate;
                _iNVProductStockWCF.CreatedBy      = _iNVProductStock.CreatedBy;
                _iNVProductStockWCF.UpdateDate     = _iNVProductStock.UpdateDate;
                _iNVProductStockWCF.UpdatedBy      = _iNVProductStock.UpdatedBy;
                _iNVProductStockWCF.InventoryID    = _iNVProductStock.InventoryID;
                _iNVProductStockWCF.IsBlocked      = _iNVProductStock.IsBlocked;

                iNVProductStockCollection.Add(_iNVProductStockWCF);
            }
            return(iNVProductStockCollection);
        }
Esempio n. 2
0
        /// <summary>
        /// This method will return a list of objects representing all records in the table.
        /// </summary>
        ///
        /// <returns>list of objects of class INVProductStock in the form of object of INVProductStockCollection </returns>
        public INVProductStockCollection SelectAll()
        {
            INVProductStockCollection iNVProductStockCollection = new INVProductStockCollection();

            foreach (POS.DataLayer.INVProductStock _iNVProductStock in POS.DataLayer.INVProductStockBase.SelectAll())
            {
                _iNVProductStockWCF = new INVProductStock();

                _iNVProductStockWCF.ProductStockID = _iNVProductStock.ProductStockID;
                _iNVProductStockWCF.ProductID      = _iNVProductStock.ProductID;
                _iNVProductStockWCF.TotalQty       = _iNVProductStock.TotalQty;
                _iNVProductStockWCF.StockTypeID    = _iNVProductStock.StockTypeID;
                _iNVProductStockWCF.OpeningQty     = _iNVProductStock.OpeningQty;
                _iNVProductStockWCF.OpennigDate    = _iNVProductStock.OpennigDate;
                _iNVProductStockWCF.CreateDate     = _iNVProductStock.CreateDate;
                _iNVProductStockWCF.CreatedBy      = _iNVProductStock.CreatedBy;
                _iNVProductStockWCF.UpdateDate     = _iNVProductStock.UpdateDate;
                _iNVProductStockWCF.UpdatedBy      = _iNVProductStock.UpdatedBy;
                _iNVProductStockWCF.InventoryID    = _iNVProductStock.InventoryID;
                _iNVProductStockWCF.IsBlocked      = _iNVProductStock.IsBlocked;

                iNVProductStockCollection.Add(_iNVProductStockWCF);
            }
            return(iNVProductStockCollection);
        }
Esempio n. 3
0
        /// <summary>
        /// This method will return a list of objects representing the specified number of entries from the specified record number in the table.
        /// </summary>
        ///
        /// <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>list of objects of class INVProductStock in the form of an object of class INVProductStockCollection </returns>
        public INVProductStockCollection SelectAllPaged(int?pageSize, int?skipPages, string orderByStatement)
        {
            INVProductStockCollection iNVProductStockCollection = new INVProductStockCollection();

            foreach (POS.DataLayer.INVProductStock _iNVProductStock in POS.DataLayer.INVProductStockBase.SelectAllPaged(pageSize, skipPages, orderByStatement))
            {
                _iNVProductStockWCF = new INVProductStock();

                _iNVProductStockWCF.ProductStockID = _iNVProductStock.ProductStockID;
                _iNVProductStockWCF.ProductID      = _iNVProductStock.ProductID;
                _iNVProductStockWCF.TotalQty       = _iNVProductStock.TotalQty;
                _iNVProductStockWCF.StockTypeID    = _iNVProductStock.StockTypeID;
                _iNVProductStockWCF.OpeningQty     = _iNVProductStock.OpeningQty;
                _iNVProductStockWCF.OpennigDate    = _iNVProductStock.OpennigDate;
                _iNVProductStockWCF.CreateDate     = _iNVProductStock.CreateDate;
                _iNVProductStockWCF.CreatedBy      = _iNVProductStock.CreatedBy;
                _iNVProductStockWCF.UpdateDate     = _iNVProductStock.UpdateDate;
                _iNVProductStockWCF.UpdatedBy      = _iNVProductStock.UpdatedBy;
                _iNVProductStockWCF.InventoryID    = _iNVProductStock.InventoryID;
                _iNVProductStockWCF.IsBlocked      = _iNVProductStock.IsBlocked;

                iNVProductStockCollection.Add(_iNVProductStockWCF);
            }
            return(iNVProductStockCollection);
        }
 private bool CollectScreenData()
 {
     foreach (DataGridViewRow row in dgrd_Batches.Rows)
     {
         if (row.Index != dgrd_Batches.Rows.Count - 1)
         {
             if (!Validate(row))
                 return false;
             INVProductStock _iNVProductStock = new INVProductStock();
             _iNVProductStock.InventoryID = this.iNVProductStock.InventoryID;
             _iNVProductStock.CreateDate = this.iNVProductStock.CreateDate;
             _iNVProductStock.CreatedBy = this.iNVProductStock.CreatedBy;
             _iNVProductStock.OpeningQty = this.iNVProductStock.OpeningQty;
             _iNVProductStock.OpennigDate = this.iNVProductStock.OpennigDate;
             _iNVProductStock.ProductID = this.iNVProductStock.ProductID;
             _iNVProductStock.StockTypeID = this.iNVProductStock.StockTypeID;
             _iNVProductStock.TotalQty = this.iNVProductStock.TotalQty;
             _iNVProductStock.BatchNo = row.Cells["BatchNumber"].Value.ToString();
             _iNVProductStock.ExpiryDate = DateTime.Parse(row.Cells["ExpiryDate"].Value.ToString());
             _iNVProductStock.BatchQty = Convert.ToDecimal(row.Cells["Qty"].Value);
             frmOpenningQuantitiesObj.iNVProductStockCollection.Add(_iNVProductStock);
         }
     }
     return true;
 }
 public frmOpenningQuantitiesBatches(INVProductStock iNVProductStock, frmOpenningQuantities frm)
 {
     InitializeComponent();
     _iNVProductStockWrapper = new INVProductStockWrapper();
     this.iNVProductStock = iNVProductStock;
     this.frmOpenningQuantitiesObj = frm;
 }
Esempio n. 6
0
        ///<summary>
        /// This method will update one new row into the database using the property Information
        /// </summary>
        ///
        /// <param name="iNVProductStock" type="INVProductStock">This INVProductStock  will be updated in the database.</param>
        ///
        /// <returns>True if succeeded</returns>
        public bool Update(INVProductStock iNVProductStock)
        {
            _iNVProductStock = POS.DataLayer.INVProductStock.SelectOne(new POS.DataLayer.INVProductStockPrimaryKey(iNVProductStock.ProductStockID));

            _iNVProductStock.ProductID   = iNVProductStock.ProductID;
            _iNVProductStock.TotalQty    = iNVProductStock.TotalQty;
            _iNVProductStock.StockTypeID = iNVProductStock.StockTypeID;
            _iNVProductStock.OpeningQty  = iNVProductStock.OpeningQty;
            _iNVProductStock.OpennigDate = iNVProductStock.OpennigDate;
            _iNVProductStock.CreateDate  = iNVProductStock.CreateDate;
            _iNVProductStock.CreatedBy   = iNVProductStock.CreatedBy;
            _iNVProductStock.UpdateDate  = iNVProductStock.UpdateDate;
            _iNVProductStock.UpdatedBy   = iNVProductStock.UpdatedBy;

            return(_iNVProductStock.Update());
        }
Esempio n. 7
0
        /// <summary>
        /// This method will insert one new row into the database using the property Information
        /// </summary>
        ///
        /// <param name="iNVProductStock" type="INVProductStock">This INVProductStock  will be inserted in the database.</param>
        ///
        /// <returns>True if succeeded</returns>
        public bool Insert(INVProductStock iNVProductStock)
        {
            _iNVProductStock = new POS.DataLayer.INVProductStock();
            _iNVProductStock.ProductStockID = iNVProductStock.ProductStockID;
            _iNVProductStock.ProductID      = iNVProductStock.ProductID;
            _iNVProductStock.TotalQty       = iNVProductStock.TotalQty;
            _iNVProductStock.StockTypeID    = iNVProductStock.StockTypeID;
            _iNVProductStock.OpeningQty     = iNVProductStock.OpeningQty;
            _iNVProductStock.OpennigDate    = iNVProductStock.OpennigDate;
            _iNVProductStock.CreateDate     = iNVProductStock.CreateDate;
            _iNVProductStock.CreatedBy      = iNVProductStock.CreatedBy;
            _iNVProductStock.UpdateDate     = iNVProductStock.UpdateDate;
            _iNVProductStock.UpdatedBy      = iNVProductStock.UpdatedBy;

            return(_iNVProductStock.Insert());
        }
Esempio n. 8
0
        /// <summary>
        /// This method will return an object representing the record matching the primary key information specified.
        /// </summary>
        ///
        /// <param name="pk" type="INVProductStockPrimaryKey">Primary Key information based on which data is to be fetched.</param>
        ///
        /// <returns>object of class INVProductStock</returns>
        public INVProductStock SelectOne(INVProductStockPrimaryKey pk)
        {
            _iNVProductStockWCF = new INVProductStock();
            _iNVProductStock    = POS.DataLayer.INVProductStockBase.SelectOne(new POS.DataLayer.INVProductStockPrimaryKey(pk.ProductStockID));

            _iNVProductStockWCF.ProductStockID = _iNVProductStock.ProductStockID;
            _iNVProductStockWCF.ProductID      = _iNVProductStock.ProductID;
            _iNVProductStockWCF.TotalQty       = _iNVProductStock.TotalQty;
            _iNVProductStockWCF.StockTypeID    = _iNVProductStock.StockTypeID;
            _iNVProductStockWCF.OpeningQty     = _iNVProductStock.OpeningQty;
            _iNVProductStockWCF.OpennigDate    = _iNVProductStock.OpennigDate;
            _iNVProductStockWCF.CreateDate     = _iNVProductStock.CreateDate;
            _iNVProductStockWCF.CreatedBy      = _iNVProductStock.CreatedBy;
            _iNVProductStockWCF.UpdateDate     = _iNVProductStock.UpdateDate;
            _iNVProductStockWCF.UpdatedBy      = _iNVProductStock.UpdatedBy;

            return(_iNVProductStockWCF);
        }
Esempio n. 9
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="INVStockTypePrimaryKey">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 INVProductStockCollection</returns>
        public INVProductStockCollection SelectAllByForeignKeyStockTypeIDPaged(INVStockTypePrimaryKey pk, int pageSize, int skipPages, string orderByStatement)
        {
            INVProductStockCollection iNVProductStockCollection = new INVProductStockCollection();

            foreach (POS.DataLayer.INVProductStock _iNVProductStock in POS.DataLayer.INVProductStockBase.SelectAllByForeignKeyStockTypeIDPaged(new POS.DataLayer.INVStockTypePrimaryKey(pk.StockTypeID), pageSize, skipPages, orderByStatement))
            {
                _iNVProductStockWCF = new INVProductStock();
                _iNVProductStockWCF.ProductStockID = _iNVProductStock.ProductStockID;
                _iNVProductStockWCF.ProductID      = _iNVProductStock.ProductID;
                _iNVProductStockWCF.TotalQty       = _iNVProductStock.TotalQty;
                _iNVProductStockWCF.StockTypeID    = _iNVProductStock.StockTypeID;
                _iNVProductStockWCF.OpeningQty     = _iNVProductStock.OpeningQty;
                _iNVProductStockWCF.OpennigDate    = _iNVProductStock.OpennigDate;
                _iNVProductStockWCF.CreateDate     = _iNVProductStock.CreateDate;
                _iNVProductStockWCF.CreatedBy      = _iNVProductStock.CreatedBy;
                _iNVProductStockWCF.UpdateDate     = _iNVProductStock.UpdateDate;
                _iNVProductStockWCF.UpdatedBy      = _iNVProductStock.UpdatedBy;

                iNVProductStockCollection.Add(_iNVProductStockWCF);
            }
            return(iNVProductStockCollection);
        }
Esempio n. 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="INVStockTypePrimaryKey">Primary Key information based on which data is to be fetched.</param>
        ///
        /// <returns>object of class INVProductStockCollection</returns>
        public INVProductStockCollection SelectAllByForeignKeyStockTypeID(INVStockTypePrimaryKey pk)
        {
            INVProductStockCollection iNVProductStockCollection = new INVProductStockCollection();

            foreach (POS.DataLayer.INVProductStock _iNVProductStock in POS.DataLayer.INVProductStockBase.SelectAllByForeignKeyStockTypeID(new POS.DataLayer.INVStockTypePrimaryKey(pk.StockTypeID)))
            {
                _iNVProductStockWCF = new INVProductStock();
                _iNVProductStockWCF.ProductStockID = _iNVProductStock.ProductStockID;
                _iNVProductStockWCF.ProductID      = _iNVProductStock.ProductID;
                _iNVProductStockWCF.TotalQty       = _iNVProductStock.TotalQty;
                _iNVProductStockWCF.StockTypeID    = _iNVProductStock.StockTypeID;
                _iNVProductStockWCF.OpeningQty     = _iNVProductStock.OpeningQty;
                _iNVProductStockWCF.OpennigDate    = _iNVProductStock.OpennigDate;
                _iNVProductStockWCF.CreateDate     = _iNVProductStock.CreateDate;
                _iNVProductStockWCF.CreatedBy      = _iNVProductStock.CreatedBy;
                _iNVProductStockWCF.UpdateDate     = _iNVProductStock.UpdateDate;
                _iNVProductStockWCF.UpdatedBy      = _iNVProductStock.UpdatedBy;

                iNVProductStockCollection.Add(_iNVProductStockWCF);
            }
            return(iNVProductStockCollection);
        }
Esempio n. 11
0
        /// <summary>
        /// This method will get row(s) from the database using the value of the field specified
        /// </summary>
        ///
        /// <param name="field" type="string">Field of the class INVProductStock</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>
        ///
        /// <returns>List of object of class INVProductStock in the form of an object of class INVProductStockCollection</returns>
        public INVProductStockCollection SelectByField(string field, object fieldValue, object fieldValue2, TypeOperation typeOperation)
        {
            INVProductStockCollection iNVProductStockCollection = new INVProductStockCollection();

            foreach (POS.DataLayer.INVProductStock _iNVProductStock in POS.DataLayer.INVProductStockBase.SelectByField(field, fieldValue, fieldValue2, typeOperation))
            {
                _iNVProductStockWCF = new INVProductStock();

                _iNVProductStockWCF.ProductStockID = _iNVProductStock.ProductStockID;
                _iNVProductStockWCF.ProductID      = _iNVProductStock.ProductID;
                _iNVProductStockWCF.TotalQty       = _iNVProductStock.TotalQty;
                _iNVProductStockWCF.StockTypeID    = _iNVProductStock.StockTypeID;
                _iNVProductStockWCF.OpeningQty     = _iNVProductStock.OpeningQty;
                _iNVProductStockWCF.OpennigDate    = _iNVProductStock.OpennigDate;
                _iNVProductStockWCF.CreateDate     = _iNVProductStock.CreateDate;
                _iNVProductStockWCF.CreatedBy      = _iNVProductStock.CreatedBy;
                _iNVProductStockWCF.UpdateDate     = _iNVProductStock.UpdateDate;
                _iNVProductStockWCF.UpdatedBy      = _iNVProductStock.UpdatedBy;

                iNVProductStockCollection.Add(_iNVProductStockWCF);
            }
            return(iNVProductStockCollection);
        }
Esempio n. 12
0
        private void CollectScreenData()
        {
            foreach (DataGridViewRow row in dgrd_OpeningStockProducts.Rows)
            {
                if (row.Cells["TotalQty"].Value != null)
                {
                    var result = iNVProductStockCollection.Where(a => a.ProductID == Convert.ToInt32(row.Cells["ProductID"].Value)).ToList();
                    if (result.Count == 0)
                    {
                        INVProductStock _iNVProductStock = new INVProductStock();
                        _iNVProductStock.InventoryID = Convert.ToInt32(cbx_Inventory.SelectedValue);
                        _iNVProductStock.CreateDate = DateTime.Now;
                        _iNVProductStock.OpeningQty = Convert.ToDecimal(row.Cells["TotalQty"].Value);
                        _iNVProductStock.OpennigDate = DateTime.Now;
                        _iNVProductStock.ProductID = Convert.ToInt32(row.Cells["ProductID"].Value);
                        _iNVProductStock.StockTypeID = 1;
                        _iNVProductStock.TotalQty = Convert.ToDecimal(row.Cells["TotalQty"].Value);
                        iNVProductStockCollection.Add(_iNVProductStock);
                    }
                }
            }

        }
Esempio n. 13
0
 private INVProductStock CollectHeaderData(DataGridViewRow row)
 {
     INVProductStock _iNVProductStock = new INVProductStock();
     _iNVProductStock.InventoryID = Convert.ToInt32(cbx_Inventory.SelectedValue);
     _iNVProductStock.OpeningQty = Convert.ToDecimal(row.Cells["TotalQty"].Value);
     _iNVProductStock.OpennigDate = DateTime.Now;
     _iNVProductStock.ProductID = Convert.ToInt32(row.Cells["ProductID"].Value);
     _iNVProductStock.StockTypeID = 1;
     _iNVProductStock.TotalQty = Convert.ToDecimal(row.Cells["TotalQty"].Value);
     _iNVProductStock.CreateDate = DateTime.Now;
     _iNVProductStock.CreatedBy = GlobalVariables.CurrentUser.UserID;
     return _iNVProductStock;
 }