Ejemplo n.º 1
0
        private void pictureBox6_Click(object sender, EventArgs e)
        {
            evaluationHome eva = new evaluationHome();

            this.Hide();
            eva.Show();
        }
Ejemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                int           key   = Convert.ToInt32(textBox1.Text);
                String        str   = "Data Source=HAIER-PC\\NIMRASQLSERVER;Initial Catalog=ProjectA;Integrated Security=True";
                String        query = "Update Evaluation Set Name = ('" + textBox2.Text.ToString() + "'),  TotalMarks=('" + Convert.ToInt32(textBox3.Text) + "'),TotalWeightage=('" + Convert.ToInt32(textBox4.Text) + "')where Id = '" + Convert.ToInt32(textBox1.Text) + "';";
                SqlConnection con   = new SqlConnection(str);
                SqlCommand    cmd   = new SqlCommand(query, con);
                con.Open();
                cmd.ExecuteNonQuery();
                MessageBox.Show("Data Updated");


                con.Close();
                panel1.Hide();
                evaluationHome ne = new evaluationHome();
                this.Hide();
                ne.Show();
            }
            catch (Exception es)
            {
                MessageBox.Show(es.Message);
            }
        }
Ejemplo n.º 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            try

            {
                String str = "Data Source=HAIER-PC\\NIMRASQLSERVER;Initial Catalog=ProjectA;Integrated Security=True";

                String query = "INSERT INTO Evaluation (Name,TotalMarks,TotalWeightage)VALUES(('" + (textBox1.Text).ToString() + "'),('" + Convert.ToInt32(textBox2.Text) + "'),('" + Convert.ToInt32(textBox3.Text).ToString() + "'));";

                SqlConnection con = new SqlConnection(str);

                SqlCommand cmd = new SqlCommand(query, con);

                con.Open();

                cmd.ExecuteNonQuery();
                MessageBox.Show("Data Inserted");

                con.Close();
                evaluationHome evashow = new evaluationHome();
                this.Hide();
                evashow.Show();
            }

            catch (Exception es)

            {
                MessageBox.Show(es.Message);
            }
        }
Ejemplo n.º 4
0
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                //label1.Show();
                //label2.Show();
                //label3.Show();
                //textBox1.Show();
                //textBox2.Show();
                //comboBox1.Show();
                String        str = "Data Source=HAIER-PC\\NIMRASQLSERVER;Initial Catalog=ProjectA;Integrated Security=True";
                SqlConnection con = new SqlConnection(str);
                con.Open();
                if (e.RowIndex >= 0 && e.ColumnIndex == 5)
                {
                    DataGridViewRow row   = this.dataGridView1.Rows[e.RowIndex];
                    String          query = "Delete from Evaluation where Id = '" + row.Cells[0].Value + "';";
                    SqlCommand      cmd   = new SqlCommand(query, con);
                    cmd.ExecuteNonQuery();
                    MessageBox.Show("Evaluation Record is deleted");
                    evaluationHome ne = new evaluationHome();
                    this.Hide();
                    ne.Show();
                }
                if (e.RowIndex >= 0 && e.ColumnIndex == 4)
                {
                    //editevaluation edit = new editevaluation();
                    panel1.Show();
                    textBox1.Text = this.dataGridView1.CurrentRow.Cells[0].Value.ToString();
                    textBox2.Text = this.dataGridView1.CurrentRow.Cells[1].Value.ToString();
                    textBox3.Text = this.dataGridView1.CurrentRow.Cells[2].Value.ToString();
                    textBox4.Text = this.dataGridView1.CurrentRow.Cells[3].Value.ToString();

                    //edit.Show();
                }
            }
            catch (Exception es)
            {
                MessageBox.Show(es.Message);
            }
        }