/// <summary> /// This method will return an object representing the record matching the primary key information specified. /// </summary> /// /// <param name="pk" type="INVTakingInventoryLineBatchPrimaryKey">Primary Key information based on which data is to be fetched.</param> /// /// <returns>object of class INVTakingInventoryLineBatch</returns> /// /// <remarks> /// /// <RevisionHistory> /// Author Date Description /// DLGenerator 3/7/2015 2:37:29 PM Created function /// /// </RevisionHistory> /// /// </remarks> /// public static INVTakingInventoryLineBatch SelectOne(INVTakingInventoryLineBatchPrimaryKey pk) { DatabaseHelper oDatabaseHelper = new DatabaseHelper(); bool ExecutionState = false; // Pass the values of all key parameters to the stored procedure. System.Collections.Specialized.NameValueCollection nvc = pk.GetKeysAndValues(); foreach (string key in nvc.Keys) { oDatabaseHelper.AddParameter("@" + key, nvc[key]); } // The parameter '@dlgErrorCode' will contain the status after execution of the stored procedure. oDatabaseHelper.AddParameter("@dlgErrorCode", -1, System.Data.ParameterDirection.Output); IDataReader dr = oDatabaseHelper.ExecuteReader("gsp_INVTakingInventoryLineBatch_SelectbyPrimaryKey", ref ExecutionState); if (dr.Read()) { INVTakingInventoryLineBatch obj = new INVTakingInventoryLineBatch(); PopulateObjectFromReader(obj, dr); dr.Close(); oDatabaseHelper.Dispose(); return(obj); } else { dr.Close(); oDatabaseHelper.Dispose(); return(null); } }
/// <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="PURPurchaseLinePrimaryKey">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 INVTakingInventoryLineBatchCollection</returns> /// /// <remarks> /// /// <RevisionHistory> /// Author Date Description /// DLGenerator 12/27/2014 6:56:15 PM Created function /// /// </RevisionHistory> /// /// </remarks> /// public static INVTakingInventoryLineBatchCollection SelectAllByForeignKeyTakingLineIDPaged(PURPurchaseLinePrimaryKey pk, int pageSize, int skipPages, string orderByStatement) { DatabaseHelper oDatabaseHelper = new DatabaseHelper(); bool ExecutionState = false; INVTakingInventoryLineBatchCollection obj = null; // Pass the values of all key parameters to the stored procedure. System.Collections.Specialized.NameValueCollection nvc = pk.GetKeysAndValues(); foreach (string key in nvc.Keys) { oDatabaseHelper.AddParameter("@" + key, nvc[key]); } oDatabaseHelper.AddParameter("@PageSize", pageSize); oDatabaseHelper.AddParameter("@SkipPages", skipPages); oDatabaseHelper.AddParameter("@OrderByStatement", orderByStatement); // The parameter '@dlgErrorCode' will contain the status after execution of the stored procedure. oDatabaseHelper.AddParameter("@dlgErrorCode", -1, System.Data.ParameterDirection.Output); IDataReader dr = oDatabaseHelper.ExecuteReader("gsp_INVTakingInventoryLineBatch_SelectAllByForeignKeyTakingLineIDPaged", ref ExecutionState); obj = new INVTakingInventoryLineBatchCollection(); obj = INVTakingInventoryLineBatch.PopulateObjectsFromReaderWithCheckingReader(dr, oDatabaseHelper); dr.Close(); oDatabaseHelper.Dispose(); return(obj); }
/// <summary> /// This method will insert one new row into the database using the property Information /// </summary> /// /// <param name="iNVTakingInventoryLineBatch" type="INVTakingInventoryLineBatch">This INVTakingInventoryLineBatch will be inserted in the database.</param> /// /// <returns>True if succeeded</returns> public bool Insert(INVTakingInventoryLineBatch iNVTakingInventoryLineBatch) { _iNVTakingInventoryLineBatch = new POS.DataLayer.INVTakingInventoryLineBatch(); _iNVTakingInventoryLineBatch.TakingLineBatchID = iNVTakingInventoryLineBatch.TakingLineBatchID; _iNVTakingInventoryLineBatch.TakingLineID = iNVTakingInventoryLineBatch.TakingLineID; _iNVTakingInventoryLineBatch.BatchID = iNVTakingInventoryLineBatch.BatchID; return(_iNVTakingInventoryLineBatch.Insert()); }
///<summary> /// This method will update one new row into the database using the property Information /// </summary> /// /// <param name="iNVTakingInventoryLineBatch" type="INVTakingInventoryLineBatch">This INVTakingInventoryLineBatch will be updated in the database.</param> /// /// <returns>True if succeeded</returns> public bool Update(INVTakingInventoryLineBatch iNVTakingInventoryLineBatch) { _iNVTakingInventoryLineBatch = POS.DataLayer.INVTakingInventoryLineBatch.SelectOne(new POS.DataLayer.INVTakingInventoryLineBatchPrimaryKey(iNVTakingInventoryLineBatch.TakingLineBatchID)); _iNVTakingInventoryLineBatch.TakingLineID = iNVTakingInventoryLineBatch.TakingLineID; _iNVTakingInventoryLineBatch.BatchID = iNVTakingInventoryLineBatch.BatchID; return(_iNVTakingInventoryLineBatch.Update()); }
/// <summary> /// This method will return an object representing the record matching the primary key information specified. /// </summary> /// /// <param name="pk" type="INVTakingInventoryLineBatchPrimaryKey">Primary Key information based on which data is to be fetched.</param> /// /// <returns>object of class INVTakingInventoryLineBatch</returns> public INVTakingInventoryLineBatch SelectOne(INVTakingInventoryLineBatchPrimaryKey pk) { _iNVTakingInventoryLineBatchWCF = new INVTakingInventoryLineBatch(); _iNVTakingInventoryLineBatch = POS.DataLayer.INVTakingInventoryLineBatchBase.SelectOne(new POS.DataLayer.INVTakingInventoryLineBatchPrimaryKey(pk.TakingLineBatchID)); _iNVTakingInventoryLineBatchWCF.TakingLineBatchID = _iNVTakingInventoryLineBatch.TakingLineBatchID; _iNVTakingInventoryLineBatchWCF.TakingLineID = _iNVTakingInventoryLineBatch.TakingLineID; _iNVTakingInventoryLineBatchWCF.BatchID = _iNVTakingInventoryLineBatch.BatchID; return _iNVTakingInventoryLineBatchWCF; }
/// <summary> /// This method will return an object representing the record matching the primary key information specified. /// </summary> /// /// <param name="pk" type="INVTakingInventoryLineBatchPrimaryKey">Primary Key information based on which data is to be fetched.</param> /// /// <returns>object of class INVTakingInventoryLineBatch</returns> public INVTakingInventoryLineBatch SelectOne(INVTakingInventoryLineBatchPrimaryKey pk) { _iNVTakingInventoryLineBatchWCF = new INVTakingInventoryLineBatch(); _iNVTakingInventoryLineBatch = POS.DataLayer.INVTakingInventoryLineBatchBase.SelectOne(new POS.DataLayer.INVTakingInventoryLineBatchPrimaryKey(pk.TakingLineBatchID)); _iNVTakingInventoryLineBatchWCF.TakingLineBatchID = _iNVTakingInventoryLineBatch.TakingLineBatchID; _iNVTakingInventoryLineBatchWCF.TakingLineID = _iNVTakingInventoryLineBatch.TakingLineID; _iNVTakingInventoryLineBatchWCF.BatchID = _iNVTakingInventoryLineBatch.BatchID; return(_iNVTakingInventoryLineBatchWCF); }
/// <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 INVTakingInventoryLineBatchCollection</returns> /// /// <remarks> /// /// <RevisionHistory> /// Author Date Description /// DLGenerator 3/7/2015 2:37:29 PM Created function /// /// </RevisionHistory> /// /// </remarks> /// internal static INVTakingInventoryLineBatchCollection PopulateObjectsFromReader(IDataReader rdr) { INVTakingInventoryLineBatchCollection list = new INVTakingInventoryLineBatchCollection(); while (rdr.Read()) { INVTakingInventoryLineBatch obj = new INVTakingInventoryLineBatch(); PopulateObjectFromReader(obj, rdr); list.Add(obj); } return(list); }
/// <summary> /// This method will return a list of objects representing all records in the table. /// </summary> /// /// <returns>list of objects of class INVTakingInventoryLineBatch in the form of object of INVTakingInventoryLineBatchCollection </returns> public INVTakingInventoryLineBatchCollection SelectAll() { INVTakingInventoryLineBatchCollection iNVTakingInventoryLineBatchCollection = new INVTakingInventoryLineBatchCollection(); foreach (POS.DataLayer.INVTakingInventoryLineBatch _iNVTakingInventoryLineBatch in POS.DataLayer.INVTakingInventoryLineBatchBase.SelectAll()) { _iNVTakingInventoryLineBatchWCF = new INVTakingInventoryLineBatch(); _iNVTakingInventoryLineBatchWCF.TakingLineBatchID = _iNVTakingInventoryLineBatch.TakingLineBatchID; _iNVTakingInventoryLineBatchWCF.TakingLineID = _iNVTakingInventoryLineBatch.TakingLineID; _iNVTakingInventoryLineBatchWCF.BatchID = _iNVTakingInventoryLineBatch.BatchID; iNVTakingInventoryLineBatchCollection.Add(_iNVTakingInventoryLineBatchWCF); } return iNVTakingInventoryLineBatchCollection; }
/// <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 INVTakingInventoryLineBatchCollection</returns> /// /// <remarks> /// /// <RevisionHistory> /// Author Date Description /// DLGenerator 3/7/2015 2:37:29 PM Created function /// /// </RevisionHistory> /// /// </remarks> /// internal static INVTakingInventoryLineBatchCollection PopulateObjectsFromReaderWithCheckingReader(IDataReader rdr, DatabaseHelper oDatabaseHelper) { INVTakingInventoryLineBatchCollection list = new INVTakingInventoryLineBatchCollection(); if (rdr.Read()) { INVTakingInventoryLineBatch obj = new INVTakingInventoryLineBatch(); PopulateObjectFromReader(obj, rdr); list.Add(obj); while (rdr.Read()) { obj = new INVTakingInventoryLineBatch(); PopulateObjectFromReader(obj, rdr); list.Add(obj); } oDatabaseHelper.Dispose(); return(list); } else { oDatabaseHelper.Dispose(); return(null); } }
/// <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 INVTakingInventoryLineBatchCollection</returns> /// /// <remarks> /// /// <RevisionHistory> /// Author Date Description /// DLGenerator 3/7/2015 2:37:29 PM Created function /// /// </RevisionHistory> /// /// </remarks> /// internal static INVTakingInventoryLineBatchCollection PopulateObjectsFromReaderWithCheckingReader(IDataReader rdr, DatabaseHelper oDatabaseHelper) { INVTakingInventoryLineBatchCollection list = new INVTakingInventoryLineBatchCollection(); if (rdr.Read()) { INVTakingInventoryLineBatch obj = new INVTakingInventoryLineBatch(); PopulateObjectFromReader(obj, rdr); list.Add(obj); while (rdr.Read()) { obj = new INVTakingInventoryLineBatch(); PopulateObjectFromReader(obj, rdr); list.Add(obj); } oDatabaseHelper.Dispose(); return list; } else { oDatabaseHelper.Dispose(); return null; } }
/// <summary> /// This method will insert one new row into the database using the property Information /// </summary> /// /// <param name="iNVTakingInventoryLineBatch" type="INVTakingInventoryLineBatch">This INVTakingInventoryLineBatch will be inserted in the database.</param> /// /// <returns>True if succeeded</returns> public bool Insert(INVTakingInventoryLineBatch iNVTakingInventoryLineBatch) { _iNVTakingInventoryLineBatch = new POS.DataLayer.INVTakingInventoryLineBatch(); _iNVTakingInventoryLineBatch.TakingLineBatchID=iNVTakingInventoryLineBatch.TakingLineBatchID; _iNVTakingInventoryLineBatch.TakingLineID=iNVTakingInventoryLineBatch.TakingLineID; _iNVTakingInventoryLineBatch.BatchID=iNVTakingInventoryLineBatch.BatchID; return _iNVTakingInventoryLineBatch.Insert(); }
/// <summary> /// This method will return an object representing the record matching the primary key information specified. /// </summary> /// /// <param name="pk" type="INVTakingInventoryLineBatchPrimaryKey">Primary Key information based on which data is to be fetched.</param> /// /// <returns>object of class INVTakingInventoryLineBatch</returns> /// /// <remarks> /// /// <RevisionHistory> /// Author Date Description /// DLGenerator 3/7/2015 2:37:29 PM Created function /// /// </RevisionHistory> /// /// </remarks> /// public static INVTakingInventoryLineBatch SelectOne(INVTakingInventoryLineBatchPrimaryKey pk) { DatabaseHelper oDatabaseHelper = new DatabaseHelper(); bool ExecutionState = false; // Pass the values of all key parameters to the stored procedure. System.Collections.Specialized.NameValueCollection nvc = pk.GetKeysAndValues(); foreach (string key in nvc.Keys) { oDatabaseHelper.AddParameter("@" + key,nvc[key] ); } // The parameter '@dlgErrorCode' will contain the status after execution of the stored procedure. oDatabaseHelper.AddParameter("@dlgErrorCode", -1, System.Data.ParameterDirection.Output); IDataReader dr=oDatabaseHelper.ExecuteReader("gsp_INVTakingInventoryLineBatch_SelectbyPrimaryKey", ref ExecutionState); if (dr.Read()) { INVTakingInventoryLineBatch obj=new INVTakingInventoryLineBatch(); PopulateObjectFromReader(obj,dr); dr.Close(); oDatabaseHelper.Dispose(); return obj; } else { dr.Close(); oDatabaseHelper.Dispose(); return null; } }
///<summary> /// This method will update one new row into the database using the property Information /// </summary> /// /// <param name="iNVTakingInventoryLineBatch" type="INVTakingInventoryLineBatch">This INVTakingInventoryLineBatch will be updated in the database.</param> /// /// <returns>True if succeeded</returns> public bool Update(INVTakingInventoryLineBatch iNVTakingInventoryLineBatch) { _iNVTakingInventoryLineBatch=POS.DataLayer.INVTakingInventoryLineBatch.SelectOne(new POS.DataLayer.INVTakingInventoryLineBatchPrimaryKey(iNVTakingInventoryLineBatch.TakingLineBatchID)); _iNVTakingInventoryLineBatch.TakingLineID=iNVTakingInventoryLineBatch.TakingLineID; _iNVTakingInventoryLineBatch.BatchID=iNVTakingInventoryLineBatch.BatchID; return _iNVTakingInventoryLineBatch.Update(); }
/// <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 INVTakingInventoryLineBatch</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 INVTakingInventoryLineBatch in the form of an object of class INVTakingInventoryLineBatchCollection</returns> public INVTakingInventoryLineBatchCollection SelectByFieldPaged(string field, object fieldValue, object fieldValue2, TypeOperation typeOperation, int pageSize, int skipPages, string orderByStatement) { INVTakingInventoryLineBatchCollection iNVTakingInventoryLineBatchCollection = new INVTakingInventoryLineBatchCollection(); foreach (POS.DataLayer.INVTakingInventoryLineBatch _iNVTakingInventoryLineBatch in POS.DataLayer.INVTakingInventoryLineBatchBase.SelectByFieldPaged(field, fieldValue, fieldValue2, typeOperation, pageSize, skipPages, orderByStatement)) { _iNVTakingInventoryLineBatchWCF = new INVTakingInventoryLineBatch(); _iNVTakingInventoryLineBatchWCF.TakingLineBatchID = _iNVTakingInventoryLineBatch.TakingLineBatchID; _iNVTakingInventoryLineBatchWCF.TakingLineID = _iNVTakingInventoryLineBatch.TakingLineID; _iNVTakingInventoryLineBatchWCF.BatchID = _iNVTakingInventoryLineBatch.BatchID; iNVTakingInventoryLineBatchCollection.Add(_iNVTakingInventoryLineBatchWCF); } return iNVTakingInventoryLineBatchCollection; }
/// <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 INVTakingInventoryLineBatch in the form of an object of class INVTakingInventoryLineBatchCollection </returns> public INVTakingInventoryLineBatchCollection SelectAllPaged(int? pageSize, int? skipPages, string orderByStatement) { INVTakingInventoryLineBatchCollection iNVTakingInventoryLineBatchCollection = new INVTakingInventoryLineBatchCollection(); foreach (POS.DataLayer.INVTakingInventoryLineBatch _iNVTakingInventoryLineBatch in POS.DataLayer.INVTakingInventoryLineBatchBase.SelectAllPaged(pageSize, skipPages, orderByStatement)) { _iNVTakingInventoryLineBatchWCF = new INVTakingInventoryLineBatch(); _iNVTakingInventoryLineBatchWCF.TakingLineBatchID = _iNVTakingInventoryLineBatch.TakingLineBatchID; _iNVTakingInventoryLineBatchWCF.TakingLineID = _iNVTakingInventoryLineBatch.TakingLineID; _iNVTakingInventoryLineBatchWCF.BatchID = _iNVTakingInventoryLineBatch.BatchID; iNVTakingInventoryLineBatchCollection.Add(_iNVTakingInventoryLineBatchWCF); } return iNVTakingInventoryLineBatchCollection; }
/// <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 INVTakingInventoryLineBatchCollection</returns> /// /// <remarks> /// /// <RevisionHistory> /// Author Date Description /// DLGenerator 3/7/2015 2:37:29 PM Created function /// /// </RevisionHistory> /// /// </remarks> /// internal static INVTakingInventoryLineBatchCollection PopulateObjectsFromReader(IDataReader rdr) { INVTakingInventoryLineBatchCollection list = new INVTakingInventoryLineBatchCollection(); while (rdr.Read()) { INVTakingInventoryLineBatch obj = new INVTakingInventoryLineBatch(); PopulateObjectFromReader(obj,rdr); list.Add(obj); } return list; }
/// <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 INVTakingInventoryLineBatch</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 INVTakingInventoryLineBatch in the form of an object of class INVTakingInventoryLineBatchCollection</returns> public INVTakingInventoryLineBatchCollection SelectByField(string field, object fieldValue, object fieldValue2, TypeOperation typeOperation) { INVTakingInventoryLineBatchCollection iNVTakingInventoryLineBatchCollection = new INVTakingInventoryLineBatchCollection(); foreach (POS.DataLayer.INVTakingInventoryLineBatch _iNVTakingInventoryLineBatch in POS.DataLayer.INVTakingInventoryLineBatchBase.SelectByField(field, fieldValue, fieldValue2, typeOperation)) { _iNVTakingInventoryLineBatchWCF = new INVTakingInventoryLineBatch(); _iNVTakingInventoryLineBatchWCF.TakingLineBatchID = _iNVTakingInventoryLineBatch.TakingLineBatchID; _iNVTakingInventoryLineBatchWCF.TakingLineID = _iNVTakingInventoryLineBatch.TakingLineID; _iNVTakingInventoryLineBatchWCF.BatchID = _iNVTakingInventoryLineBatch.BatchID; iNVTakingInventoryLineBatchCollection.Add(_iNVTakingInventoryLineBatchWCF); } return iNVTakingInventoryLineBatchCollection; }