///<summary> /// This method will update one new row into the database using the property Information /// </summary> /// /// <param name="bDCustomer" type="BDCustomer">This BDCustomer will be updated in the database.</param> /// /// <returns>True if succeeded</returns> public bool Update(BDCustomer bDCustomer) { _bDCustomer = POS.DataLayer.BDCustomer.SelectOne(new POS.DataLayer.BDCustomerPrimaryKey(bDCustomer.CustomerID)); _bDCustomer.CustomerName = bDCustomer.CustomerName; _bDCustomer.CustomerCode = bDCustomer.CustomerCode; _bDCustomer.Address = bDCustomer.Address; _bDCustomer.Phone1 = bDCustomer.Phone1; _bDCustomer.Phone2 = bDCustomer.Phone2; _bDCustomer.Mobile1 = bDCustomer.Mobile1; _bDCustomer.Mobile2 = bDCustomer.Mobile2; _bDCustomer.Email = bDCustomer.Email; _bDCustomer.IsActive = bDCustomer.IsActive; return(_bDCustomer.Update()); }
/// <summary> /// This method will insert one new row into the database using the property Information /// </summary> /// /// <param name="bDCustomer" type="BDCustomer">This BDCustomer will be inserted in the database.</param> /// /// <returns>True if succeeded</returns> public bool Insert(BDCustomer bDCustomer) { _bDCustomer = new POS.DataLayer.BDCustomer(); _bDCustomer.CustomerID = bDCustomer.CustomerID; _bDCustomer.CustomerName = bDCustomer.CustomerName; _bDCustomer.CustomerCode = bDCustomer.CustomerCode; _bDCustomer.Address = bDCustomer.Address; _bDCustomer.Phone1 = bDCustomer.Phone1; _bDCustomer.Phone2 = bDCustomer.Phone2; _bDCustomer.Mobile1 = bDCustomer.Mobile1; _bDCustomer.Mobile2 = bDCustomer.Mobile2; _bDCustomer.Email = bDCustomer.Email; _bDCustomer.IsActive = bDCustomer.IsActive; return(_bDCustomer.Insert()); }
/// <summary> /// This method will return an object representing the record matching the primary key information specified. /// </summary> /// /// <param name="pk" type="BDCustomerPrimaryKey">Primary Key information based on which data is to be fetched.</param> /// /// <returns>object of class BDCustomer</returns> public BDCustomer SelectOne(BDCustomerPrimaryKey pk) { _bDCustomerWCF = new BDCustomer(); _bDCustomer = POS.DataLayer.BDCustomerBase.SelectOne(new POS.DataLayer.BDCustomerPrimaryKey(pk.CustomerID)); _bDCustomerWCF.CustomerID = _bDCustomer.CustomerID; _bDCustomerWCF.CustomerName = _bDCustomer.CustomerName; _bDCustomerWCF.CustomerCode = _bDCustomer.CustomerCode; _bDCustomerWCF.Address = _bDCustomer.Address; _bDCustomerWCF.Phone1 = _bDCustomer.Phone1; _bDCustomerWCF.Phone2 = _bDCustomer.Phone2; _bDCustomerWCF.Mobile1 = _bDCustomer.Mobile1; _bDCustomerWCF.Mobile2 = _bDCustomer.Mobile2; _bDCustomerWCF.Email = _bDCustomer.Email; _bDCustomerWCF.IsActive = _bDCustomer.IsActive; return(_bDCustomerWCF); }
/// <summary> /// This method will return an object representing the record matching the primary key information specified. /// </summary> /// /// <param name="pk" type="BDCustomerPrimaryKey">Primary Key information based on which data is to be fetched.</param> /// /// <returns>object of class BDCustomer</returns> public BDCustomer SelectOne(BDCustomerPrimaryKey pk) { _bDCustomerWCF = new BDCustomer(); _bDCustomer = POS.DataLayer.BDCustomerBase.SelectOne(new POS.DataLayer.BDCustomerPrimaryKey(pk.CustomerID)); _bDCustomerWCF.CustomerID = _bDCustomer.CustomerID; _bDCustomerWCF.CustomerName = _bDCustomer.CustomerName; _bDCustomerWCF.CustomerCode = _bDCustomer.CustomerCode; _bDCustomerWCF.Address = _bDCustomer.Address; _bDCustomerWCF.Phone1 = _bDCustomer.Phone1; _bDCustomerWCF.Phone2 = _bDCustomer.Phone2; _bDCustomerWCF.Mobile1 = _bDCustomer.Mobile1; _bDCustomerWCF.Mobile2 = _bDCustomer.Mobile2; _bDCustomerWCF.Email = _bDCustomer.Email; _bDCustomerWCF.IsActive = _bDCustomer.IsActive; _bDCustomerWCF.Debit = _bDCustomer.Debit; _bDCustomerWCF.Credit = _bDCustomer.Credit; return _bDCustomerWCF; }
/// <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 BDCustomerCollection</returns> /// /// <remarks> /// /// <RevisionHistory> /// Author Date Description /// DLGenerator 12/27/2014 6:56:00 PM Created function /// /// </RevisionHistory> /// /// </remarks> /// internal static BDCustomerCollection PopulateObjectsFromReaderWithCheckingReader(IDataReader rdr, DatabaseHelper oDatabaseHelper) { BDCustomerCollection list = new BDCustomerCollection(); if (rdr.Read()) { BDCustomer obj = new BDCustomer(); PopulateObjectFromReader(obj, rdr); list.Add(obj); while (rdr.Read()) { obj = new BDCustomer(); PopulateObjectFromReader(obj, rdr); list.Add(obj); } oDatabaseHelper.Dispose(); return(list); } else { oDatabaseHelper.Dispose(); return(null); } }
/// <summary> /// This method will return a list of objects representing all records in the table. /// </summary> /// /// <returns>list of objects of class BDCustomer in the form of object of BDCustomerCollection </returns> public BDCustomerCollection SelectAll() { BDCustomerCollection bDCustomerCollection = new BDCustomerCollection(); foreach (POS.DataLayer.BDCustomer _bDCustomer in POS.DataLayer.BDCustomerBase.SelectAll()) { _bDCustomerWCF = new BDCustomer(); _bDCustomerWCF.CustomerID = _bDCustomer.CustomerID; _bDCustomerWCF.CustomerName = _bDCustomer.CustomerName; _bDCustomerWCF.CustomerCode = _bDCustomer.CustomerCode; _bDCustomerWCF.Address = _bDCustomer.Address; _bDCustomerWCF.Phone1 = _bDCustomer.Phone1; _bDCustomerWCF.Phone2 = _bDCustomer.Phone2; _bDCustomerWCF.Mobile1 = _bDCustomer.Mobile1; _bDCustomerWCF.Mobile2 = _bDCustomer.Mobile2; _bDCustomerWCF.Email = _bDCustomer.Email; _bDCustomerWCF.IsActive = _bDCustomer.IsActive; _bDCustomerWCF.Debit = _bDCustomer.Debit; _bDCustomerWCF.Credit = _bDCustomer.Credit; bDCustomerCollection.Add(_bDCustomerWCF); } return bDCustomerCollection; }
///<summary> /// This method will update one new row into the database using the property Information /// </summary> /// /// <param name="bDCustomer" type="BDCustomer">This BDCustomer will be updated in the database.</param> /// /// <returns>True if succeeded</returns> public bool Update(BDCustomer bDCustomer) { _bDCustomer=POS.DataLayer.BDCustomer.SelectOne(new POS.DataLayer.BDCustomerPrimaryKey(bDCustomer.CustomerID)); _bDCustomer.CustomerName=bDCustomer.CustomerName; _bDCustomer.CustomerCode=bDCustomer.CustomerCode; _bDCustomer.Address=bDCustomer.Address; _bDCustomer.Phone1=bDCustomer.Phone1; _bDCustomer.Phone2=bDCustomer.Phone2; _bDCustomer.Mobile1=bDCustomer.Mobile1; _bDCustomer.Mobile2=bDCustomer.Mobile2; _bDCustomer.Email=bDCustomer.Email; _bDCustomer.IsActive=bDCustomer.IsActive; _bDCustomer.Debit=bDCustomer.Debit; _bDCustomer.Credit=bDCustomer.Credit; return _bDCustomer.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 BDCustomer</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 BDCustomer in the form of an object of class BDCustomerCollection</returns> public BDCustomerCollection SelectByFieldPaged(string field, object fieldValue, object fieldValue2, TypeOperation typeOperation, int pageSize, int skipPages, string orderByStatement) { BDCustomerCollection bDCustomerCollection = new BDCustomerCollection(); foreach (POS.DataLayer.BDCustomer _bDCustomer in POS.DataLayer.BDCustomerBase.SelectByFieldPaged(field, fieldValue, fieldValue2, typeOperation, pageSize, skipPages, orderByStatement)) { _bDCustomerWCF = new BDCustomer(); _bDCustomerWCF.CustomerID = _bDCustomer.CustomerID; _bDCustomerWCF.CustomerName = _bDCustomer.CustomerName; _bDCustomerWCF.CustomerCode = _bDCustomer.CustomerCode; _bDCustomerWCF.Address = _bDCustomer.Address; _bDCustomerWCF.Phone1 = _bDCustomer.Phone1; _bDCustomerWCF.Phone2 = _bDCustomer.Phone2; _bDCustomerWCF.Mobile1 = _bDCustomer.Mobile1; _bDCustomerWCF.Mobile2 = _bDCustomer.Mobile2; _bDCustomerWCF.Email = _bDCustomer.Email; _bDCustomerWCF.IsActive = _bDCustomer.IsActive; _bDCustomerWCF.Debit = _bDCustomer.Debit; _bDCustomerWCF.Credit = _bDCustomer.Credit; bDCustomerCollection.Add(_bDCustomerWCF); } return bDCustomerCollection; }
/// <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 BDCustomer in the form of an object of class BDCustomerCollection </returns> public BDCustomerCollection SelectAllPaged(int? pageSize, int? skipPages, string orderByStatement) { BDCustomerCollection bDCustomerCollection = new BDCustomerCollection(); foreach (POS.DataLayer.BDCustomer _bDCustomer in POS.DataLayer.BDCustomerBase.SelectAllPaged(pageSize, skipPages, orderByStatement)) { _bDCustomerWCF = new BDCustomer(); _bDCustomerWCF.CustomerID = _bDCustomer.CustomerID; _bDCustomerWCF.CustomerName = _bDCustomer.CustomerName; _bDCustomerWCF.CustomerCode = _bDCustomer.CustomerCode; _bDCustomerWCF.Address = _bDCustomer.Address; _bDCustomerWCF.Phone1 = _bDCustomer.Phone1; _bDCustomerWCF.Phone2 = _bDCustomer.Phone2; _bDCustomerWCF.Mobile1 = _bDCustomer.Mobile1; _bDCustomerWCF.Mobile2 = _bDCustomer.Mobile2; _bDCustomerWCF.Email = _bDCustomer.Email; _bDCustomerWCF.IsActive = _bDCustomer.IsActive; _bDCustomerWCF.Debit = _bDCustomer.Debit; _bDCustomerWCF.Credit = _bDCustomer.Credit; bDCustomerCollection.Add(_bDCustomerWCF); } return bDCustomerCollection; }
/// <summary> /// This method will insert one new row into the database using the property Information /// </summary> /// /// <param name="bDCustomer" type="BDCustomer">This BDCustomer will be inserted in the database.</param> /// /// <returns>True if succeeded</returns> public bool Insert(BDCustomer bDCustomer) { _bDCustomer = new POS.DataLayer.BDCustomer(); _bDCustomer.CustomerID=bDCustomer.CustomerID; _bDCustomer.CustomerName=bDCustomer.CustomerName; _bDCustomer.CustomerCode=bDCustomer.CustomerCode; _bDCustomer.Address=bDCustomer.Address; _bDCustomer.Phone1=bDCustomer.Phone1; _bDCustomer.Phone2=bDCustomer.Phone2; _bDCustomer.Mobile1=bDCustomer.Mobile1; _bDCustomer.Mobile2=bDCustomer.Mobile2; _bDCustomer.Email=bDCustomer.Email; _bDCustomer.IsActive=bDCustomer.IsActive; _bDCustomer.Debit=bDCustomer.Debit; _bDCustomer.Credit=bDCustomer.Credit; return _bDCustomer.Insert(); }
/// <summary> /// This method will return an object representing the record matching the primary key information specified. /// </summary> /// /// <param name="pk" type="BDCustomerPrimaryKey">Primary Key information based on which data is to be fetched.</param> /// /// <returns>object of class BDCustomer</returns> /// /// <remarks> /// /// <RevisionHistory> /// Author Date Description /// DLGenerator 3/7/2015 2:37:01 PM Created function /// /// </RevisionHistory> /// /// </remarks> /// public static BDCustomer SelectOne(BDCustomerPrimaryKey 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_BDCustomer_SelectbyPrimaryKey", ref ExecutionState); if (dr.Read()) { BDCustomer obj=new BDCustomer(); PopulateObjectFromReader(obj,dr); dr.Close(); oDatabaseHelper.Dispose(); return obj; } else { dr.Close(); 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 BDCustomerCollection</returns> /// /// <remarks> /// /// <RevisionHistory> /// Author Date Description /// DLGenerator 3/7/2015 2:37:01 PM Created function /// /// </RevisionHistory> /// /// </remarks> /// internal static BDCustomerCollection PopulateObjectsFromReaderWithCheckingReader(IDataReader rdr, DatabaseHelper oDatabaseHelper) { BDCustomerCollection list = new BDCustomerCollection(); if (rdr.Read()) { BDCustomer obj = new BDCustomer(); PopulateObjectFromReader(obj, rdr); list.Add(obj); while (rdr.Read()) { obj = new BDCustomer(); 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 BDCustomerCollection</returns> /// /// <remarks> /// /// <RevisionHistory> /// Author Date Description /// DLGenerator 3/7/2015 2:37:01 PM Created function /// /// </RevisionHistory> /// /// </remarks> /// internal static BDCustomerCollection PopulateObjectsFromReader(IDataReader rdr) { BDCustomerCollection list = new BDCustomerCollection(); while (rdr.Read()) { BDCustomer obj = new BDCustomer(); PopulateObjectFromReader(obj,rdr); list.Add(obj); } return list; }