protected void btnDelete_Click(object sender, EventArgs e)
    {
        warning_id = Convert.ToInt32(Request.QueryString["warningID"]);
        qSoc_Warning warning = new qSoc_Warning(warning_id);

        warning.Available = "No";
        warning.Update();

        // if being processed as a task then close task
        if (Request.QueryString["source"] == "tasks")
        {
            int task_id = Convert.ToInt32(Request.QueryString["taskID"]);
            qPtl_Task task = new qPtl_Task(task_id);

            task.PercentCompleted = 100;
            task.Status = "Completed";
            task.Update();
        }
        else
        {
            // check to see if there there a pending task
            qPtl_Task task = new qPtl_Task(warning.ContentTypeID, warning_id);

            if (task != null)
            {
                if (task.TaskID > 0)
                {
                    task.PercentCompleted = 100;
                    task.Status = "Completed";
                    task.Update();
                }
            }
        }

        if (Request.QueryString["source"] == "tasks")
            Response.Redirect("~/manage/members/task-list.aspx?searchType=open");
        else if (!String.IsNullOrEmpty(Request.QueryString["status"]))
            Response.Redirect("~/manage/members/warnings-list.aspx?status=" + Request.QueryString["status"]);
        else
            Response.Redirect("~/manage/members/warnings-list.aspx");
    }
    protected void btnSave_OnClick(object sender, System.EventArgs e)
    {
        int user_id = Convert.ToInt32(Context.Items["UserID"]);

        if (!String.IsNullOrEmpty(Request.QueryString["warningID"]))
        {
            warning_id = Convert.ToInt32(Request.QueryString["warningID"]);
            qSoc_Warning warning = new qSoc_Warning(warning_id);

            warning.Status = ddlStatus.SelectedValue;
            warning.LastModifiedBy = Convert.ToInt32(Context.Items["UserID"]);
            warning.LastModified = DateTime.Now;
            warning.Update();

            // if being processed as a task then close task
            if (Request.QueryString["source"] == "tasks")
            {
                int task_id = Convert.ToInt32(Request.QueryString["taskID"]);
                qPtl_Task task = new qPtl_Task(task_id);

                if (ddlStatus.SelectedValue == "Reviewed")
                {
                    task.PercentCompleted = 100;
                    task.Status = "Completed";
                    task.Update();
                }
            }
            else
            {
                // check to see if there there a pending task
                qPtl_Task task = new qPtl_Task(warning.ContentTypeID, warning_id);

                if (task != null)
                {
                    if (task.TaskID > 0)
                    {
                        task.PercentCompleted = 100;
                        task.Status = "Completed";
                        task.Update();
                    }
                }
            }
        }

        if (Request.QueryString["source"] == "tasks")
            Response.Redirect("~/manage/members/task-list.aspx?searchType=open");
        else if (!String.IsNullOrEmpty(Request.QueryString["status"]))
            Response.Redirect("~/manage/members/warnings-list.aspx?status=" + Request.QueryString["status"]);
        else
            Response.Redirect("~/qSoc/warnings-list.aspx");
    }