Skip to content

Commit 529bd0d

Browse files
committed
Massive Bulk upload for all issues being worked.
1 parent f35f7e7 commit 529bd0d

27 files changed

Lines changed: 58693 additions & 7001 deletions

DB/osae.sql

Lines changed: 50914 additions & 1277 deletions
Large diffs are not rendered by default.

OSAE.API/General/Common.cs

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,33 @@ public static string MatchPattern(string str, string sUser)
262262
}
263263
}
264264
}
265+
string replacementString = "";
266+
//Here We have found our Object, so we need to look for an appropriate Object Type afterwards
267+
//So we are going to retrieve a object type list and compare it to the remainder of the string
268+
DataSet dsObjectTypes = OSAESql.RunSQL("SELECT object_type FROM osae_v_object_type WHERE base_type NOT IN ('CONTROL','SCREEN') ORDER BY object_type");
269+
foreach (DataRow drObjectTypes in dsObjectTypes.Tables[0].Rows)
270+
{
271+
//Here we need to break the string into words to avoid partial matches
272+
273+
string[] wordArray = str.Split(new Char[] { ' ' });
274+
foreach (string w in wordArray)
275+
{
276+
if (replacementString.Length > 1)
277+
{
278+
replacementString = replacementString + " ";
279+
}
280+
if (drObjectTypes["object_type"].ToString().ToUpper() == w)
281+
{
282+
replacementString = replacementString + "[OBJECT TYPE]";
283+
//str = str.Replace(drState["state_label"].ToString().ToUpper(), "[STATE]");
284+
ScriptParameter += "," + drObjectTypes["object_type"].ToString();
285+
}
286+
else
287+
{
288+
replacementString = replacementString + w;
289+
}
290+
}
291+
}
265292

266293
//Here We have found our Object, so we need to look for an appropriate state afterwards
267294
//So we are going to retrieve a state list and compare it to the remainder of the string
@@ -270,7 +297,6 @@ public static string MatchPattern(string str, string sUser)
270297
foreach (DataRow drState in dsStates.Tables[0].Rows)
271298
{
272299
//Here we need to break the string into words to avoid partial matches
273-
string replacementString = "";
274300
string[] wordArray = str.Split(new Char[] { ' ' });
275301
foreach (string w in wordArray)
276302
{
@@ -289,7 +315,7 @@ public static string MatchPattern(string str, string sUser)
289315
replacementString = replacementString + w;
290316
}
291317
}
292-
//Now that we have replaced the Object and State, Lets check for a match again
318+
//Now that we have replaced the Object,Object Type, and State, Lets check for a match again
293319
//DataSet dataset = new DataSet();
294320
//command.CommandText = "SELECT pattern FROM osae_v_pattern WHERE `match`=@Name";
295321
//command.Parameters.AddWithValue("@Name", str);
@@ -320,8 +346,6 @@ public static string MatchPattern(string str, string sUser)
320346

321347
}
322348

323-
324-
325349
/// <summary>
326350
/// Get all object names that start with a single word
327351
/// </summary>
@@ -344,8 +368,6 @@ public static DataSet ObjectNamesStartingWith(string pattern)
344368
}
345369
}
346370

347-
348-
349371
public static void InitialiseLogFolder()
350372
{
351373
try

OSAE.API/General/OSAESql.cs

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,54 @@
1-
namespace OSAE
2-
{
3-
using System.Data;
4-
using MySql.Data.MySqlClient;
5-
6-
public class OSAESql
7-
{
8-
/// <summary>
9-
/// Runs the passed in SQL query on the database and returns a dataset of the results
10-
/// </summary>
11-
/// <param name="SQL">The SQL command to be run against the DB</param>
12-
/// <returns>The Dataset returned from the DB</returns>
13-
public static DataSet RunQuery(MySqlCommand command)
14-
{
15-
DataSet dataset = new DataSet();
16-
using (MySqlConnection connection = new MySqlConnection(Common.ConnectionString))
17-
{
18-
connection.Open();
19-
20-
MySqlDataAdapter adapter = new MySqlDataAdapter(command);
21-
command.Connection = connection;
22-
adapter.Fill(dataset);
23-
}
24-
25-
26-
return dataset;
27-
}
28-
29-
/// <summary>
30-
/// Runs the passed in SQL query on the database and returns a dataset of the results
31-
/// </summary>
32-
/// <param name="SQL">The sql query to be run against the database</param>
33-
/// <returns>The dataset returned from the DB</returns>
34-
public static DataSet RunSQL(string sql)
35-
{
36-
DataSet dataset = new DataSet();
37-
38-
using (MySqlConnection connection = new MySqlConnection(Common.ConnectionString))
39-
{
40-
connection.Open();
41-
42-
MySqlCommand command = new MySqlCommand(sql);
43-
MySqlDataAdapter adapter;
44-
45-
command.Connection = connection;
46-
adapter = new MySqlDataAdapter(command);
47-
adapter.Fill(dataset);
48-
49-
}
50-
51-
return dataset;
52-
}
53-
}
54-
}
1+
namespace OSAE
2+
{
3+
using System.Data;
4+
using MySql.Data.MySqlClient;
5+
6+
public class OSAESql
7+
{
8+
/// <summary>
9+
/// Runs the passed in SQL query on the database and returns a dataset of the results
10+
/// </summary>
11+
/// <param name="SQL">The SQL command to be run against the DB</param>
12+
/// <returns>The Dataset returned from the DB</returns>
13+
public static DataSet RunQuery(MySqlCommand command)
14+
{
15+
DataSet dataset = new DataSet();
16+
using (MySqlConnection connection = new MySqlConnection(Common.ConnectionString))
17+
{
18+
connection.Open();
19+
20+
MySqlDataAdapter adapter = new MySqlDataAdapter(command);
21+
command.Connection = connection;
22+
adapter.Fill(dataset);
23+
}
24+
25+
26+
return dataset;
27+
}
28+
29+
/// <summary>
30+
/// Runs the passed in SQL query on the database and returns a dataset of the results
31+
/// </summary>
32+
/// <param name="SQL">The sql query to be run against the database</param>
33+
/// <returns>The dataset returned from the DB</returns>
34+
public static DataSet RunSQL(string sql)
35+
{
36+
DataSet dataset = new DataSet();
37+
38+
using (MySqlConnection connection = new MySqlConnection(Common.ConnectionString))
39+
{
40+
connection.Open();
41+
42+
MySqlCommand command = new MySqlCommand(sql);
43+
MySqlDataAdapter adapter;
44+
45+
command.Connection = connection;
46+
adapter = new MySqlDataAdapter(command);
47+
adapter.Fill(dataset);
48+
49+
}
50+
51+
return dataset;
52+
}
53+
}
54+
}

OSAE.API/OSAE.API.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
<Reference Include="System.ServiceModel" />
6363
<Reference Include="System.ServiceModel.Web" />
6464
<Reference Include="System.ServiceProcess" />
65+
<Reference Include="System.Speech" />
6566
<Reference Include="System.Windows.Forms" />
6667
<Reference Include="System.Xaml" />
6768
<Reference Include="System.Xml" />
@@ -74,6 +75,7 @@
7475
<Compile Include="General\DBConnectionStatus.cs" />
7576
<Compile Include="General\OSAELog.cs" />
7677
<Compile Include="General\OSAESql.cs" />
78+
<Compile Include="OSAEGrammar\OSAEGrammar.cs" />
7779
<Compile Include="OSAEImage\OSAEImageManager.cs" />
7880
<Compile Include="OSAEImage\OSAEImage.cs" />
7981
<Compile Include="General\Logging.cs">
@@ -126,6 +128,7 @@
126128
<DependentUpon>OSAEServiceController.cs</DependentUpon>
127129
</EmbeddedResource>
128130
</ItemGroup>
131+
<ItemGroup />
129132
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
130133
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
131134
Other similar extension points exist, see Microsoft.Common.targets.

0 commit comments

Comments
 (0)