private void ශරණලයසතවToolStripMenuItem_Click(object sender, EventArgs e) { gradeList gl = gradeList.getInstance(); gl.MdiParent = this; gl.Show(); gl.WindowState = FormWindowState.Maximized; gl.FormBorderStyle = FormBorderStyle.FixedSingle; }
public static gradeList getInstance() { if (inst3 == null || inst3.IsDisposed) { inst3 = new gradeList(); return(inst3); } else { return(inst3); } }
private void button1_Click(object sender, EventArgs e) { this.Close(); MySqlCommand cmd1 = new MySqlCommand(); cmd1.CommandText = "DELETE FROM `gradetable` WHERE grade= '" + loaded_grade.ToString() + "';"; MySqlCommand cmd2 = new MySqlCommand(); cmd2.CommandText = "INSERT INTO `gradetable`( `grade`, `maximumAge`, `Birthday_After`) VALUES ('" + textBox1.Text + "','" + numericUpDown1.Value.ToString() + "','" + calculateBirthDay(Convert.ToInt32(numericUpDown1.Value.ToString())) + "');"; cmd1.Connection = SqlCon.con; cmd2.Connection = SqlCon.con; SqlCon.con.Open(); cmd1.ExecuteNonQuery(); cmd2.ExecuteNonQuery(); SqlCon.con.Close(); gradeList gl = gradeList.getInstance(); gl.updateDatagridview(); }
private void edit_grades_FormClosed(object sender, FormClosedEventArgs e) { gradeList gl = gradeList.getInstance(); gl.Enabled = true; }