private void btnAdvisors_Click(object sender, EventArgs e) { this.Hide(); AddAdvisor AA = new AddAdvisor(); AA.Show(); }
private void btnAdvisor_Click(object sender, EventArgs e) { AddAdvisor ad = new AddAdvisor(); ad.Show(); this.Hide(); }
private void button1_Click(object sender, EventArgs e) { AdvisorDisplay.Hide(); panel1.Hide(); //panel3.Hide(); AddAdvisor.Show(); panel2.Show(); }
private void Submit_Click(object sender, EventArgs e) { SqlConnection con = new SqlConnection(conStr); con.Open(); string Insert; string mId; if (con.State == System.Data.ConnectionState.Open) { mId = "select max(Id) from Advisor"; SqlCommand c = new SqlCommand(mId, con); int count = 0; count = int.Parse(c.ExecuteScalar().ToString()); if (cmbDesignation.SelectedIndex == 0) { Insert = "insert into Advisor(Id , Designation , Salary) values ('" + (count + 1) + "', '" + 6 + "', '" + Convert.ToInt32(Salary.Text) + "')"; SqlCommand cmd = new SqlCommand(Insert, con); cmd.ExecuteNonQuery(); MessageBox.Show("Advisor Added"); } if (cmbDesignation.SelectedIndex == 1) { Insert = "insert into Advisor(Id , Designation , Salary) values ('" + (count + 1) + "', '" + 7 + "', '" + Convert.ToInt32(Salary.Text) + "')"; SqlCommand cmd = new SqlCommand(Insert, con); cmd.ExecuteNonQuery(); MessageBox.Show("Advisor Added"); } if (cmbDesignation.SelectedIndex == 2) { Insert = "insert into Advisor(Id , Designation , Salary) values ('" + (count + 1) + "', '" + 8 + "', '" + Convert.ToInt32(Salary.Text) + "')"; SqlCommand cmd = new SqlCommand(Insert, con); cmd.ExecuteNonQuery(); MessageBox.Show("Advisor Added"); } if (cmbDesignation.SelectedIndex == 3) { Insert = "insert into Advisor(Id , Designation , Salary) values ('" + (count + 1) + "', '" + 9 + "', '" + Convert.ToInt32(Salary.Text) + "')"; SqlCommand cmd = new SqlCommand(Insert, con); cmd.ExecuteNonQuery(); MessageBox.Show("Advisor Added"); } if (cmbDesignation.SelectedIndex == 4) { Insert = "insert into Advisor(Id , Designation , Salary) values ('" + (count + 1) + "', '" + 10 + "', '" + Convert.ToInt32(Salary.Text) + "')"; SqlCommand cmd = new SqlCommand(Insert, con); cmd.ExecuteNonQuery(); MessageBox.Show("Advisor Added"); } AddAdvisor ad = new AddAdvisor(); this.Close(); ad.Show(); } }
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { this.Hide(); AddStudent AS = new AddStudent(); AS.Show(); AddAdvisor AD = new AddAdvisor(); AD.Show(); AddProject AP = new AddProject(); AP.Show(); MakeGroups MG = new MakeGroups(); //MG.Show(); CreateGroup CG = new CreateGroup(); //CG.Show(); AddEvaluation AE = new AddEvaluation(); AE.Show(); }
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { int selected = dataGridView1.CurrentCell.RowIndex; DataGridViewRow r = dataGridView1.Rows[selected]; int id = (int)r.Cells[1].Value; if (e.ColumnIndex == 0) { SqlConnection con = new SqlConnection(conStr); con.Open(); if (con.State == System.Data.ConnectionState.Open) { string query = "Delete from Advisor where Id = '" + id + "'"; SqlCommand s = new SqlCommand(query, con); s.ExecuteNonQuery(); } MessageBox.Show("Succesfully Deleted"); AddAdvisor ap = new AddAdvisor(); this.Close(); ap.Show(); } }
private void addDis_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == 6) { DialogResult result = MessageBox.Show("Are you sure you want to delete this Advisor?", "Person", MessageBoxButtons.YesNo); if (result == DialogResult.Yes) { Delete_rec(); } } if (e.ColumnIndex == 7) { DialogResult result = MessageBox.Show("Are you sure you want to update this Advisor", "person", MessageBoxButtons.YesNo); if (result == DialogResult.Yes) { AdvisorDisplay.Hide(); panel2.Hide(); AddAdvisor.Show(); panel1.Show(); //panel3.Hide(); } } }