Ejemplo n.º 1
0
        internal static PreservationUser Convert(this BibDSModel.PreservationUser usr, int level = 0, int deeplevel = 5)
        {
            if (usr == null || level > deeplevel)
            {
                return(null);
            }

            var retval = new PreservationUser
            {
                IdPreservationUser = usr.IdPreservationUser,
                Address            = usr.Address,
                DomainUser         = usr.DomainUser,
                EMail    = usr.Email,
                Enabled  = usr.Enable,
                FiscalId = usr.FiscalId,
                Name     = usr.Name,
                Surname  = usr.Surname,
            };


            retval.UserRoles = usr.PreservationUserRole.Convert(level + 1, deeplevel);
            return(retval);
        }
Ejemplo n.º 2
0
        internal static BibDSModel.PreservationUser Convert(this PreservationUser usr, BibDSModel.BiblosDS2010Entities db, BibDSModel.PreservationUser original = null, int level = 0, int deeplevel = 5)
        {
            if (usr == null || level > deeplevel)
            {
                return(null);
            }

            var retval = (original == null) ? new BibDSModel.PreservationUser() : original;

            retval.Address              = usr.Address;
            retval.DomainUser           = usr.DomainUser;
            retval.Email                = usr.EMail;
            retval.Enable               = usr.Enabled;
            retval.FiscalId             = usr.FiscalId;
            retval.Name                 = usr.Name;
            retval.Surname              = usr.Surname;
            retval.PreservationUserRole = usr.UserRoles.Convert(db, null, level, deeplevel);

            return(retval);
        }