private DataTable GetFoundationOwnerListTable(TDBTransaction AReadTransaction, string ATableName) { // Used in Foundation Details screen. SUserTable TmpUserTable = new SUserTable(); TmpUserTable = (SUserTable)AReadTransaction.DataBaseObj.SelectDT(TmpUserTable, "SELECT " + SUserTable.GetPartnerKeyDBName() + ',' + SUserTable.GetUserIdDBName() + ',' + SUserTable.GetFirstNameDBName() + ',' + SUserTable.GetLastNameDBName() + ' ' + "FROM PUB_" + SUserTable.GetTableDBName() + ' ' + "WHERE " + SUserTable.GetPartnerKeyDBName() + " <> 0 " + "AND " + SUserTable.GetUserIdDBName() + " IN (SELECT " + SUserModuleAccessPermissionTable.GetUserIdDBName() + ' ' + "FROM PUB_" + SUserModuleAccessPermissionTable.GetTableDBName() + ' ' + "WHERE " + SUserModuleAccessPermissionTable.GetModuleIdDBName() + " = 'DEVUSER')" + "AND " + SUserTable.GetRetiredDBName() + " = FALSE", AReadTransaction, null, -1, -1); SUserRow EmptyDR = TmpUserTable.NewRowTyped(false); EmptyDR.PartnerKey = 0; EmptyDR.UserId = ""; TmpUserTable.Rows.InsertAt(EmptyDR, 0); return(TmpUserTable); }
private DataTable GetUserListTable(TDBTransaction AReadTransaction, string ATableName) { DataColumn LastAndFirstNameColumn; DataTable TmpTable = SUserAccess.LoadAll(AReadTransaction); // add column to display a combination of last and first name LastAndFirstNameColumn = new DataColumn(); LastAndFirstNameColumn.DataType = System.Type.GetType("System.String"); LastAndFirstNameColumn.ColumnName = MSysManConstants.USER_LAST_AND_FIRST_NAME_COLUMNNAME; LastAndFirstNameColumn.Expression = string.Format("{0} + ' ' + {1}", SUserTable.GetFirstNameDBName(), SUserTable.GetLastNameDBName()); TmpTable.Columns.Add(LastAndFirstNameColumn); return(TmpTable); }