public static bool InsertGroupRoles(ADGroupRoleCollection aDGroupRoleCollection, int groupID) { DatabaseHelper oDatabaseHelper = new DatabaseHelper(); bool ExecutionState = false; oDatabaseHelper.BeginTransaction(); if (Deletelines(oDatabaseHelper, groupID)) { foreach (ADGroupRole groupRole in aDGroupRoleCollection) { if (!InsertDetails(oDatabaseHelper, groupRole)) { ExecutionState = false; break; } else ExecutionState = true; } if (ExecutionState) oDatabaseHelper.CommitTransaction(); else oDatabaseHelper.RollbackTransaction(); } else ExecutionState = false; oDatabaseHelper.Dispose(); return ExecutionState; }
private void GetGroupRoles(int groupID) { ADGroupRoleCollection _aDGroupRoleCollection = _aDGroupRoleWrapper.SelectByGroupID(groupID); foreach (ADGroupRole _aDGroupRole in _aDGroupRoleCollection) { for (int i = 0; i < dgrid_Roles.Rows.Count; i++) { CheckBox check = new CheckBox(); dgrid_Roles.Rows[i].Cells["Check"].Value = true; dgrid_Roles.RefreshEdit(); } //foreach (DataGridViewRow row in dgrid_Roles.Rows) //{ // if (Convert.ToInt32(row.Cells["RoleID"].Value) == _aDGroupRole.RoleID) // { // //(DataGridViewCheckBoxCell)row.Cells["Check"].EditedFormattedValue = true; // //(DataGridViewCheckBoxCell)row.Cells["Check"].EditingCellFormattedValue = true; // //ck.EditingCellFormattedValue = true; // //row.Cells["Check"].Selected = false; // //chk.TrueValue = true; // //chk.Value = 1; // } //} } }
private void GetGroupRoles(int groupID) { try { ADGroupRoleCollection _aDGroupRoleCollection = _aDGroupRoleWrapper.SelectByGroupID(groupID); if (_aDGroupRoleCollection.Count == 0) { return; } foreach (ADGroupRole _aDGroupRole in _aDGroupRoleCollection) { foreach (DataGridViewRow row in dgrid_Roles.Rows) { if (Convert.ToInt32(row.Cells["RoleID"].Value) == _aDGroupRole.RoleID) { row.Cells["Check"].Value = true; } } } } catch (Exception ex) { MessageBox.Show("حدث خطأ برجاء تكرار العمليه مره اخرى واذا تكرر الخطا برجاءالاتصال بالشخص المصمم للبرنامج وارسال رسالة الخطا التى ستظهر بعد قليل له"); MessageBox.Show(ex.Message); } }
public frmGroupPriviliges(int groupID) { InitializeComponent(); _aDRoleWrapper = new ADRoleWrapper(); _aDGroupRoleWrapper = new ADGroupRoleWrapper(); lbl_FormHeader.Text = "صلاحيات مجموعة المستخدمين"; _groupID = groupID; _aDGroupRoleCollection = new ADGroupRoleCollection(); }
public bool InsertGroupRoles(ADGroupRoleCollection aDGroupRoleCollection, int groupID) { POS.DataLayer.ADGroupRoleCollection _aDGroupRoleCollection = new DataLayer.ADGroupRoleCollection(); POS.DataLayer.ADGroupRole _aDGroupRole; foreach (ADGroupRole groupRole in aDGroupRoleCollection) { _aDGroupRole = new DataLayer.ADGroupRole(); _aDGroupRole.GroupID = groupRole.GroupID; _aDGroupRole.RoleID = groupRole.RoleID; _aDGroupRoleCollection.Add(_aDGroupRole); } return POS.DataLayer.ADGroupRole.InsertGroupRoles(_aDGroupRoleCollection, groupID); }
public bool InsertGroupRoles(ADGroupRoleCollection aDGroupRoleCollection, int groupID) { POS.DataLayer.ADGroupRoleCollection _aDGroupRoleCollection = new DataLayer.ADGroupRoleCollection(); POS.DataLayer.ADGroupRole _aDGroupRole; foreach (ADGroupRole groupRole in aDGroupRoleCollection) { _aDGroupRole = new DataLayer.ADGroupRole(); _aDGroupRole.GroupID = groupRole.GroupID; _aDGroupRole.RoleID = groupRole.RoleID; _aDGroupRoleCollection.Add(_aDGroupRole); } return(POS.DataLayer.ADGroupRole.InsertGroupRoles(_aDGroupRoleCollection, groupID)); }
/// <summary> /// This method will return a list of objects representing all records in the table. /// </summary> /// /// <returns>list of objects of class ADGroupRole in the form of object of ADGroupRoleCollection </returns> public ADGroupRoleCollection SelectAll() { ADGroupRoleCollection aDGroupRoleCollection = new ADGroupRoleCollection(); foreach (POS.DataLayer.ADGroupRole _aDGroupRole in POS.DataLayer.ADGroupRoleBase.SelectAll()) { _aDGroupRoleWCF = new ADGroupRole(); _aDGroupRoleWCF.GroupRoleID = _aDGroupRole.GroupRoleID; _aDGroupRoleWCF.GroupID = _aDGroupRole.GroupID; _aDGroupRoleWCF.RoleID = _aDGroupRole.RoleID; aDGroupRoleCollection.Add(_aDGroupRoleWCF); } return aDGroupRoleCollection; }
/// <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 ADGroupRole</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 ADGroupRole in the form of an object of class ADGroupRoleCollection</returns> public ADGroupRoleCollection SelectByFieldPaged(string field, object fieldValue, object fieldValue2, TypeOperation typeOperation, int pageSize, int skipPages, string orderByStatement) { ADGroupRoleCollection aDGroupRoleCollection = new ADGroupRoleCollection(); foreach (POS.DataLayer.ADGroupRole _aDGroupRole in POS.DataLayer.ADGroupRoleBase.SelectByFieldPaged(field, fieldValue, fieldValue2, typeOperation, pageSize, skipPages, orderByStatement)) { _aDGroupRoleWCF = new ADGroupRole(); _aDGroupRoleWCF.GroupRoleID = _aDGroupRole.GroupRoleID; _aDGroupRoleWCF.GroupID = _aDGroupRole.GroupID; _aDGroupRoleWCF.RoleID = _aDGroupRole.RoleID; aDGroupRoleCollection.Add(_aDGroupRoleWCF); } return(aDGroupRoleCollection); }
/// <summary> /// This method will return a list of objects representing all records in the table. /// </summary> /// /// <returns>list of objects of class ADGroupRole in the form of object of ADGroupRoleCollection </returns> public ADGroupRoleCollection SelectAll() { ADGroupRoleCollection aDGroupRoleCollection = new ADGroupRoleCollection(); foreach (POS.DataLayer.ADGroupRole _aDGroupRole in POS.DataLayer.ADGroupRoleBase.SelectAll()) { _aDGroupRoleWCF = new ADGroupRole(); _aDGroupRoleWCF.GroupRoleID = _aDGroupRole.GroupRoleID; _aDGroupRoleWCF.GroupID = _aDGroupRole.GroupID; _aDGroupRoleWCF.RoleID = _aDGroupRole.RoleID; aDGroupRoleCollection.Add(_aDGroupRoleWCF); } return(aDGroupRoleCollection); }
/// <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 ADGroupRole in the form of an object of class ADGroupRoleCollection </returns> public ADGroupRoleCollection SelectAllPaged(int?pageSize, int?skipPages, string orderByStatement) { ADGroupRoleCollection aDGroupRoleCollection = new ADGroupRoleCollection(); foreach (POS.DataLayer.ADGroupRole _aDGroupRole in POS.DataLayer.ADGroupRoleBase.SelectAllPaged(pageSize, skipPages, orderByStatement)) { _aDGroupRoleWCF = new ADGroupRole(); _aDGroupRoleWCF.GroupRoleID = _aDGroupRole.GroupRoleID; _aDGroupRoleWCF.GroupID = _aDGroupRole.GroupID; _aDGroupRoleWCF.RoleID = _aDGroupRole.RoleID; aDGroupRoleCollection.Add(_aDGroupRoleWCF); } return(aDGroupRoleCollection); }
/// <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 ADGroupRole</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 ADGroupRole in the form of an object of class ADGroupRoleCollection</returns> public ADGroupRoleCollection SelectByField(string field, object fieldValue, object fieldValue2, TypeOperation typeOperation) { ADGroupRoleCollection aDGroupRoleCollection = new ADGroupRoleCollection(); foreach (POS.DataLayer.ADGroupRole _aDGroupRole in POS.DataLayer.ADGroupRoleBase.SelectByField(field, fieldValue, fieldValue2, typeOperation)) { _aDGroupRoleWCF = new ADGroupRole(); _aDGroupRoleWCF.GroupRoleID = _aDGroupRole.GroupRoleID; _aDGroupRoleWCF.GroupID = _aDGroupRole.GroupID; _aDGroupRoleWCF.RoleID = _aDGroupRole.RoleID; aDGroupRoleCollection.Add(_aDGroupRoleWCF); } return(aDGroupRoleCollection); }
private void GetGroupRoles(int groupID) { try { ADGroupRoleCollection _aDGroupRoleCollection = _aDGroupRoleWrapper.SelectByGroupID(groupID); foreach (ADGroupRole _aDGroupRole in _aDGroupRoleCollection) { foreach (DataGridViewRow row in dgrid_Roles.Rows) { if (Convert.ToInt32(row.Cells["RoleID"].Value) == _aDGroupRole.RoleID) { row.Cells["Check"].Value = true; } } } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
/// <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 ADGroupRole</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 ADGroupRole in the form of an object of class ADGroupRoleCollection</returns> public ADGroupRoleCollection SelectByFieldPaged(string field, object fieldValue, object fieldValue2, TypeOperation typeOperation, int pageSize, int skipPages, string orderByStatement) { ADGroupRoleCollection aDGroupRoleCollection = new ADGroupRoleCollection(); foreach (POS.DataLayer.ADGroupRole _aDGroupRole in POS.DataLayer.ADGroupRoleBase.SelectByFieldPaged(field, fieldValue, fieldValue2, typeOperation, pageSize, skipPages, orderByStatement)) { _aDGroupRoleWCF = new ADGroupRole(); _aDGroupRoleWCF.GroupRoleID = _aDGroupRole.GroupRoleID; _aDGroupRoleWCF.GroupID = _aDGroupRole.GroupID; _aDGroupRoleWCF.RoleID = _aDGroupRole.RoleID; aDGroupRoleCollection.Add(_aDGroupRoleWCF); } return aDGroupRoleCollection; }
/// <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 ADGroupRole in the form of an object of class ADGroupRoleCollection </returns> public ADGroupRoleCollection SelectAllPaged(int? pageSize, int? skipPages, string orderByStatement) { ADGroupRoleCollection aDGroupRoleCollection = new ADGroupRoleCollection(); foreach (POS.DataLayer.ADGroupRole _aDGroupRole in POS.DataLayer.ADGroupRoleBase.SelectAllPaged(pageSize, skipPages, orderByStatement)) { _aDGroupRoleWCF = new ADGroupRole(); _aDGroupRoleWCF.GroupRoleID = _aDGroupRole.GroupRoleID; _aDGroupRoleWCF.GroupID = _aDGroupRole.GroupID; _aDGroupRoleWCF.RoleID = _aDGroupRole.RoleID; aDGroupRoleCollection.Add(_aDGroupRoleWCF); } return aDGroupRoleCollection; }
/// <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 ADGroupRole</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 ADGroupRole in the form of an object of class ADGroupRoleCollection</returns> public ADGroupRoleCollection SelectByField(string field, object fieldValue, object fieldValue2, TypeOperation typeOperation) { ADGroupRoleCollection aDGroupRoleCollection = new ADGroupRoleCollection(); foreach (POS.DataLayer.ADGroupRole _aDGroupRole in POS.DataLayer.ADGroupRoleBase.SelectByField(field, fieldValue, fieldValue2, typeOperation)) { _aDGroupRoleWCF = new ADGroupRole(); _aDGroupRoleWCF.GroupRoleID = _aDGroupRole.GroupRoleID; _aDGroupRoleWCF.GroupID = _aDGroupRole.GroupID; _aDGroupRoleWCF.RoleID = _aDGroupRole.RoleID; aDGroupRoleCollection.Add(_aDGroupRoleWCF); } return aDGroupRoleCollection; }
public bool UpdateGroupWithRoles(ADGroup aDGroup, ADGroupRoleCollection aDGroupRoleCollection) { // Insert(aDGroup) return(true); }
/// <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 ADGroupRoleCollection</returns> /// /// <remarks> /// /// <RevisionHistory> /// Author Date Description /// DLGenerator 3/7/2015 2:36:59 PM Created function /// /// </RevisionHistory> /// /// </remarks> /// internal static ADGroupRoleCollection PopulateObjectsFromReader(IDataReader rdr) { ADGroupRoleCollection list = new ADGroupRoleCollection(); while (rdr.Read()) { ADGroupRole obj = new ADGroupRole(); PopulateObjectFromReader(obj, rdr); list.Add(obj); } return list; }
/// <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 ADGroupRoleCollection</returns> /// /// <remarks> /// /// <RevisionHistory> /// Author Date Description /// DLGenerator 3/7/2015 2:36:59 PM Created function /// /// </RevisionHistory> /// /// </remarks> /// internal static ADGroupRoleCollection PopulateObjectsFromReaderWithCheckingReader(IDataReader rdr, DatabaseHelper oDatabaseHelper) { ADGroupRoleCollection list = new ADGroupRoleCollection(); if (rdr.Read()) { ADGroupRole obj = new ADGroupRole(); PopulateObjectFromReader(obj, rdr); list.Add(obj); while (rdr.Read()) { obj = new ADGroupRole(); PopulateObjectFromReader(obj, rdr); list.Add(obj); } oDatabaseHelper.Dispose(); return list; } else { oDatabaseHelper.Dispose(); return null; } }
public bool UpdateGroupWithRoles(ADGroup aDGroup, ADGroupRoleCollection aDGroupRoleCollection) { // Insert(aDGroup) return true; }