예제 #1
0
        private void label7_Click(object sender, EventArgs e)
        {
            GroupHome group = new GroupHome();

            this.Hide();
            group.Show();
        }
예제 #2
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 ProjectAdvisor (AdvisorId,ProjectId,AdvisorRole,AssignmentDate)VALUES((select Id from Person where Person.FirstName = '"+comboBox2.Text+ "'),(select Id from Project where Project.Title = '" + comboBox1.Text + "'),(select Id from Lookup where Lookup.Value ='" + comboBox3.Text + "'),('" + Convert.ToDateTime(dateTimePicker1.Text) + "'));";

                //SqlConnection con = new SqlConnection(str);

                //SqlCommand cmd = new SqlCommand(query, con);

                //con.Open();

                //cmd.ExecuteNonQuery();

                MessageBox.Show("Data insert");
                GroupHome grhm = new GroupHome();
                this.Hide();
                grhm.Show();

                //con.Close();
            }

            catch (Exception es)

            {
                MessageBox.Show(es.Message);
            }
        }
예제 #3
0
        private void pictureBox5_Click(object sender, EventArgs e)
        {
            GroupHome group = new GroupHome();

            this.Hide();
            group.Show();
        }
예제 #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            GroupHome grhm = new GroupHome();

            this.Hide();
            grhm.Show();
        }
예제 #5
0
        private void button2_Click(object sender, EventArgs e)
        {
            GroupHome GRHM = new GroupHome();

            this.Hide();
            GRHM.Show();
        }
예제 #6
0
        private void button1_Click(object sender, EventArgs e)
        {
            int           key   = Convert.ToInt32(textBox1.Text);
            String        str   = "Data Source=HAIER-PC\\NIMRASQLSERVER;Initial Catalog=ProjectA;Integrated Security=True";
            String        query = "Update GroupStudent Set AssignmentDate=('" + Convert.ToDateTime(dateTimePicker1.Text) + "'), Status=(select Id from Lookup where Lookup.Value ='" + comboBox1.Text + "') where GroupId = '" + 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();

            GroupHome grhm = new GroupHome();

            this.Hide();
            grhm.Show();
        }
예제 #7
0
        private void dataGridView1_CellContentClick_1(object sender, DataGridViewCellEventArgs e)
        {
            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          query2 = "Delete from GroupProject where GroupId = '" + row.Cells[0].Value + "';";
                SqlCommand      cmd2   = new SqlCommand(query2, con);
                cmd2.ExecuteNonQuery();
                String     query = "Delete from GroupStudent where GroupId = '" + row.Cells[0].Value + "';";
                SqlCommand cmd   = new SqlCommand(query, con);
                cmd.ExecuteNonQuery();
                String     query1 = "Delete from [Group] where Id = '" + row.Cells[0].Value + "';";
                SqlCommand cmd1   = new SqlCommand(query1, con);

                cmd1.ExecuteNonQuery();

                MessageBox.Show("Group is deleted");

                GroupHome grhm = new GroupHome();
                this.Hide();
                grhm.Show();
            }
            if (e.RowIndex >= 0 && e.ColumnIndex == 4)
            {
                EditGroup edit = new EditGroup();
                //panel1.Show();

                edit.textBox1.Text = this.dataGridView1.CurrentRow.Cells[0].Value.ToString();

                edit.dateTimePicker1.Text = this.dataGridView1.CurrentRow.Cells[3].Value.ToString();
                edit.comboBox1.Text       = this.dataGridView1.CurrentRow.Cells[2].Value.ToString();
                this.Hide();
                edit.Show();
            }
        }