/// <summary> /// This method will insert one new row into the database using the property Information /// </summary> /// /// <param name="aDGroup" type="ADGroup">This ADGroup will be inserted in the database.</param> /// /// <returns>True if succeeded</returns> public bool Insert(ADGroup aDGroup) { _aDGroup = new POS.DataLayer.ADGroup(); _aDGroup.GroupID = aDGroup.GroupID; _aDGroup.GroupName = aDGroup.GroupName; return(_aDGroup.Insert()); }
///<summary> /// This method will update one new row into the database using the property Information /// </summary> /// /// <param name="aDGroup" type="ADGroup">This ADGroup will be updated in the database.</param> /// /// <returns>True if succeeded</returns> public bool Update(ADGroup aDGroup) { _aDGroup = POS.DataLayer.ADGroup.SelectOne(new POS.DataLayer.ADGroupPrimaryKey(aDGroup.GroupID)); _aDGroup.GroupName = aDGroup.GroupName; return(_aDGroup.Update()); }
/// <summary> /// This method will return an object representing the record matching the primary key information specified. /// </summary> /// /// <param name="pk" type="ADGroupPrimaryKey">Primary Key information based on which data is to be fetched.</param> /// /// <returns>object of class ADGroup</returns> public ADGroup SelectOne(ADGroupPrimaryKey pk) { _aDGroupWCF = new ADGroup(); _aDGroup = POS.DataLayer.ADGroupBase.SelectOne(new POS.DataLayer.ADGroupPrimaryKey(pk.GroupID)); _aDGroupWCF.GroupID = _aDGroup.GroupID; _aDGroupWCF.GroupName = _aDGroup.GroupName; return(_aDGroupWCF); }
/// <summary> /// This method will return an object representing the record matching the primary key information specified. /// </summary> /// /// <param name="pk" type="ADGroupPrimaryKey">Primary Key information based on which data is to be fetched.</param> /// /// <returns>object of class ADGroup</returns> public ADGroup SelectOne(ADGroupPrimaryKey pk) { _aDGroupWCF = new ADGroup(); _aDGroup = POS.DataLayer.ADGroupBase.SelectOne(new POS.DataLayer.ADGroupPrimaryKey(pk.GroupID)); _aDGroupWCF.GroupID = _aDGroup.GroupID; _aDGroupWCF.GroupName = _aDGroup.GroupName; return _aDGroupWCF; }
/// <summary> /// This method will return a list of objects representing all records in the table. /// </summary> /// /// <returns>list of objects of class ADGroup in the form of object of ADGroupCollection </returns> public ADGroupCollection SelectAll() { ADGroupCollection aDGroupCollection = new ADGroupCollection(); foreach (POS.DataLayer.ADGroup _aDGroup in POS.DataLayer.ADGroupBase.SelectAll()) { _aDGroupWCF = new ADGroup(); _aDGroupWCF.GroupID = _aDGroup.GroupID; _aDGroupWCF.GroupName = _aDGroup.GroupName; aDGroupCollection.Add(_aDGroupWCF); } return aDGroupCollection; }
/// <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 ADGroupCollection</returns> /// /// <remarks> /// /// <RevisionHistory> /// Author Date Description /// DLGenerator 12/27/2014 6:56:02 PM Created function /// /// </RevisionHistory> /// /// </remarks> /// internal static ADGroupCollection PopulateObjectsFromReaderWithCheckingReader(IDataReader rdr, DatabaseHelper oDatabaseHelper) { ADGroupCollection list = new ADGroupCollection(); if (rdr.Read()) { ADGroup obj = new ADGroup(); PopulateObjectFromReader(obj, rdr); list.Add(obj); while (rdr.Read()) { obj = new ADGroup(); 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 ADGroupCollection</returns> /// /// <remarks> /// /// <RevisionHistory> /// Author Date Description /// DLGenerator 3/7/2015 2:37:00 PM Created function /// /// </RevisionHistory> /// /// </remarks> /// internal static ADGroupCollection PopulateObjectsFromReaderWithCheckingReader(IDataReader rdr, DatabaseHelper oDatabaseHelper) { ADGroupCollection list = new ADGroupCollection(); if (rdr.Read()) { ADGroup obj = new ADGroup(); PopulateObjectFromReader(obj, rdr); list.Add(obj); while (rdr.Read()) { obj = new ADGroup(); 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 ADGroupCollection</returns> /// /// <remarks> /// /// <RevisionHistory> /// Author Date Description /// DLGenerator 3/7/2015 2:37:00 PM Created function /// /// </RevisionHistory> /// /// </remarks> /// internal static ADGroupCollection PopulateObjectsFromReader(IDataReader rdr) { ADGroupCollection list = new ADGroupCollection(); while (rdr.Read()) { ADGroup obj = new ADGroup(); PopulateObjectFromReader(obj,rdr); list.Add(obj); } return list; }
/// <summary> /// This method will return an object representing the record matching the primary key information specified. /// </summary> /// /// <param name="pk" type="ADGroupPrimaryKey">Primary Key information based on which data is to be fetched.</param> /// /// <returns>object of class ADGroup</returns> /// /// <remarks> /// /// <RevisionHistory> /// Author Date Description /// DLGenerator 3/7/2015 2:37:00 PM Created function /// /// </RevisionHistory> /// /// </remarks> /// public static ADGroup SelectOne(ADGroupPrimaryKey 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_ADGroup_SelectbyPrimaryKey", ref ExecutionState); if (dr.Read()) { ADGroup obj=new ADGroup(); 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 /// </summary> /// /// <param name="field" type="string">Field of the class ADGroup</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 ADGroup in the form of an object of class ADGroupCollection</returns> public ADGroupCollection SelectByField(string field, object fieldValue, object fieldValue2, TypeOperation typeOperation) { ADGroupCollection aDGroupCollection = new ADGroupCollection(); foreach (POS.DataLayer.ADGroup _aDGroup in POS.DataLayer.ADGroupBase.SelectByField(field, fieldValue, fieldValue2, typeOperation)) { _aDGroupWCF = new ADGroup(); _aDGroupWCF.GroupID = _aDGroup.GroupID; _aDGroupWCF.GroupName = _aDGroup.GroupName; aDGroupCollection.Add(_aDGroupWCF); } return aDGroupCollection; }
///<summary> /// This method will update one new row into the database using the property Information /// </summary> /// /// <param name="aDGroup" type="ADGroup">This ADGroup will be updated in the database.</param> /// /// <returns>True if succeeded</returns> public bool Update(ADGroup aDGroup) { _aDGroup=POS.DataLayer.ADGroup.SelectOne(new POS.DataLayer.ADGroupPrimaryKey(aDGroup.GroupID)); _aDGroup.GroupName=aDGroup.GroupName; return _aDGroup.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 ADGroup</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 ADGroup in the form of an object of class ADGroupCollection</returns> public ADGroupCollection SelectByFieldPaged(string field, object fieldValue, object fieldValue2, TypeOperation typeOperation, int pageSize, int skipPages, string orderByStatement) { ADGroupCollection aDGroupCollection = new ADGroupCollection(); foreach (POS.DataLayer.ADGroup _aDGroup in POS.DataLayer.ADGroupBase.SelectByFieldPaged(field, fieldValue, fieldValue2, typeOperation, pageSize, skipPages, orderByStatement)) { _aDGroupWCF = new ADGroup(); _aDGroupWCF.GroupID = _aDGroup.GroupID; _aDGroupWCF.GroupName = _aDGroup.GroupName; aDGroupCollection.Add(_aDGroupWCF); } return aDGroupCollection; }
/// <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 ADGroup in the form of an object of class ADGroupCollection </returns> public ADGroupCollection SelectAllPaged(int? pageSize, int? skipPages, string orderByStatement) { ADGroupCollection aDGroupCollection = new ADGroupCollection(); foreach (POS.DataLayer.ADGroup _aDGroup in POS.DataLayer.ADGroupBase.SelectAllPaged(pageSize, skipPages, orderByStatement)) { _aDGroupWCF = new ADGroup(); _aDGroupWCF.GroupID = _aDGroup.GroupID; _aDGroupWCF.GroupName = _aDGroup.GroupName; aDGroupCollection.Add(_aDGroupWCF); } return aDGroupCollection; }
/// <summary> /// This method will insert one new row into the database using the property Information /// </summary> /// /// <param name="aDGroup" type="ADGroup">This ADGroup will be inserted in the database.</param> /// /// <returns>True if succeeded</returns> public bool Insert(ADGroup aDGroup) { _aDGroup = new POS.DataLayer.ADGroup(); _aDGroup.GroupID=aDGroup.GroupID; _aDGroup.GroupName=aDGroup.GroupName; return _aDGroup.Insert(); }