Skip to content

Commit

Permalink
Remove code that runs login screen
Browse files Browse the repository at this point in the history
  • Loading branch information
M-Zuber committed Dec 27, 2015
1 parent 3319bc5 commit 4bdde2b
Showing 1 changed file with 30 additions and 26 deletions.
56 changes: 30 additions & 26 deletions MyHome.UI/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,36 +17,40 @@ static void Main()
Application.SetCompatibleTextRenderingDefault(false);
Globals.LogFiles["ProgramActivityLog"].AddMessage("The program was started at: " + DateTime.Now);

Application.Run(new MenuMDIUI());

// With the current configuration there is no login needed.
// The code is left as it may change soon, and while we do have source control it will be easier to simply uncomment this
// If the settings for connecting to the database are not set yet
if (!Globals.SettingFiles["DatabaseSettings"].AreSettingsSet(
new List<string>() { "Database Name", "User Id", "Password" }))
{
// Intializes and runs an instance of the login form
Login connecting = new Login();
Application.Run(connecting);
//if (!Globals.SettingFiles["DatabaseSettings"].AreSettingsSet(
// new List<string>() { "Database Name", "User Id", "Password" }))
//{
// // Intializes and runs an instance of the login form
// Login connecting = new Login();
// Application.Run(connecting);

// If the user enters correct connection parameters
if (connecting.ConnectionSuccess)
{
// Runs the main application
Application.Run(new MenuMDIUI());
}
}
// If the database settings where previously set
else
{
// Getse all the settings
Dictionary<string, string> allSettings =
Globals.SettingFiles["DatabaseSettings"].GetAllSettings();
// // If the user enters correct connection parameters
// if (connecting.ConnectionSuccess)
// {
// // Runs the main application
// Application.Run(new MenuMDIUI());
// }
//}
//// If the database settings where previously set
//else
//{
// // Getse all the settings
// Dictionary<string, string> allSettings =
// Globals.SettingFiles["DatabaseSettings"].GetAllSettings();

// Sets the local variables with the parameters saved in the database
Globals.DataBaseName = allSettings["Database Name"];
Globals.UserId = allSettings["User Id"];
Globals.Password = allSettings["Password"];
// // Sets the local variables with the parameters saved in the database
// Globals.DataBaseName = allSettings["Database Name"];
// Globals.UserId = allSettings["User Id"];
// Globals.Password = allSettings["Password"];

// Runs the main application
Application.Run(new MenuMDIUI());
}
// // Runs the main application
// Application.Run(new MenuMDIUI());
//}

Globals.LogFiles["ProgramActivityLog"].AddMessage("The program was closed at: " + DateTime.Now);
}
Expand Down

0 comments on commit 4bdde2b

Please sign in to comment.