Esempio n. 1
0
        public void EditGroup(string AuthToken, string UserType, SOS.Service.Interfaces.DataContracts.Group grp, string partitionKey = null, string rowkey = null, bool isCreate = false)
        {
            var user = AuthorizeUser(AuthToken, Convert.ToChar(UserType));

            if (user.IsValid && UserType.Equals("a"))
            {
                new GroupService().EditGroup(grp, partitionKey, rowkey, isCreate);
            }
        }
Esempio n. 2
0
        internal static contract.Group MakeContractGroupLite(entity.Group groupEntity)
        {
            if (groupEntity == null)
            {
                return(null);
            }

            var grp = new contract.Group();

            grp.GroupID        = groupEntity.GroupID.ToString();
            grp.GroupName      = groupEntity.GroupName;
            grp.GroupLocation  = groupEntity.Location;
            grp.EnrollmentType = (contract.Enrollment)groupEntity.EnrollmentType;
            grp.EnrollmentKey  = groupEntity.EnrollmentKey;
            grp.Type           = (contract.GroupType)groupEntity.GroupType;
            grp.IsActive       = groupEntity.IsActive;
            grp.Email          = groupEntity.Email;
            grp.PhoneNumber    = groupEntity.PhoneNumber; //TODO:Load Contact details from GroupContacts.
            grp.GeoLocation    = groupEntity.GeoLocation;
            grp.ShowIncidents  = groupEntity.ShowIncidents;
            return(grp);
        }
Esempio n. 3
0
        private void btnCreateGroup_Click(object sender, EventArgs e)
        {
            StringBuilder sb = new StringBuilder();

            dataContracts.Group grp = new dataContracts.Group();

            grp.GroupID = Convert.ToString(groups.Count);

            if (string.IsNullOrEmpty(txtGroupName.Text))
            {
                sb.Append(" GroupName is blank ");
            }
            else
            {
                grp.GroupName = txtGroupName.Text;
            }

            grp.ParentGroupID = cmbParentGroupName.SelectedIndex;

            if (string.IsNullOrEmpty(txtEmail.Text))
            {
                sb.Append("Email is blank");
            }
            else
            {
                grp.Email = txtEmail.Text;
            }

            if (string.IsNullOrEmpty(txtPhoneNumber.Text))
            {
                sb.Append(" PhoneNumber is blank ");
            }
            else
            {
                grp.PhoneNumber = txtPhoneNumber.Text;
            }

            if (string.IsNullOrEmpty(txtEnrollmentKey.Text))
            {
                sb.Append(" EnrollmentKey is blank ");
            }
            else
            {
                grp.EnrollmentKey = txtEnrollmentKey.Text;
            }


            if (string.IsNullOrEmpty(txtShapeFile.Text))
            {
                sb.Append(" ShapeFileID is blank ");
            }
            else
            {
                grp.ShapeFileID = txtShapeFile.Text;
            }

            dataContracts.LiveCred liveCred = new dataContracts.LiveCred();

            if (string.IsNullOrEmpty(txtliveUserID.Text))
            {
                sb.Append(" LiveID is blank ");
            }
            else
            {
                liveCred.LiveID = txtliveUserID.Text;
            }


            if (string.IsNullOrEmpty(txtLiveAuthID.Text))
            {
                sb.Append(" LiveAuthID is blank ");
            }
            else
            {
                grp.LiveInfo = liveCred;
            }
            if (string.IsNullOrEmpty(txtGroupKey.Text))
            {
                sb.Append(" SubGroupIdentificationKey is blank ");
            }
            else
            {
                grp.SubGroupIdentificationKey = txtGroupKey.Text;
            }

            if (string.IsNullOrEmpty(txtEnrollmentKey.Text))
            {
                sb.Append(" EnrollmentKey is blank ");
            }
            else
            {
                grp.EnrollmentKey = txtEnrollmentKey.Text;
            }

            if (string.IsNullOrEmpty(txtGroupLocation.Text))
            {
                sb.Append(" GroupLocation is blank ");
            }
            else
            {
                grp.GroupLocation = txtGroupLocation.Text;
            }

            if (string.IsNullOrEmpty(txtGeoLocation.Text))
            {
                sb.Append(" GeoLocation is blank ");
            }
            else
            {
                grp.GeoLocation = txtGeoLocation.Text;
            }


            if (rEnrollmentType1.Checked)
            {
                grp.EnrollmentType = dataContracts.Enrollment.None;
            }
            if (rEnrollmentType2.Checked)
            {
                grp.EnrollmentType = dataContracts.Enrollment.AutoOrgMail;
            }
            if (rEnrollmentType3.Checked)
            {
                grp.EnrollmentType = dataContracts.Enrollment.Moderator;
            }

            if (rGroupType1.Checked)
            {
                grp.Type = dataContracts.GroupType.Private;
            }
            if (rGroupType2.Checked)
            {
                grp.Type = dataContracts.GroupType.Public;
            }
            if (rGroupType3.Checked)
            {
                grp.Type = dataContracts.GroupType.Social;
            }

            if (chkNotifySubgroups.Checked)
            {
                grp.NotifySubgroups = true;
            }
            else
            {
                grp.NotifySubgroups = false;
            }

            if (chkAllowGroupManagemen.Checked)
            {
                grp.AllowGroupManagement = true;
            }
            else
            {
                grp.AllowGroupManagement = false;
            }

            if (chkShowIncidents.Checked)
            {
                grp.ShowIncidents = true;
            }
            else
            {
                grp.ShowIncidents = false;
            }

            grp.IsActive = true;

            if (sb.Length > 0)
            {
                MessageBox.Show(sb.ToString());
            }
            else
            {
                groupService.EditGroup(grp, null, null, true);
                MessageBox.Show("Group has been created successfully");
            }
        }
Esempio n. 4
0
        internal static entity.GroupMemberValidator MakeGroupMemberValidator(long ProfileID, contract.Group Grp, string ValidationGUID)
        {
            int GroupID = 0;

            if (int.TryParse(Grp.GroupID, out GroupID))
            {
                return new entity.GroupMemberValidator
                       {
                           GroupID              = GroupID,
                           ProfileID            = ProfileID.ToString(),
                           PartitionKey         = GroupID.ToString(),
                           RowKey               = ValidationGUID,
                           ValidationID         = ValidationGUID,
                           IsValidated          = false,
                           NotificationSent     = false,
                           NotificationIdentity = Grp.EnrollmentValue,
                       }
            }
            ;
            return(null);
        }
Esempio n. 5
0
        internal static model.GroupMembership MakeGroupMemberEntity(long ProfileID, string UserName, contract.Group Grp, bool IsValidated)
        {
            int GroupID = 0;

            if (int.TryParse(Grp.GroupID, out GroupID))
            {
                return new model.GroupMembership
                       {
                           GroupID            = GroupID,
                           ProfileID          = ProfileID,
                           UserName           = UserName,
                           EnrollmentKeyValue = Grp.EnrollmentValue,
                           IsValidated        = IsValidated
                       }
            }
            ;
            return(null);
        }