private void BackBtn_Click(object sender, EventArgs e)
        {
            GroupStudent form = new GroupStudent();

            form.Show();
            this.Hide();
        }
        private void GroupEvaluationDataGridView_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            int currentRow        = int.Parse(e.RowIndex.ToString());
            int curentcolumnindex = int.Parse(e.ColumnIndex.ToString());
            int EvaluationId      = Convert.ToInt32(GroupEvaluationDataGridView.Rows[currentRow].Cells[1].Value);

            if (curentcolumnindex == 0)
            {
                SqlConnection conn = new SqlConnection(conURL);
                conn.Open();

                if (!String.IsNullOrEmpty(ObtainedMarksTextBox.Text))
                {
                    String     AddCMD     = "INSERT INTO GroupEvaluation (GroupId, EvaluationId, ObtainedMarks, EvaluationDate) VALUES (@gid, @eid, @marks, @evalDate)";
                    SqlCommand AddCommand = new SqlCommand(AddCMD, conn);

                    AddCommand.Parameters.Add(new SqlParameter("status", 3));
                    AddCommand.Parameters.Add(new SqlParameter("eid", EvaluationId));
                    AddCommand.Parameters.Add(new SqlParameter("gid", groupId));
                    AddCommand.Parameters.Add(new SqlParameter("marks", Convert.ToInt32(ObtainedMarksTextBox.Text)));
                    AddCommand.Parameters.Add(new SqlParameter("evalDate", DateTime.Today));

                    int count = AddCommand.ExecuteNonQuery();
                }
                GroupStudent form = new GroupStudent();
                form.Show();
                this.Hide();
            }
        }
        private void AddGroupBtn_Click(object sender, EventArgs e)
        {
            SqlConnection conn = new SqlConnection(conURL);

            conn.Open();
            String     AddGroupCMD     = "INSERT INTO [Group] (Created_On) VALUES (@cdate)";
            SqlCommand AddGroupCommand = new SqlCommand(AddGroupCMD, conn);

            AddGroupCommand.Parameters.Add(new SqlParameter("cdate", DateTime.Today));
            int count = AddGroupCommand.ExecuteNonQuery();

            GroupStudent form = new GroupStudent();

            form.Show();
            this.Hide();
        }
        private void AddGroupProjectDataGridView_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            int currentRow        = int.Parse(e.RowIndex.ToString());
            int curentcolumnindex = int.Parse(e.ColumnIndex.ToString());
            int ProjectId         = Convert.ToInt32(AddGroupProjectDataGridView.Rows[currentRow].Cells[1].Value);

            if (curentcolumnindex == 0)
            {
                SqlConnection conn = new SqlConnection(conURL);
                conn.Open();
                String     AddCMD     = "INSERT INTO GroupProject (ProjectId, GroupId, AssignmentDate) VALUES (@prid, @gid, @asgnDate)";
                SqlCommand AddCommand = new SqlCommand(AddCMD, conn);
                AddCommand.Parameters.Add(new SqlParameter("prid", ProjectId));
                AddCommand.Parameters.Add(new SqlParameter("gid", groupId));
                AddCommand.Parameters.Add(new SqlParameter("asgnDate", DateTime.Today));

                int count = AddCommand.ExecuteNonQuery();
            }
            GroupStudent form = new GroupStudent();

            form.Show();
            this.Hide();
        }
        private void StdGroupDataGridView_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            int    currentRow        = int.Parse(e.RowIndex.ToString());
            int    curentcolumnindex = int.Parse(e.ColumnIndex.ToString());
            string gid = StdGroupDataGridView.Rows[currentRow].Cells[0].Value.ToString();

            if (curentcolumnindex == 2)
            {
                AddStudentGroup form = new AddStudentGroup(Convert.ToInt32(gid));
                form.Show();
                this.Hide();
            }
            if (curentcolumnindex == 3)
            {
                ViewGroupStudents form = new ViewGroupStudents(Convert.ToInt32(gid));
                form.Show();
                this.Hide();
            }
            if (curentcolumnindex == 4)
            {
                AddEvaluationGroup form = new AddEvaluationGroup(Convert.ToInt32(gid));
                form.Show();
                this.Hide();
            }
            if (curentcolumnindex == 5)
            {
                ViewGroupEvaluation form = new ViewGroupEvaluation(Convert.ToInt32(gid));
                form.Show();
                this.Hide();
            }
            if (curentcolumnindex == 6)
            {
                AddGroupProject form = new AddGroupProject(Convert.ToInt32(gid));
                form.Show();
                this.Hide();
            }
            if (curentcolumnindex == 7)
            {
                ViewGroupProject form = new ViewGroupProject(Convert.ToInt32(gid));
                form.Show();
                this.Hide();
            }

            if (curentcolumnindex == 8)
            {
                SqlConnection conn = new SqlConnection(conURL);
                conn.Open();
                String     DeleteCMD     = "DELETE FROM GroupStudent WHERE GroupStudent.GroupId = @id";
                SqlCommand DeleteCommand = new SqlCommand(DeleteCMD, conn);
                DeleteCommand.Parameters.Add(new SqlParameter("id", Convert.ToInt32(gid)));
                int count = DeleteCommand.ExecuteNonQuery();

                String     DeleteCMD2     = "DELETE FROM GroupEvaluation WHERE GroupEvaluation.GroupId = @id";
                SqlCommand DeleteCommand2 = new SqlCommand(DeleteCMD2, conn);
                DeleteCommand2.Parameters.Add(new SqlParameter("id", Convert.ToInt32(gid)));
                count = DeleteCommand2.ExecuteNonQuery();

                String     DeleteCMD3     = "DELETE FROM GroupProject WHERE GroupProject.GroupId = @id";
                SqlCommand DeleteCommand3 = new SqlCommand(DeleteCMD3, conn);
                DeleteCommand3.Parameters.Add(new SqlParameter("id", Convert.ToInt32(gid)));
                count = DeleteCommand3.ExecuteNonQuery();

                String     DeleteCMD4     = "DELETE FROM [Group] WHERE [Group].Id = @id";
                SqlCommand DeleteCommand4 = new SqlCommand(DeleteCMD4, conn);
                DeleteCommand4.Parameters.Add(new SqlParameter("id", Convert.ToInt32(gid)));
                count = DeleteCommand4.ExecuteNonQuery();

                GroupStudent form = new GroupStudent();
                form.Show();
                this.Hide();
            }
        }