Exemplo n.º 1
0
        public object GetUsuarioRol(long unidUser)
        {
            this._userRolDataMapper = new AppUsuarioRol();
            object element = this._userRolDataMapper.getElementByUserRol(unidUser);

            return(element);
        }
Exemplo n.º 2
0
 public UsuarioModel(IDataMapper dataMapper)
 {
     if ((dataMapper as AppUsuario) != null)
     {
         this._dataMapper        = dataMapper as AppUsuario;
         this._userRolDataMapper = dataMapper as AppUsuarioRol;
     }
 }
Exemplo n.º 3
0
        public object GetRolMenu(long unidRol)
        {
            this._userRolDataMapper = new AppUsuarioRol();

            object element = this._userRolDataMapper.getElementByRolMenu(unidRol);

            return(element);
        }
Exemplo n.º 4
0
        public void insertUsuarioRol(long unidRol, long unidUser)
        {
            this._userRolDataMapper = new AppUsuarioRol();

            if (_dataMapper != null)
            {
                this._userRolDataMapper.udpateUsuarioRol(new USUARIO_ROL()
                {
                    UNID_USUARIO = unidUser, UNID_ROL = unidRol
                });
            }
        }
Exemplo n.º 5
0
        public void insertRolMenu(long unidRol, long unidMenu)
        {
            this._userRolDataMapper = new AppUsuarioRol();

            if (_dataMapper != null)
            {
                this._userRolDataMapper.udpateRolMenu(new ROL_MENU()
                {
                    UNID_MENU = unidMenu, UNID_ROL = unidRol
                });
            }
        }
Exemplo n.º 6
0
        public void DeleteRelationUsuarioRol(long unidRol, long unidUser)
        {
            this._userRolDataMapper = new AppUsuarioRol();

            if (_dataMapper != null)
            {
                this._userRolDataMapper.deleteElement(new USUARIO_ROL()
                {
                    UNID_USUARIO = unidUser, UNID_ROL = unidRol
                }, new USUARIO());
            }
        }
Exemplo n.º 7
0
        public string downloadUsuarioRol(long?lastModifiedDate)
        {
            string respuesta = null;

            if (lastModifiedDate != null)
            {
                AppUsuarioRol dataMapper = new AppUsuarioRol();

                respuesta = dataMapper.GetJsonUsuarioRol(lastModifiedDate);

                if (String.IsNullOrEmpty(respuesta))
                {
                    respuesta = null;
                }
            }
            return(respuesta);
        }
Exemplo n.º 8
0
        public void modifyRol()
        {
            AppRolDataMapper     RolDM         = new AppRolDataMapper();
            AppUsuarioRol        Rol_UsuarioDM = new AppUsuarioRol();
            AppRolMenuDataMapper Rol_MenuDM    = new AppRolMenuDataMapper();
            AppMenuDataMapper    MenuDM        = new AppMenuDataMapper();

            Rol_UsuarioDM.deleteElementsByRol(this.UnidRol);
            Rol_MenuDM.deleteElementsByRol(this.UnidRol);

            ROL rrr = new ROL();

            rrr.IS_ACTIVE      = true;
            rrr.IS_MODIFIED    = true;
            rrr.IS_SYSTEM_ROOL = this.IsSystemRol;
            rrr.RECIBIR_MAILS  = this.RecibirMails;
            rrr.ROL_NAME       = this.Name;
            rrr.UNID_ROL       = UnidRol;
            RolDM.udpateElement(rrr, this.ActualUser);

            foreach (User u in UsuariosCollection)
            {
                USUARIO_ROL ur = new USUARIO_ROL();
                ur.UNID_ROL     = this.UnidRol;
                ur.UNID_USUARIO = u.UnidUser;
                Rol_UsuarioDM.upsertElement(ur);
            }

            foreach (Menu minim in MenuCollection)
            {
                MENU mm = new MENU();
                mm.MENU_NAME = minim.MenuName;
                mm           = (MENU)MenuDM.getElementByName(mm);

                ROL_MENU rm = new ROL_MENU();
                rm.UNID_MENU = mm.UNID_MENU;
                rm.UNID_ROL  = this.UnidRol;
                Rol_MenuDM.upsertElement(rm);
            }
        }
Exemplo n.º 9
0
        public void saveRol()
        {
            AppRolDataMapper     rolDM = new AppRolDataMapper();
            AppUsuarioRol        ar    = new AppUsuarioRol();
            AppRolMenuDataMapper am    = new AppRolMenuDataMapper();
            AppMenuDataMapper    menu  = new AppMenuDataMapper();

            ROL rrr = new ROL();

            rrr.IS_ACTIVE      = true;
            rrr.IS_MODIFIED    = true;
            rrr.IS_SYSTEM_ROOL = this.IsSystemRol;
            rrr.RECIBIR_MAILS  = this.RecibirMails;
            rrr.ROL_NAME       = this.Name;
            this.UnidRol       = UNID.getNewUNID();
            rrr.UNID_ROL       = UnidRol;
            rolDM.insertElement(rrr, this.ActualUser);

            foreach (User u in UsuariosCollection)
            {
                USUARIO_ROL ur = new USUARIO_ROL();
                ur.UNID_ROL     = this.UnidRol;
                ur.UNID_USUARIO = u.UnidUser;
                ar.insertElement(ur);
            }

            foreach (Menu minim in MenuCollection)
            {
                MENU mm = new MENU();
                mm.MENU_NAME = minim.MenuName;
                mm           = (MENU)menu.getElementByName(mm);

                ROL_MENU rm = new ROL_MENU();
                rm.UNID_MENU = mm.UNID_MENU;
                rm.UNID_ROL  = this.UnidRol;
                am.insertElement(rm);
            }
        }
Exemplo n.º 10
0
 public UsuarioModel()
 {
     this._dataMapper        = new AppUsuario();
     this._userRolDataMapper = new AppUsuarioRol();
 }