private DataSetETRoles RetrieveETRolesByWildParameter(DataSetETRoles ETRoles, string roleName, string desc) { if (ETRoles.ETTable.Count == 0) return ETRoles; foreach (DataSetETRoles.ETTableRow row in ETRoles.ETTable.Select(string.Empty, "RoleName")) { if (!this.IsMatchRoleName(roleName, row.RoleName)) { row.Delete(); } else if (!this.IsMatchDescription(desc, row.Description)) row.Delete(); } if (ETRoles.HasChanges()) ETRoles.ETTable.AcceptChanges(); return ETRoles; }
public void SetDataToGrid(ETType type, UltraGrid leftGrid, DataSetETRoles rightETRoles, string name, string desc) { try { DataSetETRoles allETRoles = new DataSetETRoles(); if (type == ETType.Workflow) { allETRoles = this.RetrieveWorkflowGroup(name, desc); } else if (type == ETType.DMS) { allETRoles = this.RetrieveDMSRoles(name, desc); } else if (type == ETType.GIS) { allETRoles = this.RetrieveGISRoles(name, desc); } if (rightETRoles.ETTable.Count > 0) { foreach (DataSetETRoles.ETTableRow row in rightETRoles.ETTable) { string filter = string.Format("RoleName = '{0}'", (row.IsRoleNameNull())?"":row.RoleName.Replace("'","''")); DataRow[] rows = allETRoles.ETTable.Select(filter, "RoleName"); if (rows.Length > 0) rows[0].Delete(); } if (allETRoles.HasChanges()) allETRoles.ETTable.AcceptChanges(); } this.BindGird(leftGrid, GetResortETRoles(allETRoles)); } catch (Exception ex) { if (ExceptionManager.Handle(ex)) throw; } }