private void createAccountToolStripMenuItem_Click(object sender, EventArgs e) { Users fm = new Users(user); fm.Show(); }
private void glassButton3_Click(object sender, EventArgs e) { if (MessageBox.Show("Are you sure you want to delete this employee?", "Employee Info", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { { { string query33; StreamReader sr33 = new StreamReader(Application.StartupPath.ToString() + "//data.txt"); line = sr33.ReadLine(); StreamReader sr34 = new StreamReader(Application.StartupPath.ToString() + "//dataP.txt"); dbP = sr34.ReadLine(); StreamReader sr35 = new StreamReader(Application.StartupPath.ToString() + "//dataU.txt"); dbU = sr35.ReadLine(); string sConnection33 = "SERVER=" + line + ";" + "DATABASE=lamolinventory;" + "UID=" + dbU + ";" + "PASSWORD='******';"; MySqlConnection sqlConnection33 = new MySqlConnection(sConnection33); query33 = "Insert Into security Values('" + System.DateTime.Now.ToString() + "(" + System.DateTime.Now.Millisecond.ToString() + ")_" + name + "','" + "Delete user account: " + comboBox2.Text + "','" + System.DateTime.Now.ToString() + "','" + name + "','"+terms()+"')"; dbQuery(query33); } } { string query; StreamReader sr = new StreamReader(Application.StartupPath.ToString() + "//data.txt"); line = sr.ReadLine(); StreamReader sr3 = new StreamReader(Application.StartupPath.ToString() + "//dataP.txt"); dbP = sr3.ReadLine(); StreamReader sr4 = new StreamReader(Application.StartupPath.ToString() + "//dataU.txt"); dbU = sr4.ReadLine(); string sConnection = "SERVER=" + line + ";" + "DATABASE=lamolinventory;" + "UID=" + dbU + ";" + "PASSWORD='******';"; MySqlConnection sqlConnection = new MySqlConnection(sConnection); query = "Delete From logs Where user_code = '" + comboBox2.Text + "'"; dbQuery(query); MessageBox.Show("Successfully deleted a user", "User Information", MessageBoxButtons.OK, MessageBoxIcon.Information); Users fm = new Users(user); fm.Show(); this.Close(); } } }
private void pictureBox8_Click(object sender, EventArgs e) { Users fm = new Users(user); fm.Show(); }
private void glassButton1_Click(object sender, EventArgs e) { if (MessageBox.Show("Are you sure you want to modify this user information?", "User Info", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { if (edUse.Text.Length < 6) { MessageBox.Show("Username must be atleast 6 characters long.", "User Information", MessageBoxButtons.OK, MessageBoxIcon.Information); } else if (edPass.Text.Length < 6) { MessageBox.Show("Password must be atleast 6 characters long.", "User Information", MessageBoxButtons.OK, MessageBoxIcon.Information); } else if (edname.Text.Length < 5) { MessageBox.Show("Please enter a valid name of the user.", "User Information", MessageBoxButtons.OK, MessageBoxIcon.Information); } else if (edPass.Text != edPasV.Text) { MessageBox.Show("Password verification did not match.\nPlease try again", "User Information", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { { string query33; StreamReader sr33 = new StreamReader(Application.StartupPath.ToString() + "//data.txt"); line = sr33.ReadLine(); StreamReader sr34 = new StreamReader(Application.StartupPath.ToString() + "//dataP.txt"); dbP = sr34.ReadLine(); StreamReader sr35 = new StreamReader(Application.StartupPath.ToString() + "//dataU.txt"); dbU = sr35.ReadLine(); string sConnection33 = "SERVER=" + line + ";" + "DATABASE=lamolinventory;" + "UID=" + dbU + ";" + "PASSWORD='******';"; MySqlConnection sqlConnection33 = new MySqlConnection(sConnection33); query33 = "Insert Into security Values('" + System.DateTime.Now.ToString() + "(" + System.DateTime.Now.Millisecond.ToString() + ")_" + user + "','" +"Modified user account: " + edname.Text.ToUpper() + "','" + System.DateTime.Now.ToString() + "','" + name + "','"+terms()+"')"; dbQuery(query33); } { string query; StreamReader sr = new StreamReader(Application.StartupPath.ToString() + "//data.txt"); line = sr.ReadLine(); StreamReader sr3 = new StreamReader(Application.StartupPath.ToString() + "//dataP.txt"); dbP = sr3.ReadLine(); StreamReader sr4 = new StreamReader(Application.StartupPath.ToString() + "//dataU.txt"); dbU = sr4.ReadLine(); string sConnection = "SERVER=" + line + ";" + "DATABASE=lamolinventory;" + "UID=" + dbU + ";" + "PASSWORD='******';"; MySqlConnection sqlConnection = new MySqlConnection(sConnection); query = "Update logs Set userna = '" + edUse.Text.Trim() + "', passw = '" + edPass.Text.Trim() + "', names = '" + edname.Text.Trim().ToUpper() + "', addr = '" + edadd.Text.Trim().ToUpper() + "', connum = '" + edcON.Text.Trim().ToUpper() + "', eadd = '" + edem.Text.Trim().ToUpper() + "', types = '" + edtype.Text.Trim().ToUpper() + "' Where user_code = '" + comboBox1.Text + "'"; dbQuery(query); MessageBox.Show("Successfully updated a user information", "User Information", MessageBoxButtons.OK, MessageBoxIcon.Information); Users fm = new Users(user); fm.Show(); this.Close(); } } } }