You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
108 lines
3.5 KiB
108 lines
3.5 KiB
using System; |
|
using System.Collections.Generic; |
|
using System.Data; |
|
using System.Data.SqlClient; |
|
using System.Linq; |
|
|
|
namespace iMonitorApp.Classes |
|
{ |
|
// Token: 0x0200002A RID: 42 |
|
public class TOM |
|
{ |
|
// Token: 0x060001B0 RID: 432 RVA: 0x0000D964 File Offset: 0x0000BB64 |
|
public static string GetUsersPerTheme(string themes) |
|
{ |
|
List<string> list = (from t in themes.Split(new char[] |
|
{ |
|
',' |
|
}).ToList<string>() |
|
select t.Trim()).ToList<string>(); |
|
string selectCommandText = "SELECT * from tblTeamOrganization2"; |
|
SqlConnection sqlConnection = new SqlConnection("server=10.153.64.3\\;Initial Catalog=infrastructure;User ID=dbuser;Password=dbuser;"); |
|
sqlConnection.Open(); |
|
DataTable dataTable = new DataTable(); |
|
SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(selectCommandText, sqlConnection); |
|
sqlDataAdapter.Fill(dataTable); |
|
sqlConnection.Close(); |
|
List<string> list2 = new List<string>(); |
|
foreach (string text in list) |
|
{ |
|
bool flag = !dataTable.Columns.Contains(text); |
|
if (flag) |
|
{ |
|
return ""; |
|
} |
|
foreach (object obj in dataTable.Rows) |
|
{ |
|
DataRow dataRow = (DataRow)obj; |
|
bool flag2 = dataRow[text] != null && dataRow[text].ToString() != ""; |
|
if (flag2) |
|
{ |
|
list2.Add(dataRow["user"].ToString() + "@4ecap.com"); |
|
} |
|
} |
|
} |
|
return string.Join(",", list2.Distinct<string>().ToList<string>()); |
|
} |
|
|
|
// Token: 0x060001B1 RID: 433 RVA: 0x0000DB10 File Offset: 0x0000BD10 |
|
public static List<string> GetUsersPerThemeList(string themes) |
|
{ |
|
List<string> list = (from t in themes.Split(new char[] |
|
{ |
|
',' |
|
}).ToList<string>() |
|
select t.Trim()).ToList<string>(); |
|
string selectCommandText = "SELECT * from tblTeamOrganization2"; |
|
SqlConnection sqlConnection = new SqlConnection("server=10.153.64.3\\;Initial Catalog=infrastructure;User ID=dbuser;Password=dbuser;"); |
|
sqlConnection.Open(); |
|
DataTable dataTable = new DataTable(); |
|
SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(selectCommandText, sqlConnection); |
|
sqlDataAdapter.Fill(dataTable); |
|
sqlConnection.Close(); |
|
List<string> list2 = new List<string>(); |
|
foreach (string text in list) |
|
{ |
|
bool flag = !dataTable.Columns.Contains(text); |
|
if (flag) |
|
{ |
|
return new List<string>(); |
|
} |
|
foreach (object obj in dataTable.Rows) |
|
{ |
|
DataRow dataRow = (DataRow)obj; |
|
bool flag2 = dataRow[text] != null && dataRow[text].ToString() != ""; |
|
if (flag2) |
|
{ |
|
list2.Add(dataRow["user"].ToString() + "@4ecap.com"); |
|
} |
|
} |
|
} |
|
return list2.Distinct<string>().ToList<string>(); |
|
} |
|
|
|
// Token: 0x060001B2 RID: 434 RVA: 0x0000DCB4 File Offset: 0x0000BEB4 |
|
public static string GetPhoneNumbersPerTheme(string themes) |
|
{ |
|
List<string> usersPerThemeList = TOM.GetUsersPerThemeList(themes); |
|
string selectCommandText = "SELECT * from tblContactDetails"; |
|
SqlConnection sqlConnection = new SqlConnection("server=10.153.64.3\\;Initial Catalog=infrastructure;User ID=dbuser;Password=dbuser;"); |
|
sqlConnection.Open(); |
|
DataTable dataTable = new DataTable(); |
|
SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(selectCommandText, sqlConnection); |
|
sqlDataAdapter.Fill(dataTable); |
|
sqlConnection.Close(); |
|
List<string> list = new List<string>(); |
|
foreach (object obj in dataTable.Rows) |
|
{ |
|
DataRow dataRow = (DataRow)obj; |
|
bool flag = usersPerThemeList.Contains(dataRow["username"].ToString() + "@4ecap.com"); |
|
if (flag) |
|
{ |
|
list.Add(dataRow["phonenumber"].ToString()); |
|
} |
|
} |
|
return string.Join(",", list.Distinct<string>().ToList<string>()); |
|
} |
|
} |
|
}
|
|
|