Beispiel #1
0
        private void instructorToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Advisor l = Advisor.getInstance();

            l.Show();
            this.Hide();
        }
Beispiel #2
0
 public static Advisor getInstance()
 {
     if (l == null)
     {
         l = new Advisor();
         l.Show();
         return(l);
     }
     else
     {
         return(l);
     }
 }
Beispiel #3
0
 private void button2_Click(object sender, EventArgs e)
 {
     try
     {
         int           key     = Convert.ToInt32(textBox1.Text);
         String        str     = "Data Source=DESKTOP-TOIHAAB;Initial Catalog=ProjectA;Persist Security Info=True;User ID=sa;Password=java";
         String        query   = "Update Advisor Set Designation = (select Id from Lookup where Lookup.Value ='" + comboBox1.Text + "'),Salary=('" + Convert.ToDecimal(textBox2.Text) + "')where Id = '" + Convert.ToInt32(textBox1.Text) + "';";
         SqlConnection connect = new SqlConnection(str);
         SqlCommand    cmd     = new SqlCommand(query, connect);
         connect.Open();
         cmd.ExecuteNonQuery();
         MessageBox.Show("Data is Updated successfully");
         connect.Close();
         Advisor ad = new Advisor();
         this.Hide();
         ad.Show();
     }
     catch (Exception es)
     {
         MessageBox.Show(es.Message);
     }
 }