Beispiel #1
0
 public Account ToAccount()
 {
     return(new Account(Name)
     {
         IsAdmin = IsAdmin.GetValueOrDefault(false),
         IsActive = IsActive.GetValueOrDefault(true),
         Password = Password
     });
 }
Beispiel #2
0
        public object GetActionSpecificParameters()
        {
            switch (Action)
            {
            case UserAdminAction.EnableUser:
            case UserAdminAction.DisableUser:
                return(new
                {
                    CDSId
                });

            case UserAdminAction.AddProgramme:
                return(new
                {
                    CDSId,
                    ProgrammeId,
                    CanEditProgramme
                });

            case UserAdminAction.RemoveProgramme:
                return(new
                {
                    CDSId,
                    ProgrammeId
                });

            case UserAdminAction.ManageProgrammes:
                return(new
                {
                    CDSId,
                    ProgrammeId
                });

            case UserAdminAction.AddUser:
                return(new
                {
                    CDSId,
                    FullName,
                    IsAdmin = IsAdmin.GetValueOrDefault(),
                    Mail
                });

            case UserAdminAction.SetAsAdministrator:
            case UserAdminAction.UnsetAsAdministrator:
                return(new
                {
                    CDSId
                });
            }

            return(new { CDSId, FullName, ProgrammeId, IsAdmin = IsAdmin.GetValueOrDefault() });
        }