protected void ButtonModalAssocActItems_Click(object sender, EventArgs e)
        {
            using (SqlConnection conn = new SqlConnection(g_sqlConn))
            {
                try
                {
                    Connect(conn);

                    foreach (GridViewRow row in this.GridViewAssociateActionItems.Rows)
                    {
                        CheckBox checkRow = (row.Cells[0].FindControl("CheckBoxAssociateActItems") as CheckBox);

                        if (checkRow.Checked)
                        {
                            using (SqlCommand cmd = new SqlCommand("UPDATE tblActionItems SET AssociatedIssue=@AssocIssue WHERE UserID=@UserID AND ProjectID=@ProjID AND ActionItemID=@ActionID", conn))
                            {
                                cmd.Parameters.AddWithValue("@AssocIssue", Session["_CurrentIssueID"]);
                                cmd.Parameters.AddWithValue("@UserID", Session["_CurrentUserID"]);
                                cmd.Parameters.AddWithValue("@ProjID", Session["_CurrentProjID"]);
                                cmd.Parameters.AddWithValue("@ActionID", row.Cells[0].Text);

                                cmd.ExecuteNonQuery();
                            }
                        }

                        else
                        {
                            using (SqlCommand cmd = new SqlCommand("UPDATE tblActionItems SET AssociatedIssue=NULL WHERE UserID=@UserID AND ProjectID=@ProjID AND ActionItemID=@ActionID", conn))
                            {
                                cmd.Parameters.AddWithValue("@UserID", Session["_CurrentUserID"]);
                                cmd.Parameters.AddWithValue("@ProjID", Session["_CurrentProjID"]);
                                cmd.Parameters.AddWithValue("@ActionID", row.Cells[0].Text);

                                cmd.ExecuteNonQuery();
                            }
                        }
                    }
                }

                catch (Exception ex)
                {
                    Response.Write(String.Format("Error while executing query...{0}", ex.ToString()));
                }

                finally
                {
                    Disconnect(conn);
                }
            }

            GridViewAssociatedActItem.DataBind();
        }
        protected void ButtonDelete_Click(object sender, EventArgs e)
        {
            if (TextBoxName.Text.Length == 0)
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(),
                                                        "alertMessage",
                                                        "alert('Please enter a name of the Issue to delete.');", true);
            }

            else
            {
                using (SqlConnection conn = new SqlConnection(g_sqlConn))
                {
                    Connect(conn);

                    using (SqlCommand cmd2 = new SqlCommand(String.Format("SELECT IssueID FROM tblIssues WHERE Name='{0}' AND UserID={1} AND ProjectID={2}",
                                                                          TextBoxName.Text, Session["_CurrentUserID"], Session["_CurrentProjID"]), conn))
                    {
                        SqlDataReader sdr = cmd2.ExecuteReader();

                        while (sdr.Read())
                        {
                            Session["_CurrentIssueID"] = sdr[0].ToString();
                        }
                        sdr.Close();
                    }

                    using (SqlCommand cmd3 = new SqlCommand(String.Format("UPDATE tblActionItems SET AssociatedIssue = NULL WHERE AssociatedIssue={0}", Session["_CurrentIssueID"]), conn))
                    {
                        try
                        {
                            cmd3.ExecuteNonQuery();
                        }

                        catch (Exception ex)
                        {
                            Response.Write(String.Format("Error while executing query...{0}", ex.ToString()));
                        }
                    }

                    using (SqlCommand cmd = new SqlCommand(string.Format("delete from tblStatusIssues where UserID={0} and ProjectID={1} AND AssociatedIssue={2}", Session["_CurrentUserID"], Session["_CurrentProjID"], Session["_CurrentIssueID"]), conn))
                    {
                        using (SqlCommand cmd2 = new SqlCommand(string.Format("delete from tblPriorityIssues where UserID={0} and ProjectID={1} AND AssociatedIssue={2}", Session["_CurrentUserID"], Session["_CurrentProjID"], Session["_CurrentIssueID"]), conn))
                        {
                            using (SqlCommand cmd3 = new SqlCommand(string.Format("delete from tblSeverityIssues where UserID={0} and ProjectID={1} AND AssociatedIssue={2}", Session["_CurrentUserID"], Session["_CurrentProjID"], Session["_CurrentIssueID"]), conn))
                            {
                                cmd.ExecuteNonQuery();
                                cmd2.ExecuteNonQuery();
                                cmd3.ExecuteNonQuery();
                            }
                        }
                    }

                    using (SqlCommand cmd = new SqlCommand(String.Format("delete from tblIssues where UserID={0} and ProjectID={1} AND Name='{2}'",
                                                                         Session["_CurrentUserID"], Session["_CurrentProjID"], TextBoxName.Text), conn))
                    {
                        try
                        {
                            cmd.ExecuteNonQuery();
                        }

                        catch (Exception ex)
                        {
                            Response.Write(String.Format("Error while executing query...{0}", ex.ToString()));
                        }

                        finally
                        {
                            Disconnect(conn);
                        }
                    }
                }

                this.DropDownListIssuesSelect.Items.Clear();
                this.DropDownListIssuesSelect.DataBind();
                GridViewAssociatedActItem.DataBind();
                GridViewAssociatedDecisions.DataBind();
            }
        }