public DataSetETRoles LoadDMSRoles(string userName) { string ETRolesForuser ; DataSetETRoles ETRoles = new DataSetETRoles(); DataSetETRoles.ETTableRow newRow ; //DataTable ETRolesForuser = new DataTable(); //ETRolesForuser = _presenter.LoadDMSRoles(username, et_type, true); if (_ETHelper == null) _ETHelper = new IntegratedETHelper(userName, WorkItem); ETRolesForuser = _ETHelper.FindTrimUser(userName); if (!string.IsNullOrEmpty(ETRolesForuser)) { newRow = ETRoles.ETTable.NewETTableRow(); newRow.BeginEdit(); newRow.RoleName = ETRolesForuser; newRow.Description = ETRolesForuser; newRow.UserName = userName; newRow.RoleType = ETRolesForuser; newRow.EndEdit(); ETRoles.ETTable.AddETTableRow(newRow); } return ETRoles; }
public IntegratedETHelper(string userName, WorkItem workItem) { _ETRemovedData = new DataSetETRoles(); _DMSService = workItem.RootWorkItem.Services.Get<IDMSService>(); this._userName = userName; // this.MockETDatas(); _ETRolesData = new DataSetETRoles(); // _ETRolesData = this.ETData(_userName); //this._ETRolesData.ReadXml("ETDataTest.xml"); }
public void AssignETRoles(UltraGrid leftGrid, DataSetETRoles currentETRoles) { DataSetETRoles leftRoles = leftGrid.DataSource as DataSetETRoles; if (leftRoles == null) return; DataSetETRoles.ETTableRow[] dataRows = GetTickedDataRows(leftGrid, leftRoles); if (dataRows == null) return; this.MoveRowAndCreateNew(dataRows, currentETRoles); leftRoles.AcceptChanges(); }
private DataSetETRoles.ETTableRow[] GetTickedDataRows(UltraGrid currentGrid, DataSetETRoles currentRoles) { if (currentRoles == null) return null; string expression = string.Empty; this.GetTickedRoleNames(currentGrid, out expression); if (string.IsNullOrEmpty(expression)) return null; return (currentRoles.ETTable.Select(expression) as DataSetETRoles.ETTableRow[]); }
private DataSetETRoles GetResortETRoles(DataSetETRoles currentETRoles) { DataSetETRoles.ETTableRow[] sortRows = currentETRoles.ETTable.Select(string.Empty, "RoleName") as DataSetETRoles.ETTableRow[]; DataSetETRoles returnData = new DataSetETRoles(); if (sortRows == null) return returnData; if (sortRows.Length == 0) return returnData; returnData.ETTable.BeginLoadData(); returnData.Merge(sortRows); returnData.ETTable.EndLoadData(); return returnData; }
public void UnAssignETRoles(UltraGrid leftGrid, UltraGrid rightGrid) { DataSetETRoles currentRoles = rightGrid.DataSource as DataSetETRoles; _ETRemovedData = new DataSetETRoles(); if (currentRoles == null) return; DataSetETRoles.ETTableRow newRow ; DataSetETRoles leftETRoles = leftGrid.DataSource as DataSetETRoles; DataSetETRoles.ETTableRow[] dataRows = GetTickedDataRows(rightGrid, currentRoles); if (leftETRoles == null) leftETRoles = new DataSetETRoles(); { if (dataRows == null)return; for (int i = 0; i < dataRows.Length; i++) { //_ETRemovedData.ETTable.Rows.Add(dataRows); newRow = _ETRemovedData.ETTable.NewETTableRow(); newRow.BeginEdit(); newRow.RoleName = dataRows[i][_ETRemovedData.ETTable.RoleNameColumn.ColumnName].ToString(); newRow.RoleType = dataRows[i][_ETRemovedData.ETTable.RoleTypeColumn.ColumnName].ToString(); newRow.Description = dataRows[i][_ETRemovedData.ETTable.DescriptionColumn.ColumnName].ToString(); newRow.UserName = dataRows[i][_ETRemovedData.ETTable.UserNameColumn.ColumnName].ToString(); newRow.EndEdit(); _ETRemovedData.ETTable.AddETTableRow(newRow); } } this.MoveRowAndCreateNew(dataRows, leftETRoles); leftETRoles.AcceptChanges(); this.BindGird(leftGrid, GetResortETRoles(leftETRoles)); }
private void LoadWFGroups() { if (_ETHelper == null) _ETHelper = new IntegratedETHelper(_presenter.Key, WorkItem); _WFAssignRoles = new DataSetETRoles(); _WFAssignedRoles = new DataSetETRoles(); switch (_presenter.CurrentViewStatus) { case HiiP.Framework.Security.UserManagement.Interface.Constants.ViewStatus.Add: try { // ultraOptionQueueType.Visible = this._ETHelper.IsCurrentUserSupervisoryMember(_presenter.Key.ToString()); this._WFAssignRoles = this._ETHelper.GetAllWFGroups(); } catch (Exception ex) { ExceptionManager.HandleWithLogOnly(ex); } break; case HiiP.Framework.Security.UserManagement.Interface.Constants.ViewStatus.Update: this._WFAssignRoles = this._ETHelper.GetAllWFGroups(); try { // ultraOptionQueueType.Visible = this._ETHelper.IsCurrentUserSupervisoryMember(_presenter.Key.ToString()); this._WFAssignedRoles = this._ETHelper.GetWFRolesForUser(_presenter.Key); this._WFAssignedRoles.Merge(this._ETHelper.GetParticipationForUser(_presenter.Key).ETTable); this.ultraOptionUserType.CheckedIndex = _ETHelper.GetWFUser(_presenter.Key).RoleName.Equals(HiiP.Foundation.Workflow.Interface.Constants.IprocessServer.WorkflowRole.ADMIN) ? 1 : 0; } catch (Exception ex) { ExceptionManager.HandleWithLogOnly(ex); } break; case HiiP.Framework.Security.UserManagement.Interface.Constants.ViewStatus.CopyNewUser: this._WFAssignRoles = this._ETHelper.GetAllWFGroups(); try { // ultraOptionQueueType.Visible = this._ETHelper.IsCurrentUserSupervisoryMember(_presenter.Data.ToString()); this._WFAssignedRoles = this._ETHelper.GetWFRolesForUser(_presenter.Data.ToString()); this._WFAssignedRoles.Merge(this._ETHelper.GetParticipationForUser(_presenter.Data.ToString()).ETTable); this.ultraOptionUserType.CheckedIndex = _ETHelper.GetWFUser(_presenter.Data.ToString()).RoleName.Equals(HiiP.Foundation.Workflow.Interface.Constants.IprocessServer.WorkflowRole.ADMIN) ? 1 : 0; } catch (Exception ex) { ExceptionManager.HandleWithLogOnly(ex); } break; } this._ETHelper.BindGird(this.ultraGridWFAssigned, this._WFAssignedRoles); this._ETHelper.BindGird(this.ultraGridWFAllGroups, _WFAssignRoles); OldParticipations = this.GetParticipation(); }
private void LoadUserDMSRoles() { if (_ETHelper == null) _ETHelper = new IntegratedETHelper(_presenter.Key, WorkItem); _DMSAssignedRoles = new DataSetETRoles(); _DMSAssignRoles = new DataSetETRoles(); switch (_presenter.CurrentViewStatus) { case HiiP.Framework.Security.UserManagement.Interface.Constants.ViewStatus.Add: this._DMSAssignRoles = _ETHelper.DMSRoles(); cb_dmsprofiles.DataSource = _DMSAssignRoles.ETTable; cb_dmsprofiles.DataBind(); //this._DMSAssignRoles = this._ETHelper.RetrieveDMSRolesByUserName(); break; case HiiP.Framework.Security.UserManagement.Interface.Constants.ViewStatus.Update: this._DMSAssignedRoles = this.LoadDMSRoles(_presenter.Key); this._DMSAssignRoles = _ETHelper.DMSRoles(); cb_dmsprofiles.DataSource = _DMSAssignRoles.ETTable; cb_dmsprofiles.DataBind(); cb_dmsprofiles.Value = _DMSAssignedRoles.ETTable.Rows.Count > 0 ? _DMSAssignedRoles.ETTable.Rows[0][_DMSAssignedRoles.ETTable.RoleNameColumn.ColumnName].ToString() : ""; this.SetDirtyStatus(false); break; case HiiP.Framework.Security.UserManagement.Interface.Constants.ViewStatus.CopyNewUser: this._DMSAssignRoles = _ETHelper.DMSRoles(); this._DMSAssignedRoles = this.LoadDMSRoles(_presenter.Data.ToString()); cb_dmsprofiles.DataSource = _DMSAssignRoles.ETTable; cb_dmsprofiles.DataBind(); cb_dmsprofiles.Value = _DMSAssignedRoles.ETTable.Rows.Count >0? _DMSAssignedRoles.ETTable.Rows[0][_DMSAssignedRoles.ETTable.RoleNameColumn.ColumnName].ToString():""; break; } //this._ETHelper.BindGird(this.ultraGridDMSAssigned, this._DMSAssignedRoles); //this._ETHelper.BindGird(this.ultraGridDMSAllRoles, _DMSAssignRoles); }
public DataSetETRoles GetWFRolesForUser(string userName) { DataSetETRoles WFGroups = new DataSetETRoles(); DataSetETRoles.ETTableRow WFRow = WFGroups.ETTable.NewETTableRow(); this.UserName = userName; try { try { using (UserMaintenanceServiceProxy proxy = new UserMaintenanceServiceProxy()) { GroupQueueDataSet.WF_GroupQueueDataTable GQDS = new GroupQueueDataSet.WF_GroupQueueDataTable(); GQDS = proxy.RetrieveGroupsByUser(userName).WF_GroupQueue; for (int i = 0; i < GQDS.Rows.Count; i++) { WFRow = WFGroups.ETTable.NewETTableRow(); WFRow.BeginEdit(); WFRow[WFGroups.ETTable.RoleNameColumn.ColumnName] = GQDS.Rows[i][GQDS.GroupNameColumn.ColumnName].ToString(); WFRow[WFGroups.ETTable.DescriptionColumn.ColumnName] = GQDS.Rows[i][GQDS.GroupDescColumn.ColumnName].ToString(); WFRow[WFGroups.ETTable.UserNameColumn.ColumnName] = userName; WFRow[WFGroups.ETTable.RoleTypeColumn.ColumnName] = "G";//--- To Dertermine that this is a user WFRow[WFGroups.ETTable.IsSupervisorColumn.ColumnName] = IsGroupSupervisor(GQDS.Rows[i][GQDS.QueueSupervisorNameColumn.ColumnName].ToString()); WFRow.EndEdit(); WFGroups.ETTable.AddETTableRow(WFRow); } } } catch (Exception ex) { ExceptionManager.HandleWithLogOnly(ex); } return WFGroups; } finally { WFGroups = null; } }
public DataSetETRoles GetUsersGISRoles(string UserName) { DataSetETRoles _ETRoles = new DataSetETRoles(); DataSetETRoles.ETTableRow GISRow = _ETRoles.ETTable.NewETTableRow(); List<ETRoleEntity> GISRoles; using (UserMaintenanceServiceProxy proxy = new UserMaintenanceServiceProxy()) { GISRoles = new List<ETRoleEntity>(); GISRoles = proxy.GetGISRolesForUser(UserName); for (int i = 0; i < GISRoles.Count; i++) { GISRow = _ETRoles.ETTable.NewETTableRow(); GISRow.BeginEdit(); // GISRow[_ETRoles.ETTable.RoleIDColumn.ColumnName] = GISRoles[i].RoleName; GISRow[_ETRoles.ETTable.RoleNameColumn.ColumnName] = GISRoles[i].RoleName; GISRow[_ETRoles.ETTable.DescriptionColumn.ColumnName] = GISRoles[i].RoleName; GISRow[_ETRoles.ETTable.UserNameColumn.ColumnName] = GISRoles[i].UserId; GISRow[_ETRoles.ETTable.RoleTypeColumn.ColumnName] = Framework.Security.UserManagement.Interface.Constants.EnablingTechnologies.GIS.ToString(); GISRow.EndEdit(); _ETRoles.ETTable.AddETTableRow(GISRow); } } return _ETRoles; }
public DataSetETRoles GetParticipationForUser(string userName) { DataSetETRoles WFGroups = new DataSetETRoles(); DataSetETRoles.ETTableRow WFRow = WFGroups.ETTable.NewETTableRow(); try { List<UserEntity> Participents = new List<UserEntity>(); using (UserMaintenanceServiceProxy proxy = new UserMaintenanceServiceProxy()) { Participents = proxy.GetParticipation(userName); for (int i = 0; i < Participents.Count; i++) { WFRow = WFGroups.ETTable.NewETTableRow(); WFRow.BeginEdit(); WFRow[WFGroups.ETTable.RoleNameColumn.ColumnName] = Participents[i].UserName.ToString(); WFRow[WFGroups.ETTable.DescriptionColumn.ColumnName] = Participents[i].Description.ToString(); WFRow[WFGroups.ETTable.UserNameColumn.ColumnName] = userName; WFRow[WFGroups.ETTable.RoleTypeColumn.ColumnName] = "U";//--- To Dertermine that this is a user WFRow[WFGroups.ETTable.IsSupervisorColumn.ColumnName] = IsGroupSupervisor(Participents[i].SupervisorID); WFRow.EndEdit(); WFGroups.ETTable.AddETTableRow(WFRow); } } } catch (Exception ex) { ExceptionManager.HandleWithLogOnly(ex); } return WFGroups; }
public DataSetETRoles GetAllWFGroups() { ETRoles = new DataSetETRoles(); using (UserMaintenanceServiceProxy proxy = new UserMaintenanceServiceProxy()) { ETRoles = proxy.RetrieveAllWFGroups(); } return ETRoles; }
public DataSetETRoles GetAllGISRoles() { ETRoles = new DataSetETRoles(); DataSetETRoles.ETTableRow GISRow = ETRoles.ETTable.NewETTableRow(); string[]GISRoles; using (UserMaintenanceServiceProxy proxy = new UserMaintenanceServiceProxy()) { GISRoles = proxy.GetAllGISRoles(); for (int i = 0; i < GISRoles.Length; i++) { GISRow = ETRoles.ETTable.NewETTableRow(); GISRow.BeginEdit(); // GISRow[ETRoles.ETTable.RoleIDColumn.ColumnName] = GISRoles[i].ToString(); GISRow[ETRoles.ETTable.RoleNameColumn.ColumnName] = GISRoles[i].ToString(); GISRow[ETRoles.ETTable.DescriptionColumn.ColumnName] = GISRoles[i].ToString(); GISRow[ETRoles.ETTable.UserNameColumn.ColumnName] = _userName; GISRow[ETRoles.ETTable.RoleTypeColumn.ColumnName] = Framework.Security.UserManagement.Interface.Constants.EnablingTechnologies.GIS.ToString(); GISRow.EndEdit(); ETRoles.ETTable.AddETTableRow(GISRow); } } return ETRoles; }
public DataSetETRoles DMSRoles() { ETRoles = new DataSetETRoles(); DataSetETRoles.ETTableRow newRow = ETRoles.ETTable.NewETTableRow(); string ProfileName = string.Empty; char[] splitter = { '\n' }; try { if (_DMSService == null) { //when no DMS authorization, means DMS service not loaded. return ETRoles; } string[] DMSRoles = _DMSService.GetAllProfiles().Split(splitter); if (DMSRoles==null || DMSRoles.Length==0) { return ETRoles; } for (int i = 0; i < DMSRoles.Length; i++) { if (!string.IsNullOrEmpty(DMSRoles[i].ToString())) { ProfileName = DMSRoles[i].ToString().Replace("\r", "").Trim(); //ProfileName = ProfileName.Substring(2, ProfileName.Length - 2).Trim(); newRow = ETRoles.ETTable.NewETTableRow(); newRow.BeginEdit(); newRow.RoleName = ProfileName; newRow.RoleType = ETType.DMS.ToString(); newRow.Description = ProfileName; newRow.UserName = UserName; newRow.EndEdit(); ETRoles.ETTable.AddETTableRow(newRow); } } } catch (Exception ex) { if (DMSExceptionManager.Handle(ex) == ConnectTrimResult.NoTrimUser) { Utility.ShowMessageBox(Messages.DMS.DME002); //MessageBox.Show("You are not DMS user, please contact your System Administrator", "Error"); } else if (DMSExceptionManager.Handle(ex) == ConnectTrimResult.ConfigurationIncorrect) { Utility.ShowMessageBox(Messages.DMS.DME003); //MessageBox.Show("DMS trim configuration is incorrect, please contact your System Administrator", "Error"); } else { if (ExceptionManager.Handle(ex)) throw ; } } return ETRoles; }
private void MoveRowAndCreateNew(DataSetETRoles.ETTableRow[] dataRows, DataSetETRoles currentETRoles) { foreach (DataSetETRoles.ETTableRow row in dataRows) { DataSetETRoles.ETTableRow newRow = currentETRoles.ETTable.NewETTableRow(); newRow.ItemArray = row.ItemArray; currentETRoles.ETTable.AddETTableRow(newRow); row.Delete(); } }
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 DataSetETRoles GetWFUserQueues() { DataRow drRemove; ETRoles = new DataSetETRoles(); using (UserMaintenanceServiceProxy proxy = new UserMaintenanceServiceProxy()) { ETRoles = proxy.RetrieveAllWFUsers(); } ETRoles.ETTable.PrimaryKey = new DataColumn[] { ETRoles.ETTable.RoleNameColumn }; drRemove = ETRoles.ETTable.Rows.Find(this.UserName); if (drRemove != null) ETRoles.ETTable.Rows.Remove(drRemove); return ETRoles; }
public void BindGird(UltraGrid grid, DataSetETRoles allETRoles) { grid.DataSource = allETRoles; grid.DataMember = allETRoles.Tables[0].TableName; }
public void ResetGrid(UltraGrid leftGrid, UltraTextEditor nameEdit, UltraTextEditor desEdit) { DataSetETRoles ETRoles = new DataSetETRoles(); leftGrid.DataSource = ETRoles; leftGrid.DataMember = ETRoles.Tables[0].TableName; nameEdit.Text = string.Empty; desEdit.Text = string.Empty; }
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; } }
private void LoadGISRoles() { if (_ETHelper == null) _ETHelper = new IntegratedETHelper(_presenter.Key, WorkItem); _GISAssignRoles = new DataSetETRoles(); _GISAssignedRoles = new DataSetETRoles(); switch (_presenter.CurrentViewStatus) { case HiiP.Framework.Security.UserManagement.Interface.Constants.ViewStatus.Add: this._ETHelper.BindGird(this.ultraGridGISAssignedRoles, this._GISAssignedRoles); this._ETHelper.BindGird(this.ultraGridGISAllRoles, _GISAssignRoles); Search(); break; case HiiP.Framework.Security.UserManagement.Interface.Constants.ViewStatus.Update: SelectedUser = _presenter.Key; _GISAssignedRoles = _ETHelper.GetUsersGISRoles(_presenter.Key); GISRolesAssigned = AssignedGISRoles(); this._ETHelper.BindGird(this.ultraGridGISAssignedRoles, this._GISAssignedRoles); this._ETHelper.BindGird(this.ultraGridGISAllRoles, _GISAssignRoles); Search(); break; case HiiP.Framework.Security.UserManagement.Interface.Constants.ViewStatus.CopyNewUser: _GISAssignedRoles = _ETHelper.GetUsersGISRoles(_presenter.Data.ToString()); GISRolesAssigned = AssignedGISRoles(); this._ETHelper.BindGird(this.ultraGridGISAssignedRoles, this._GISAssignedRoles); this._ETHelper.BindGird(this.ultraGridGISAllRoles, _GISAssignRoles); this.Search(); break; } }