///<summary> /// This method will update one new row into the database using the property Information /// </summary> /// /// <param name="bDTaxType" type="BDTaxType">This BDTaxType will be updated in the database.</param> /// /// <returns>True if succeeded</returns> public bool Update(BDTaxType bDTaxType) { _bDTaxType = POS.DataLayer.BDTaxType.SelectOne(new POS.DataLayer.BDTaxTypePrimaryKey(bDTaxType.TaxTypeID)); _bDTaxType.TaxTypeName = bDTaxType.TaxTypeName; return(_bDTaxType.Update()); }
/// <summary> /// This method will insert one new row into the database using the property Information /// </summary> /// /// <param name="bDTaxType" type="BDTaxType">This BDTaxType will be inserted in the database.</param> /// /// <returns>True if succeeded</returns> public bool Insert(BDTaxType bDTaxType) { _bDTaxType = new POS.DataLayer.BDTaxType(); _bDTaxType.TaxTypeID = bDTaxType.TaxTypeID; _bDTaxType.TaxTypeName = bDTaxType.TaxTypeName; return(_bDTaxType.Insert()); }
/// <summary> /// This method will return an object representing the record matching the primary key information specified. /// </summary> /// /// <param name="pk" type="BDTaxTypePrimaryKey">Primary Key information based on which data is to be fetched.</param> /// /// <returns>object of class BDTaxType</returns> public BDTaxType SelectOne(BDTaxTypePrimaryKey pk) { _bDTaxTypeWCF = new BDTaxType(); _bDTaxType = POS.DataLayer.BDTaxTypeBase.SelectOne(new POS.DataLayer.BDTaxTypePrimaryKey(pk.TaxTypeID)); _bDTaxTypeWCF.TaxTypeID = _bDTaxType.TaxTypeID; _bDTaxTypeWCF.TaxTypeName = _bDTaxType.TaxTypeName; return(_bDTaxTypeWCF); }
/// <summary> /// This method will return an object representing the record matching the primary key information specified. /// </summary> /// /// <param name="pk" type="BDTaxTypePrimaryKey">Primary Key information based on which data is to be fetched.</param> /// /// <returns>object of class BDTaxType</returns> public BDTaxType SelectOne(BDTaxTypePrimaryKey pk) { _bDTaxTypeWCF = new BDTaxType(); _bDTaxType = POS.DataLayer.BDTaxTypeBase.SelectOne(new POS.DataLayer.BDTaxTypePrimaryKey(pk.TaxTypeID)); _bDTaxTypeWCF.TaxTypeID = _bDTaxType.TaxTypeID; _bDTaxTypeWCF.TaxTypeName = _bDTaxType.TaxTypeName; _bDTaxTypeWCF.TaxValue = _bDTaxType.TaxValue; return _bDTaxTypeWCF; }
/// <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 BDTaxTypeCollection</returns> /// /// <remarks> /// /// <RevisionHistory> /// Author Date Description /// DLGenerator 3/7/2015 2:37:03 PM Created function /// /// </RevisionHistory> /// /// </remarks> /// internal static BDTaxTypeCollection PopulateObjectsFromReader(IDataReader rdr) { BDTaxTypeCollection list = new BDTaxTypeCollection(); while (rdr.Read()) { BDTaxType obj = new BDTaxType(); 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 BDTaxType in the form of object of BDTaxTypeCollection </returns> public BDTaxTypeCollection SelectAll() { BDTaxTypeCollection bDTaxTypeCollection = new BDTaxTypeCollection(); foreach (POS.DataLayer.BDTaxType _bDTaxType in POS.DataLayer.BDTaxTypeBase.SelectAll()) { _bDTaxTypeWCF = new BDTaxType(); _bDTaxTypeWCF.TaxTypeID = _bDTaxType.TaxTypeID; _bDTaxTypeWCF.TaxTypeName = _bDTaxType.TaxTypeName; _bDTaxTypeWCF.TaxValue = _bDTaxType.TaxValue; bDTaxTypeCollection.Add(_bDTaxTypeWCF); } return bDTaxTypeCollection; }
/// <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 BDTaxTypeCollection</returns> /// /// <remarks> /// /// <RevisionHistory> /// Author Date Description /// DLGenerator 3/7/2015 2:37:03 PM Created function /// /// </RevisionHistory> /// /// </remarks> /// internal static BDTaxTypeCollection PopulateObjectsFromReaderWithCheckingReader(IDataReader rdr, DatabaseHelper oDatabaseHelper) { BDTaxTypeCollection list = new BDTaxTypeCollection(); if (rdr.Read()) { BDTaxType obj = new BDTaxType(); PopulateObjectFromReader(obj, rdr); list.Add(obj); while (rdr.Read()) { obj = new BDTaxType(); PopulateObjectFromReader(obj, rdr); list.Add(obj); } oDatabaseHelper.Dispose(); return(list); } else { oDatabaseHelper.Dispose(); return(null); } }
///<summary> /// This method will update one new row into the database using the property Information /// </summary> /// /// <param name="bDTaxType" type="BDTaxType">This BDTaxType will be updated in the database.</param> /// /// <returns>True if succeeded</returns> public bool Update(BDTaxType bDTaxType) { _bDTaxType = POS.DataLayer.BDTaxType.SelectOne(new POS.DataLayer.BDTaxTypePrimaryKey(bDTaxType.TaxTypeID)); _bDTaxType.TaxTypeName = bDTaxType.TaxTypeName; _bDTaxType.TaxValue = bDTaxType.TaxValue; return _bDTaxType.Update(); }
/// <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 BDTaxType in the form of an object of class BDTaxTypeCollection </returns> public BDTaxTypeCollection SelectAllPaged(int? pageSize, int? skipPages, string orderByStatement) { BDTaxTypeCollection bDTaxTypeCollection = new BDTaxTypeCollection(); foreach (POS.DataLayer.BDTaxType _bDTaxType in POS.DataLayer.BDTaxTypeBase.SelectAllPaged(pageSize, skipPages, orderByStatement)) { _bDTaxTypeWCF = new BDTaxType(); _bDTaxTypeWCF.TaxTypeID = _bDTaxType.TaxTypeID; _bDTaxTypeWCF.TaxTypeName = _bDTaxType.TaxTypeName; _bDTaxTypeWCF.TaxValue = _bDTaxType.TaxValue; bDTaxTypeCollection.Add(_bDTaxTypeWCF); } return bDTaxTypeCollection; }
/// <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 BDTaxType</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 BDTaxType in the form of an object of class BDTaxTypeCollection</returns> public BDTaxTypeCollection SelectByFieldPaged(string field, object fieldValue, object fieldValue2, TypeOperation typeOperation, int pageSize, int skipPages, string orderByStatement) { BDTaxTypeCollection bDTaxTypeCollection = new BDTaxTypeCollection(); foreach (POS.DataLayer.BDTaxType _bDTaxType in POS.DataLayer.BDTaxTypeBase.SelectByFieldPaged(field, fieldValue, fieldValue2, typeOperation, pageSize, skipPages, orderByStatement)) { _bDTaxTypeWCF = new BDTaxType(); _bDTaxTypeWCF.TaxTypeID = _bDTaxType.TaxTypeID; _bDTaxTypeWCF.TaxTypeName = _bDTaxType.TaxTypeName; _bDTaxTypeWCF.TaxValue = _bDTaxType.TaxValue; bDTaxTypeCollection.Add(_bDTaxTypeWCF); } return bDTaxTypeCollection; }
/// <summary> /// This method will insert one new row into the database using the property Information /// </summary> /// /// <param name="bDTaxType" type="BDTaxType">This BDTaxType will be inserted in the database.</param> /// /// <returns>True if succeeded</returns> public bool Insert(BDTaxType bDTaxType) { _bDTaxType = new POS.DataLayer.BDTaxType(); _bDTaxType.TaxTypeID = bDTaxType.TaxTypeID; _bDTaxType.TaxTypeName = bDTaxType.TaxTypeName; _bDTaxType.TaxValue = bDTaxType.TaxValue; return _bDTaxType.Insert(); }
/// <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 BDTaxType</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 BDTaxType in the form of an object of class BDTaxTypeCollection</returns> public BDTaxTypeCollection SelectByField(string field, object fieldValue, object fieldValue2, TypeOperation typeOperation) { BDTaxTypeCollection bDTaxTypeCollection = new BDTaxTypeCollection(); foreach (POS.DataLayer.BDTaxType _bDTaxType in POS.DataLayer.BDTaxTypeBase.SelectByField(field, fieldValue, fieldValue2, typeOperation)) { _bDTaxTypeWCF = new BDTaxType(); _bDTaxTypeWCF.TaxTypeID = _bDTaxType.TaxTypeID; _bDTaxTypeWCF.TaxTypeName = _bDTaxType.TaxTypeName; _bDTaxTypeWCF.TaxValue = _bDTaxType.TaxValue; bDTaxTypeCollection.Add(_bDTaxTypeWCF); } return bDTaxTypeCollection; }
/// <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 BDTaxTypeCollection</returns> /// /// <remarks> /// /// <RevisionHistory> /// Author Date Description /// DLGenerator 3/7/2015 2:37:03 PM Created function /// /// </RevisionHistory> /// /// </remarks> /// internal static BDTaxTypeCollection PopulateObjectsFromReaderWithCheckingReader(IDataReader rdr, DatabaseHelper oDatabaseHelper) { BDTaxTypeCollection list = new BDTaxTypeCollection(); if (rdr.Read()) { BDTaxType obj = new BDTaxType(); PopulateObjectFromReader(obj, rdr); list.Add(obj); while (rdr.Read()) { obj = new BDTaxType(); 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 BDTaxTypeCollection</returns> /// /// <remarks> /// /// <RevisionHistory> /// Author Date Description /// DLGenerator 3/7/2015 2:37:03 PM Created function /// /// </RevisionHistory> /// /// </remarks> /// internal static BDTaxTypeCollection PopulateObjectsFromReader(IDataReader rdr) { BDTaxTypeCollection list = new BDTaxTypeCollection(); while (rdr.Read()) { BDTaxType obj = new BDTaxType(); 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 /// along with the details of the child table. /// </summary> /// /// <param name="pk" type="BDTaxTypePrimaryKey">Primary Key information based on which data is to be fetched.</param> /// /// <returns>object of class BDTaxType</returns> /// /// <remarks> /// /// <RevisionHistory> /// Author Date Description /// DLGenerator 3/7/2015 2:37:03 PM Created function /// /// </RevisionHistory> /// /// </remarks> /// public static BDTaxType SelectOneWithSALSalesHeaderUsingTaxTypeID(BDTaxTypePrimaryKey pk) { DatabaseHelper oDatabaseHelper = new DatabaseHelper(); bool ExecutionState = false; BDTaxType 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] ); } // 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_BDTaxType_SelectOneWithSALSalesHeaderUsingTaxTypeID", ref ExecutionState); if (dr.Read()) { obj= new BDTaxType(); PopulateObjectFromReader(obj,dr); dr.NextResult(); //Get the child records. obj.SALSalesHeaderCollectionUsingTaxTypeID=SALSalesHeader.PopulateObjectsFromReader(dr); } dr.Close(); oDatabaseHelper.Dispose(); return obj; }