private void advisorToolStripMenuItem1_Click(object sender, EventArgs e) { Advisor a = new Advisor(); a.Show(); this.Hide(); }
private void addAdvisorToolStripMenuItem_Click(object sender, EventArgs e) { Advisor l = Advisor.getInstance(); l.Show(); this.Hide(); }
private void linkLabel3_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { Advisor ad = new Advisor(); this.Hide(); ad.Show(); }
private void cmd_advisor_Click(object sender, EventArgs e) { Advisor o = new Advisor(); o.Show(); this.Hide(); }
private void button3_Click(object sender, EventArgs e) { Advisor ad = new Advisor(); this.Hide(); ad.Show(); }
private void button2_Click(object sender, EventArgs e) { Advisor b = new Advisor(); b.Show(); this.Hide(); }
public static Advisor getInstance() { if (l == null) { l = new Advisor(); l.Show(); return(l); } else { return(l); } }
private void cmdAddAdvisor_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(txtadvisorid.Text) && !string.IsNullOrEmpty(txtsalary.Text)) { SqlConnection con = new SqlConnection(conStr); con.Open(); if (con.State == System.Data.ConnectionState.Open) { string Desig = ""; string data; if (cmbDesignation.SelectedIndex == 0) { Desig = "6"; //data = "insert into (Designation , Salary) Values ()" } if (cmbDesignation.SelectedIndex == 1) { Desig = "7"; } if (cmbDesignation.SelectedIndex == 2) { Desig = "8"; } if (cmbDesignation.SelectedIndex == 3) { Desig = "9"; } if (cmbDesignation.SelectedIndex == 4) { Desig = "10"; } data = "insert into Advisor(Id, Designation , Salary) values ( '" + Convert.ToString(txtadvisorid.Text) + "' , '" + Convert.ToInt32(Desig) + "', '" + Convert.ToInt32(txtsalary.Text) + "')"; SqlCommand cmd = new SqlCommand(data, con); try { if (cmd.ExecuteNonQuery() > 0) { MessageBox.Show("Advisor Added in database"); //string show = "select * from OnlyName"; //DataTable table = new DataTable(); //SqlDataAdapter dat = new SqlDataAdapter(show, con); //dat.Fill(table); //dataGridView1.DataSource = table; //cmd.CommandText = "Select @@Identity"; //id = Convert.ToInt32(cmd.ExecuteScalar()); //string InsertStudent = "INSERT INTO Student(Id, RegistrationNo) VALUES('" + id + "','" + Convert.ToString(txtRegNo.Text) + "')"; //SqlCommand sqlCommand = new SqlCommand(InsertStudent, con); //sqlCommand.ExecuteNonQuery() this.Close(); Advisor a = new Advisor(); a.Show(); } } catch (System.Exception ex) { MessageBox.Show("Error is " + ex.ToString()); } } } else { MessageBox.Show("Enter values"); } }
private void button8_Click(object sender, EventArgs e) { Advisor fm2 = new Advisor(); fm2.Show(); }