}        //end page_load

        protected void ShowGroupSelect(int datasetId)
        {
            datasetMessage.Text = "";

            GroupDatasetDa da = new GroupDatasetDa();

            //get users existing groups
            DataSet ds = da.GetGroupsByDatasetId(datasetId);

            rptDatasetGroups.DataSource = ds.Tables[0].DefaultView;
            rptDatasetGroups.DataBind();

            if (ds.Tables[0].Rows.Count == 0)
            {
                datasetMessage.Text = "No Groups Assigned";
            }

            //get groups
            GroupDa gda = new GroupDa();
            DataSet gds = gda.GetGroups();

            Group.DataSource     = gds.Tables[0].DefaultView;
            Group.DataValueField = "GroupId";
            Group.DataTextField  = "GroupName";
            Group.DataBind();
            Group.Items.Insert(0, new ListItem(""));

            SelectDatasetTable.Visible = true;
        }
        protected void DeleteButtonClick(object sender, CommandEventArgs e)
        {
            GroupDatasetDa groupDatasetDa = new GroupDatasetDa();
            int            datasetId      = int.Parse(Request.Form["SelectDatasetName"]);
            int            groupId        = int.Parse(e.CommandName);

            groupDatasetDa.DeleteGroupDataset(datasetId, groupId);

            this.Page_Load(sender, (System.EventArgs)e);
        }
Exemple #3
0
        protected void DeleteButtonClick(object sender, CommandEventArgs e)
        {
            RepeaterDiv.Visible = false;

            GroupDatasetDa groupDatasetDa = new GroupDatasetDa();
            int            datasetId      = int.Parse(e.CommandArgument.ToString());
            DataSet        ds             = groupDatasetDa.GetGroupsInDataset(datasetId);
            string         numberOfGroups = "";

            if (ds.Tables[0].Rows.Count > 0)
            {
                numberOfGroups = ds.Tables[0].Rows[0]["GroupCount"].ToString();

                valMsg.Text = "There are " + numberOfGroups + " user group(s) associated with this dataset. By deleting it you are removing all the associations with these groups, and therefore users within those groups will no longer be able to access this set of patients.<br><br>Are you sure you want to delete it?";
            }
            else
            {
                valMsg.Text = "There are currently no groups associated with this dataset.  Confirm delete?";
            }
            valMsg.Text += "<br><br><a href=\"AdminDatasets.aspx?delete=yes&datasetId=" + datasetId + "\">Yes</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"AdminDatasets.aspx\">No</a>";
        }