private static VSALSalesOrderCollection PopulateObjectsFromReader(IDataReader rdr) { VSALSalesOrderCollection list = new VSALSalesOrderCollection(); while (rdr.Read()) { VSALSalesOrder obj = new VSALSalesOrder(); PopulateObjectFromReader(obj, rdr); list.Add(obj); } return list; }
public VSALSalesOrderCollection VSALSalesOrder_SelectOneByInvoiceNumber(string InvoiceNumber) { VSALSalesOrderCollection vSALSalesOrderCollection = new VSALSalesOrderCollection(); VSALSalesOrder _vSALSalesOrderWCF = new VSALSalesOrder(); foreach (POS.DataLayer.VSALSalesOrder _vSALSalesOrder in POS.DataLayer.VSALSalesOrder.SelectByInvoiceNumber("InvoiceNumber", InvoiceNumber, null, DataLayer.TypeOperation.Equal)) { _vSALSalesOrderWCF = new VSALSalesOrder(); _vSALSalesOrderWCF.CustomerID = _vSALSalesOrder.CustomerID; _vSALSalesOrderWCF.CustomerName = _vSALSalesOrder.CustomerName; _vSALSalesOrderWCF.Qty = _vSALSalesOrder.Qty; _vSALSalesOrderWCF.SalesLineID = _vSALSalesOrder.SalesLineID; _vSALSalesOrderWCF.TotalQty = _vSALSalesOrder.TotalQty; _vSALSalesOrderWCF.UnitPrice = _vSALSalesOrder.UnitPrice; _vSALSalesOrderWCF.BatchNumber = _vSALSalesOrder.BatchNumber; _vSALSalesOrderWCF.ExpiryDate = _vSALSalesOrder.ExpiryDate; _vSALSalesOrderWCF.TaxValue = _vSALSalesOrder.TaxValue; _vSALSalesOrderWCF.SalesHeaderID = _vSALSalesOrder.SalesHeaderID; _vSALSalesOrderWCF.SalesDate = _vSALSalesOrder.SalesDate; _vSALSalesOrderWCF.InvoiceNumber = _vSALSalesOrder.InvoiceNumber; _vSALSalesOrderWCF.InvoiceDate = _vSALSalesOrder.InvoiceDate; _vSALSalesOrderWCF.PaymentTypeID = _vSALSalesOrder.PaymentTypeID; _vSALSalesOrderWCF.TotalDiscountRatio = _vSALSalesOrder.TotalDiscountRatio; _vSALSalesOrderWCF.TaxTypeName = _vSALSalesOrder.TaxTypeName; _vSALSalesOrderWCF.IsClosed = _vSALSalesOrder.IsClosed; _vSALSalesOrderWCF.IsVoid = _vSALSalesOrder.IsVoid; _vSALSalesOrderWCF.FinalPrice = _vSALSalesOrder.FinalPrice; _vSALSalesOrderWCF.ChequeNumber = _vSALSalesOrder.ChequeNumber; _vSALSalesOrderWCF.ProductName = _vSALSalesOrder.ProductName; _vSALSalesOrderWCF.ProductCode = _vSALSalesOrder.ProductCode; _vSALSalesOrderWCF.IsAcceptBatch = _vSALSalesOrder.IsAcceptBatch; _vSALSalesOrderWCF.UserFullName = _vSALSalesOrder.UserFullName; _vSALSalesOrderWCF.ProductID = _vSALSalesOrder.ProductID; vSALSalesOrderCollection.Add(_vSALSalesOrderWCF); } return(vSALSalesOrderCollection); }
public VSALSalesOrderCollection VSALSalesOrder_SelectOneByInvoiceNumber(string InvoiceNumber) { VSALSalesOrderCollection vSALSalesOrderCollection = new VSALSalesOrderCollection(); VSALSalesOrder _vSALSalesOrderWCF = new VSALSalesOrder(); foreach (POS.DataLayer.VSALSalesOrder _vSALSalesOrder in POS.DataLayer.VSALSalesOrder.SelectByInvoiceNumber("InvoiceNumber", InvoiceNumber, null, DataLayer.TypeOperation.Equal)) { _vSALSalesOrderWCF = new VSALSalesOrder(); _vSALSalesOrderWCF.CustomerID = _vSALSalesOrder.CustomerID; _vSALSalesOrderWCF.CustomerName = _vSALSalesOrder.CustomerName; _vSALSalesOrderWCF.Qty = _vSALSalesOrder.Qty; _vSALSalesOrderWCF.SalesLineID = _vSALSalesOrder.SalesLineID; _vSALSalesOrderWCF.TotalQty = _vSALSalesOrder.TotalQty; _vSALSalesOrderWCF.UnitPrice = _vSALSalesOrder.UnitPrice; _vSALSalesOrderWCF.BatchNumber = _vSALSalesOrder.BatchNumber; _vSALSalesOrderWCF.ExpiryDate = _vSALSalesOrder.ExpiryDate; _vSALSalesOrderWCF.TaxValue = _vSALSalesOrder.TaxValue; _vSALSalesOrderWCF.SalesHeaderID = _vSALSalesOrder.SalesHeaderID; _vSALSalesOrderWCF.SalesDate = _vSALSalesOrder.SalesDate; _vSALSalesOrderWCF.InvoiceNumber = _vSALSalesOrder.InvoiceNumber; _vSALSalesOrderWCF.InvoiceDate = _vSALSalesOrder.InvoiceDate; _vSALSalesOrderWCF.PaymentTypeID = _vSALSalesOrder.PaymentTypeID; _vSALSalesOrderWCF.TotalDiscountRatio = _vSALSalesOrder.TotalDiscountRatio; _vSALSalesOrderWCF.TaxTypeName = _vSALSalesOrder.TaxTypeName; _vSALSalesOrderWCF.IsClosed = _vSALSalesOrder.IsClosed; _vSALSalesOrderWCF.IsVoid = _vSALSalesOrder.IsVoid; _vSALSalesOrderWCF.FinalPrice = _vSALSalesOrder.FinalPrice; _vSALSalesOrderWCF.ChequeNumber = _vSALSalesOrder.ChequeNumber; _vSALSalesOrderWCF.ProductName = _vSALSalesOrder.ProductName; _vSALSalesOrderWCF.ProductCode = _vSALSalesOrder.ProductCode; _vSALSalesOrderWCF.IsAcceptBatch = _vSALSalesOrder.IsAcceptBatch; _vSALSalesOrderWCF.UserFullName = _vSALSalesOrder.UserFullName; _vSALSalesOrderWCF.ProductID = _vSALSalesOrder.ProductID; vSALSalesOrderCollection.Add(_vSALSalesOrderWCF); } return vSALSalesOrderCollection; }
/// <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 VSALSalesOrder</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 VSALSalesOrder in the form of an object of class VSALSalesOrderCollection</returns> public VSALSalesOrderCollection SelectByFieldPaged(string field, object fieldValue, object fieldValue2, TypeOperation typeOperation, int pageSize, int skipPages, string orderByStatement) { VSALSalesOrderCollection vSALSalesOrderCollection = new VSALSalesOrderCollection(); foreach (POS.DataLayer.VSALSalesOrder _vSALSalesOrder in POS.DataLayer.VSALSalesOrderBase.SelectByFieldPaged(field, fieldValue, fieldValue2, typeOperation, pageSize, skipPages, orderByStatement)) { _vSALSalesOrderWCF = new VSALSalesOrder(); _vSALSalesOrderWCF.CustomerID = _vSALSalesOrder.CustomerID; _vSALSalesOrderWCF.CustomerName = _vSALSalesOrder.CustomerName; _vSALSalesOrderWCF.Qty = _vSALSalesOrder.Qty; _vSALSalesOrderWCF.SalesLineID = _vSALSalesOrder.SalesLineID; _vSALSalesOrderWCF.TotalQty = _vSALSalesOrder.TotalQty; _vSALSalesOrderWCF.UnitPrice = _vSALSalesOrder.UnitPrice; _vSALSalesOrderWCF.BatchNumber = _vSALSalesOrder.BatchNumber; _vSALSalesOrderWCF.ExpiryDate = _vSALSalesOrder.ExpiryDate; _vSALSalesOrderWCF.TaxValue = _vSALSalesOrder.TaxValue; _vSALSalesOrderWCF.SalesHeaderID = _vSALSalesOrder.SalesHeaderID; _vSALSalesOrderWCF.SalesDate = _vSALSalesOrder.SalesDate; _vSALSalesOrderWCF.InvoiceNumber = _vSALSalesOrder.InvoiceNumber; _vSALSalesOrderWCF.InvoiceDate = _vSALSalesOrder.InvoiceDate; _vSALSalesOrderWCF.PaymentTypeID = _vSALSalesOrder.PaymentTypeID; _vSALSalesOrderWCF.TotalDiscountRatio = _vSALSalesOrder.TotalDiscountRatio; _vSALSalesOrderWCF.TaxTypeName = _vSALSalesOrder.TaxTypeName; _vSALSalesOrderWCF.IsClosed = _vSALSalesOrder.IsClosed; _vSALSalesOrderWCF.IsVoid = _vSALSalesOrder.IsVoid; _vSALSalesOrderWCF.FinalPrice = _vSALSalesOrder.FinalPrice; _vSALSalesOrderWCF.ChequeNumber = _vSALSalesOrder.ChequeNumber; _vSALSalesOrderWCF.ProductName = _vSALSalesOrder.ProductName; _vSALSalesOrderWCF.ProductCode = _vSALSalesOrder.ProductCode; _vSALSalesOrderWCF.IsAcceptBatch = _vSALSalesOrder.IsAcceptBatch; _vSALSalesOrderWCF.UserFullName = _vSALSalesOrder.UserFullName; _vSALSalesOrderWCF.ProductID = _vSALSalesOrder.ProductID; vSALSalesOrderCollection.Add(_vSALSalesOrderWCF); } return(vSALSalesOrderCollection); }
/// <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 VSALSalesOrder</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 VSALSalesOrder in the form of an object of class VSALSalesOrderCollection</returns> public VSALSalesOrderCollection SelectByFieldPaged(string field, object fieldValue, object fieldValue2, TypeOperation typeOperation, int pageSize, int skipPages, string orderByStatement) { VSALSalesOrderCollection vSALSalesOrderCollection = new VSALSalesOrderCollection(); foreach (POS.DataLayer.VSALSalesOrder _vSALSalesOrder in POS.DataLayer.VSALSalesOrderBase.SelectByFieldPaged(field, fieldValue, fieldValue2, typeOperation, pageSize, skipPages, orderByStatement)) { _vSALSalesOrderWCF = new VSALSalesOrder(); _vSALSalesOrderWCF.CustomerID = _vSALSalesOrder.CustomerID; _vSALSalesOrderWCF.CustomerName = _vSALSalesOrder.CustomerName; _vSALSalesOrderWCF.Qty = _vSALSalesOrder.Qty; _vSALSalesOrderWCF.SalesLineID = _vSALSalesOrder.SalesLineID; _vSALSalesOrderWCF.TotalQty = _vSALSalesOrder.TotalQty; _vSALSalesOrderWCF.UnitPrice = _vSALSalesOrder.UnitPrice; _vSALSalesOrderWCF.BatchNumber = _vSALSalesOrder.BatchNumber; _vSALSalesOrderWCF.ExpiryDate = _vSALSalesOrder.ExpiryDate; _vSALSalesOrderWCF.TaxValue = _vSALSalesOrder.TaxValue; _vSALSalesOrderWCF.SalesHeaderID = _vSALSalesOrder.SalesHeaderID; _vSALSalesOrderWCF.SalesDate = _vSALSalesOrder.SalesDate; _vSALSalesOrderWCF.InvoiceNumber = _vSALSalesOrder.InvoiceNumber; _vSALSalesOrderWCF.InvoiceDate = _vSALSalesOrder.InvoiceDate; _vSALSalesOrderWCF.PaymentTypeID = _vSALSalesOrder.PaymentTypeID; _vSALSalesOrderWCF.TotalDiscountRatio = _vSALSalesOrder.TotalDiscountRatio; _vSALSalesOrderWCF.TaxTypeName = _vSALSalesOrder.TaxTypeName; _vSALSalesOrderWCF.IsClosed = _vSALSalesOrder.IsClosed; _vSALSalesOrderWCF.IsVoid = _vSALSalesOrder.IsVoid; _vSALSalesOrderWCF.FinalPrice = _vSALSalesOrder.FinalPrice; _vSALSalesOrderWCF.ChequeNumber = _vSALSalesOrder.ChequeNumber; _vSALSalesOrderWCF.ProductName = _vSALSalesOrder.ProductName; _vSALSalesOrderWCF.ProductCode = _vSALSalesOrder.ProductCode; _vSALSalesOrderWCF.IsAcceptBatch = _vSALSalesOrder.IsAcceptBatch; _vSALSalesOrderWCF.UserFullName = _vSALSalesOrder.UserFullName; _vSALSalesOrderWCF.ProductID = _vSALSalesOrder.ProductID; vSALSalesOrderCollection.Add(_vSALSalesOrderWCF); } return vSALSalesOrderCollection; }
/// <summary> /// Populates the fields for multiple objects from the columns found in an open reader. /// </summary> /// /// <param name="rdr" type="IDataReader">An object that implements the IDataReader interface</param> /// /// <returns>Object of VSALSalesOrderCollection</returns> /// /// <remarks> /// /// <RevisionHistory> /// Author Date Description /// DLGenerator 3/19/2015 1:00:17 PM Created function /// /// </RevisionHistory> /// /// </remarks> /// internal static VSALSalesOrderCollection PopulateObjectsFromReaderWithCheckingReader(IDataReader rdr, DatabaseHelper oDatabaseHelper) { VSALSalesOrderCollection list = new VSALSalesOrderCollection(); if (rdr.Read()) { VSALSalesOrder obj = new VSALSalesOrder(); PopulateObjectFromReader(obj, rdr); list.Add(obj); while (rdr.Read()) { obj = new VSALSalesOrder(); PopulateObjectFromReader(obj, rdr); list.Add(obj); } oDatabaseHelper.Dispose(); return list; } else { oDatabaseHelper.Dispose(); return null; } }