Exemplo n.º 1
0
        // - - - - - retorna DSKTUSERS por usuario y password
        public static DSKTUSERS LoginDsktUser(String user, String pass)
        {
            String           hello      = Publica.getHashString(pass);
            DSKTUSERS        retu       = null;
            List <DSKTUSERS> _entidades = (from e in DBAccess.ORM.dbe.DSKTUSERS
                                           where e.nickname.Equals(user) && e.password.Equals(hello)
                                           select e
                                           ).ToList();

            if (_entidades != null && _entidades.Count > 0)
            {
                retu = _entidades[0];
            }
            return(retu);
        }
Exemplo n.º 2
0
        // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - DATOS FORM a ENTIDAD
        private DSKTUSERS asignDataFormToEntity()
        {
            int       aux;
            DSKTUSERS entidad;

            if ((int.TryParse(textBoxId.Text, out aux)) && (int.Parse(textBoxId.Text) > 0))
            {
                entidad = (DSKTUSERS)listBoxLista.SelectedItem;
                isNew   = false;
            }
            else
            {
                entidad = generateEmptyEntity();
                isNew   = true;
            }
            if (checkBoxActivado.Checked == true)
            {
                entidad.estado = 1;
            }
            else
            {
                entidad.estado = 0;
            }
            entidad.nickname = textBoxUsuario.Text;
            if (controlPswrd)
            {
                entidad.password = Publica.getHashString(textBoxClave.Text); controlPswrd = false;
            }
            entidad.nombre       = textBoxNombre.Text;
            entidad.email        = textBoxEmail.Text;
            entidad.idccaa       = ((CCAA)comboBoxComunidad.SelectedItem).id;
            entidad.idprovincia  = ((PROVINCIAS)comboBoxProvincia.SelectedItem).id;
            entidad.iddelegacion = ((DELEGACIONES)comboBoxDelegacion.SelectedItem).id;
            entidad.ctrlmaster   = 0;
            if (checkBoxMaster.Checked == true)
            {
                entidad.ctrlmaster = 1;
            }
            else
            {
                entidad.ctrlmaster = 0;
            }
            return(entidad);
        }