Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*.exe
*.pdb
*.cache
*.swp
*.vshost.exe
*.suo
28 changes: 19 additions & 9 deletions MainSchema.mdj
Original file line number Diff line number Diff line change
Expand Up @@ -4070,7 +4070,7 @@
"containerExtending": false,
"left": 829,
"top": 311,
"width": 69.34814453125,
"width": 71,
"height": 13,
"autoResize": false,
"underline": false,
Expand Down Expand Up @@ -4139,7 +4139,7 @@
"containerExtending": false,
"left": 824,
"top": 304,
"width": 79.34814453125,
"width": 81,
"height": 25,
"autoResize": false,
"stereotypeLabel": {
Expand Down Expand Up @@ -4185,7 +4185,7 @@
"containerExtending": false,
"left": 829,
"top": 334,
"width": 69.34814453125,
"width": 71,
"height": 13,
"autoResize": false,
"underline": false,
Expand Down Expand Up @@ -4213,11 +4213,11 @@
"containerExtending": false,
"left": 829,
"top": 349,
"width": 69.34814453125,
"width": 71,
"height": 13,
"autoResize": false,
"underline": false,
"text": "+name",
"text": "+description",
"horizontalAlignment": 0,
"verticalAlignment": 5
}
Expand All @@ -4233,7 +4233,7 @@
"containerExtending": false,
"left": 824,
"top": 329,
"width": 79.34814453125,
"width": 81,
"height": 38,
"autoResize": false
},
Expand All @@ -4257,7 +4257,7 @@
"containerExtending": false,
"left": 824,
"top": 367,
"width": 79.34814453125,
"width": 81,
"height": 10,
"autoResize": false
},
Expand Down Expand Up @@ -4321,7 +4321,7 @@
"containerExtending": false,
"left": 824,
"top": 304,
"width": 79.34814453125,
"width": 81,
"height": 73,
"autoResize": false,
"stereotypeDisplay": "label",
Expand Down Expand Up @@ -6473,7 +6473,7 @@
"_parent": {
"$ref": "AAAAAAFP9P0CzpmTDQo="
},
"name": "name",
"name": "description",
"visibility": "public",
"isStatic": false,
"isLeaf": false,
Expand Down Expand Up @@ -6803,6 +6803,16 @@
"isFinalSpecialization": false,
"isLeaf": false,
"isActive": false
},
{
"_type": "UMLUseCaseDiagram",
"_id": "AAAAAAFQLlqR9jj00I8=",
"_parent": {
"$ref": "AAAAAAFF+qBWK6M3Z8Y="
},
"name": "UseCaseDiagram1",
"visible": true,
"defaultDiagram": false
}
],
"visibility": "public"
Expand Down
23 changes: 0 additions & 23 deletions Ultimate Management Tool/Ultimate Management Tool/Activity.cs

This file was deleted.

51 changes: 29 additions & 22 deletions Ultimate Management Tool/Ultimate Management Tool/App.config
Original file line number Diff line number Diff line change
@@ -1,23 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<connectionStrings>
<add name="UMTEntities" connectionString="metadata=res://*/UMTModel.csdl|res://*/UMTModel.ssdl|res://*/UMTModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=(LocalDB)\v11.0;attachdbfilename=|DataDirectory|\Database1.mdf;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
</connectionStrings>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="mssqllocaldb" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<connectionStrings>
<add name="UMTEntities" connectionString="metadata=res://*/UMTModel.csdl|res://*/UMTModel.ssdl|res://*/UMTModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=(LocalDB)\v11.0;attachdbfilename=|DataDirectory|\Database1.mdf;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
</connectionStrings>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="mssqllocaldb" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
<provider invariantName="System.Data.SQLite.EF6" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" />
</providers>
</entityFramework>
<system.data>
<DbProviderFactories>
<remove invariant="System.Data.SQLite.EF6" />
<add name="SQLite Data Provider (Entity Framework 6)" invariant="System.Data.SQLite.EF6" description=".NET Framework Data Provider for SQLite (Entity Framework 6)" type="System.Data.SQLite.EF6.SQLiteProviderFactory, System.Data.SQLite.EF6" />
<remove invariant="System.Data.SQLite" /><add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".NET Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" /></DbProviderFactories>
</system.data>
</configuration>
85 changes: 85 additions & 0 deletions Ultimate Management Tool/Ultimate Management Tool/CDbManager.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.SQLite;

namespace DBManager
{
/// <summary>
/// This is a database interface class.
/// It handles necessary db operations.
/// </summary>
class CDbManager
{
public CDbManager()
{
dbConnection = null;
}

~CDbManager()
{
dbConnection.Close();
}

public void ExecuteQuery( String query )
{
if( null == dbConnection )
{
CreateConnection();
}
SQLiteCommand command = new SQLiteCommand( query, dbConnection );
}

public void CreateNewDbFile( String dbFilePath )
{
SetDbFilePath( dbFilePath );
CreateSqlFile();
CreateConnection();
}

private void CreateSqlFile()
{
SQLiteConnection.CreateFile( this.dbPath );
}

public void CreateConnection( String dbFilePath = "", Boolean isFileSystem = true)
{
SetDbFilePath( dbFilePath );
if( isFileSystem )
{
CreateConnection2File();
}
else
{
CreateConnection2Server();
}
}

private void CreateConnection2File()
{
if( null == dbConnection )
{
dbConnection = new SQLiteConnection( "Data Source=" + dbPath + " ;Version=3;" );
dbConnection.Open();
}
}

private void CreateConnection2Server()
{

}

private void SetDbFilePath(String dbFilePath)
{
if( "" != dbFilePath )
{
dbPath = dbFilePath;
}
}

private String dbPath;
private SQLiteConnection dbConnection;
}
}
Binary file not shown.
Binary file not shown.
39 changes: 39 additions & 0 deletions Ultimate Management Tool/Ultimate Management Tool/DbBuilder.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DbBuilder
{
class CDbBuilder
{
static public void CreateEmptyDb( DBManager.CDbManager dbManager, string dbPath = "mainDataBase.db" )
{
CreateFile( dbManager, dbPath );
CreateConnection( dbManager );
CreateTables( dbManager );
}

static private void CreateFile( DBManager.CDbManager dbManager, string dbPath )
{
dbManager.CreateNewDbFile( dbPath );
}

static private void CreateConnection( DBManager.CDbManager dbManager)
{
dbManager.CreateConnection();
}

static private void CreateTables( DBManager.CDbManager dbManager )
{
dbManager.ExecuteQuery(
"CREATE TABLE UserACtivities " +
"(" +
"id INTEGER NOT NULL AUTO_INCREMENT " +
"userId INTEGER NOT NULL" +
")"
);
}
}
}
32 changes: 32 additions & 0 deletions Ultimate Management Tool/Ultimate Management Tool/DialogWrapper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace DialogWrapper
{
class CDialogWrapper
{
static String CreateFile( String extension )
{
System.IO.Stream myStream;
SaveFileDialog newDbDialog = new SaveFileDialog();

newDbDialog.Filter = "db files (*.db)|*.db|All files (*.*)|*.*";
newDbDialog.FilterIndex = 2;
newDbDialog.RestoreDirectory = true;

if( newDbDialog.ShowDialog() == DialogResult.OK )
{
if( ( myStream = newDbDialog.OpenFile() ) != null )
{
myStream.Close();
return newDbDialog.FileName;
}
}
return "";
}
}
}
Loading