private void cmd_evaluation_Click(object sender, EventArgs e) { Evaluation z = new Evaluation(); z.Show(); this.Hide(); }
private void button4_Click(object sender, EventArgs e) { Evaluation eva = new Evaluation(); this.Hide(); eva.Show(); }
private void btnEvaluation_Click(object sender, EventArgs e) { Evaluation ei = new Evaluation(); ei.Show(); this.Hide(); }
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 Evaluation where Id = '" + id + "'"; SqlCommand s = new SqlCommand(query, con); s.ExecuteNonQuery(); //string query1 = "Delete from Person where Id = '" + id + "'"; //SqlCommand sq = new SqlCommand(query1, con); //sq.ExecuteNonQuery(); } MessageBox.Show("Succesfully Deleted"); Evaluation ap = new Evaluation(); this.Close(); ap.Show(); } }
private void evaldispGrid_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == 4) { DialogResult result = MessageBox.Show("Are you sure you want to delete this Evaluation?", "Evaluation", MessageBoxButtons.YesNo); if (result == DialogResult.Yes) { Delete_Rec(); // Delete(); } else if (result == DialogResult.No) { this.Hide(); Evaluation obj = new Evaluation(); obj.Show(); } } if (e.ColumnIndex == 5) { DialogResult result = MessageBox.Show("Are you sure you want to update this Evaluation", "Evaluation", MessageBoxButtons.YesNo); if (result == DialogResult.Yes) { panel1.Hide(); //panel2.Hide(); addpan.Hide(); edpanbt.Show(); } else if (result == DialogResult.No) { this.Hide(); Evaluation obj = new Evaluation(); obj.Show(); } } }
private void Update_rec() { con.Open(); int index = evaldispGrid.CurrentCell.RowIndex; evaldispGrid.Rows[index].Selected = true; string id = evaldispGrid.SelectedCells[0].Value.ToString(); try { SqlCommand cmd = new SqlCommand(" UPDATE Evaluation SET Name ='" + nameebx.Text + "', TotalMarks = '" + TMbx.Text + "', TotalWeightage= '" + TWbx.Text + "' WHERE Id = '" + id + "';", con); cmd.ExecuteNonQuery(); evaldispGrid.Rows.RemoveAt(index); evaldispGrid.DataSource = dt; MessageBox.Show("Done."); this.Hide(); Evaluation obj = new Evaluation(); obj.Show(); } catch { MessageBox.Show("Something Went wrong."); } con.Close(); }
private void addrec_Click(object sender, EventArgs e) { if (string.IsNullOrWhiteSpace(Namme.Text) || string.IsNullOrWhiteSpace(TotalMarks.Text) || string.IsNullOrWhiteSpace(weightage.Text)) { MessageBox.Show("An evaluation must have defined name, marks and weightage <=100"); } else { con.Close(); con.Open(); SqlCommand cmd = con.CreateCommand(); cmd = new SqlCommand("INSERT INTO Evaluation(Name, TotalMarks,TotalWeightage) VALUES(@Name,@TotalMarks,@TotalWeightage)", con); cmd.Parameters.AddWithValue("@Name", Namme.Text); cmd.Parameters.AddWithValue("@TotalMarks", TotalMarks.Text); cmd.Parameters.AddWithValue("@TotalWeightage", weightage.Text); cmd.ExecuteNonQuery(); con.Close(); MessageBox.Show("Data Inserted Successfully"); this.Hide(); Evaluation eval = new Evaluation(); eval.Show(); } }
private void linkLabel3_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { Evaluation ev = new Evaluation(); this.Hide(); ev.Show(); }
private void groupWiseToolStripMenuItem_Click(object sender, EventArgs e) { Evaluation l = Evaluation.getInstance(); l.Show(); this.Hide(); }
private void UpdateGE_Click(object sender, EventArgs e) { update_GE(); this.Hide(); Evaluation obj = new Evaluation(); obj.Show(); }
public static Evaluation getInstance() { if (l == null) { l = new Evaluation(); l.Show(); return(l); } else { return(l); } }
private void button3_Click(object sender, EventArgs e) { SqlConnection con = new SqlConnection(conStr); con.Open(); string Insert; if (con.State == System.Data.ConnectionState.Open) { Insert = string.Format("insert into Evaluation( Name,TotalMarks, TotalWeightage) values ( '{0}',{1},{2} )", txtName.Text, Convert.ToInt32(txtMarks.Text), Convert.ToInt32(txtWeightage.Text)); SqlCommand cmd = new SqlCommand(Insert, con); cmd.ExecuteNonQuery(); MessageBox.Show("Evaluation Added in DataBase"); Evaluation ea = new Evaluation(); ea.Show(); this.Close(); } }
private void button10_Click(object sender, EventArgs e) { Evaluation eval = new Evaluation(); eval.Show(); }
private void button9_Click_1(object sender, EventArgs e) { Evaluation evalfm = new Evaluation(); evalfm.Show(); }
private void eval_Click(object sender, EventArgs e) { Evaluation evalfm = new Evaluation(); evalfm.Show(); }
private void addGEbt_Click(object sender, EventArgs e) { con.Close(); con.Open(); SqlCommand check_User_Name = new SqlCommand("SELECT GroupId FROM GroupEvaluation WHERE ([GroupId] = @GI) AND ([EvaluationId] = @EI)", con); check_User_Name.Parameters.AddWithValue("GI", GItxt.Text); check_User_Name.Parameters.AddWithValue("EI", GItxt.Text); SqlDataReader reader = check_User_Name.ExecuteReader(); if (reader.HasRows) { con.Close(); MessageBox.Show("Already exists."); } else { //string id = evaldispGrid.SelectedCells[0].Value.ToString(); SqlCommand cmd1 = new SqlCommand("SELECT * FROM Evaluation WHERE Id = '" + EItxt.Text + "'", con); SqlDataReader reader1 = cmd1.ExecuteReader(); if (!(reader1.HasRows)) { con.Close(); MessageBox.Show("Evaluation Is Not Present Defined."); } else { SqlCommand cmd = new SqlCommand("Select TotalMarks from Evaluation WHERE Id = '" + EItxt.Text + "';", con); object countstd1 = cmd.ExecuteScalar(); int countstd = 0; if (!(countstd1 == DBNull.Value)) { countstd = Convert.ToInt32(countstd1); } if (countstd <= Convert.ToInt32(OMtxt.Text)) { con.Close(); MessageBox.Show("Obtained marks must not excedd TotalMarks."); } else { cmd1 = new SqlCommand("SELECT * FROM [Group] WHERE Id = '" + GItxt.Text + "'", con); SqlDataReader reader2 = cmd1.ExecuteReader(); if (!(reader2.HasRows)) { con.Close(); MessageBox.Show("Group does not exists."); } else { try { cmd = con.CreateCommand(); cmd = new SqlCommand("INSERT INTO GroupEvaluation(GroupId,EvaluationId,ObtainedMarks,EvaluationDate) VALUES(@GroupId,@EvaluationId,@ObtainedMarks,@EvaluationDate);SELECT SCOPE_IDENTITY();", con); cmd.Parameters.AddWithValue("@GroupId", GItxt.Text); cmd.Parameters.AddWithValue("@EvaluationId", EItxt.Text); cmd.Parameters.AddWithValue("@ObtainedMarks", OMtxt.Text); cmd.Parameters.AddWithValue("@EvaluationDate", DateTime.Parse(datetx.Text)); cmd.ExecuteNonQuery(); con.Close(); MessageBox.Show("Added."); this.Hide(); Evaluation obj = new Evaluation(); obj.Show(); } catch { MessageBox.Show("Something went wrong."); } } } } } }
private void button6_Click(object sender, EventArgs e) { Evaluation fm2 = new Evaluation(); fm2.Show(); }