private List <GroupDTO> GetGroups()
        {
            ServiceProxy _serviceProxy = new ServiceProxy();

            return(_serviceProxy.GetAllGroupWithAdmins(AuthToken, UserType));
        }
        private void UpsertGroup(Group grp, ListViewItem editItem, bool isCreate = false)
        {
            grp.GroupName     = ((TextBox)editItem.FindControl("GroupNameTextBox")).Text;
            grp.Email         = ((TextBox)editItem.FindControl("EmailTextBox")).Text;
            grp.PhoneNumber   = ((TextBox)editItem.FindControl("PhoneNumberTextBox")).Text;
            grp.EnrollmentKey = ((TextBox)editItem.FindControl("EnrollmentKeyTextBox")).Text;


            if (((TextBox)editItem.FindControl("LocationTextBox")) != null)
            {
                grp.GroupLocation = ((TextBox)editItem.FindControl("LocationTextBox")).Text;
            }

            string ShapeFileName = Path.GetFileNameWithoutExtension(((TextBox)editItem.FindControl("ShapeFileIDTextBox")).Text);

            grp.ShapeFileID = ShapeFileName;


            grp.LiveInfo        = new LiveCred();
            grp.LiveInfo.LiveID = ((TextBox)editItem.FindControl("LiveIDTextBox")).Text;
            grp.GeoLocation     = ((TextBox)editItem.FindControl("GeoLocationTextBox")).Text;
            grp.ParentGroupID   = Convert.ToInt32(((DropDownList)editItem.FindControl("ddlParentGroupNames")).SelectedValue);


            grp.SubGroupIdentificationKey = (grp.ParentGroupID.Value == 0) ? ((TextBox)editItem.FindControl("GroupKeyTextBox")).Text : ((DropDownList)editItem.FindControl("CircleKeyDropDownList")).SelectedValue;

            var rGrp1 = (RadioButton)editItem.FindControl("rGroupType1");
            var rGrp2 = (RadioButton)editItem.FindControl("rGroupType2");
            var rGrp3 = (RadioButton)editItem.FindControl("rGroupType3");

            if (rGrp1.Checked)
            {
                grp.Type           = GroupType.Private;
                grp.EnrollmentType = Enrollment.AutoOrgMail;
            }
            if (rGrp2.Checked)
            {
                grp.Type           = GroupType.Public;
                grp.EnrollmentType = Enrollment.None;
            }
            if (rGrp3.Checked)
            {
                grp.Type           = GroupType.Social;
                grp.EnrollmentType = Enrollment.Moderator;
            }

            if (((CheckBox)editItem.FindControl("IsActiveCheckBox")).Checked)
            {
                grp.IsActive = true;
            }
            else
            {
                grp.IsActive = false;
            }

            if (((CheckBox)editItem.FindControl("NotifySubgroupsCheckBox")).Checked)
            {
                grp.NotifySubgroups = true;
            }
            else
            {
                grp.NotifySubgroups = false;
            }

            if (((CheckBox)editItem.FindControl("AllowGroupManagementCheckBox")).Checked)
            {
                grp.AllowGroupManagement = true;
            }
            else
            {
                grp.AllowGroupManagement = false;
            }

            if (((CheckBox)editItem.FindControl("ShowIncidentsCheckBox")).Checked)
            {
                grp.ShowIncidents = true;
            }
            else
            {
                grp.ShowIncidents = false;
            }

            ServiceProxy _serviceProxy = new ServiceProxy();

            if (!isCreate)
            {
                string partitionKey = ((HiddenField)editItem.FindControl("PartitionKey")).Value;
                string rowKey       = ((HiddenField)editItem.FindControl("RowKey")).Value;
                _serviceProxy.EditGroup(AuthToken, UserType, grp, partitionKey, rowKey);
            }
            else
            {
                _serviceProxy.EditGroup(AuthToken, UserType, grp, isCreate: true);
            }
        }