TheRealMoonman
I eat babies
- Sep 30, 2014
- 360
- 74
Revolution HouseKeeping
NOTE: I'm pretty busy, so this project will take some time, even though it is a pretty simple project.
The program basically connects to your MySQL database at runtime, obtaining your table data, then you basically login in the application using your normal login details, then the main page will pop up, displaying all the features.
Features.
- Sexy af Metro Framework UI
- ConnectionStrings Stored within the app.config, which protects the open source data connection data from skid reverse engineering if you choose to close the source.
- MySQL Server compatible
- Will be compatible for both hotel and RP
You must be registered for see links
lmfaoALSO no code snippets because I've only designed the login gui, i will update those into it soon though.
Update:
1. Started Install Project, (THIS will be closed source, because wtf are you going to do with it? reverse it if your desperate lol)
The concept of it is to have it get MySQL/SQL Data > Place into Config files. Only reason I'm making the install project is to make the application more user friendly, and im reconsidering encrypting the connection strings
Snippet of install
Code:
public void MySQLGetDB(string Host, int Port, string User, string Pass)
{
try
{
string ConnectionStr = "SERVER="+Host+";Port="+Port+";UID="+User+";PASSWORD="+Pass+";";
MySqlConnection connect = new MySqlConnection(ConnectionStr);
MySqlCommand cmd = connect.CreateCommand();
cmd.CommandText = "SHOW DATABASES;";
MySqlDataReader Reader;
connect.Open();
Reader = cmd.ExecuteReader();
while (Reader.Read())
{
string row = "";
for (int i = 0; i < Reader.FieldCount; i++)
{
row += Reader.GetValue(i).ToString();
MySQLDBSelect.Items.Add(row);
}
}
connect.Close();
}
catch(MySqlException ex)
{
MetroMessageBox.Show(this, "Error obtaining DB's" + ex.ToString(), "ALERT");
}
}
Update:
Installer complete, kinda changed it around a little, it spawns a app.config, that is in another format, which is easily changed to the correct by renaming, you enter your information etc. then you copy the spawned config file into your Revolution files, and rename it, replacing the original app.config.
Vid
Snippets of Main.cs (Setup.exe)
Code:
private void MySQLDBFetch_Click(object sender, EventArgs e)
{
int Port;
Port = Convert.ToInt32(MySQLPortInput.Text);
MySQLGetDB(MySQLHostInput.Text, Port, MySQLUserInput.Text, MySQLPassInput.Text);
}
private void MySQLTest_Click(object sender, EventArgs e)
{
int Port;
Port = Convert.ToInt32(MySQLPortInput.Text);
TestConnection(DBEngineSelect.SelectedIndex, MySQLHostInput.Text, Port, MySQLUserInput.Text, MySQLPassInput.Text, MySQLDBSelect.SelectedItem.ToString());
}
private void MySQLFinish_Click(object sender, EventArgs e)
{
int Port;
Port = Convert.ToInt32(MySQLPortInput.Text);
FinalizeSetup.Finish(DBEngineSelect.SelectedIndex, MySQLHostInput.Text, Port, MySQLUserInput.Text, MySQLPassInput.Text, MySQLDBSelect.SelectedItem.ToString());
if (FinalizeSetup.Created == true)
{
MetroMessageBox.Show(this, "Configuration Complete, Place the app.revoconfig in your RevolutionHK folders where app.config is located and rename the new config file to app.config");
Application.Exit();
}
else if (FinalizeSetup.Created == false)
{
MetroMessageBox.Show(this, "Error creating configuration file, please consult traeretros about this if you've attempted multiple times.");
}
}
Snippets of Finalize.cs (Setup.exe)
Code:
public bool Created = false;
public void Finish(int DBengine, string Host, int Port, string User, string Pass, string DB)
{
if (DBengine == 0)
{
try
{
System.Text.StringBuilder sb = new StringBuilder();
sb.AppendLine("<?xml version=\"1.0\" encoding=\"utf-8\" ?>");
sb.AppendLine("<configuration>");
sb.AppendLine("<connectionStrings>");
sb.AppendLine("<add name=\"dbconfig\" connectionString=\"SERVER=" + Host + ";PORT=" + Port + ";UID=" + User + ";Pass=" + Pass + ";Database=" + DB + ";\"/>");
sb.AppendLine("</connectionStrings>");
sb.AppendLine("<startup>");
sb.AppendLine("<supportedRuntime version=\"v4.0\" sku=\".NETFramework,Version=v4.5\" />");
sb.AppendLine("</startup>");
sb.AppendLine("<applicationSettings>");
sb.AppendLine("<RevolutionHK.Properties.Settings>");
sb.AppendLine("<setting name=\"IsInstalled\" serializeAs=\"String\">");
sb.AppendLine("<value>True</value>");
sb.AppendLine("</setting>");
sb.AppendLine("</RevolutionHK.Properties.Settings>");
sb.AppendLine("</applicationSettings>");
sb.AppendLine("</configuration>");
string loc = Assembly.GetEntryAssembly().Location;
File.WriteAllText(String.Concat(loc, ".revoconfig"), sb.ToString());
Created = true;
}
catch (Exception)
{
}
}
else if (DBengine == 1)
{
}
}
DBengine == 1 will be the SQL Server compatibility, but the initial release of this will not come with SQL server compatible.
Edit: Lol you can hear those cancerous beats i was listening to while making dis
Update: Added new option to the install, you get to choose which table to use for your HK login
Last edited: