예제 #1
0
        public void ObtenerDatosDeEspecialista(int opcion, CEspecialista EspecialistaIngregsado)
        {
            DataSet       datLoggerUserInformation = new DataSet();
            CEspecialista objAuthenticatedUser     = new CEspecialista();
            bool          ExisteUsuario            = false;

            if (ExisteConexion())
            {
                ExisteUsuario = objAuthenticatedUser.ValidarUsuario(opcion, ref datLoggerUserInformation, EspecialistaIngregsado);
                if (ExisteUsuario)
                {
                    try
                    {
                        objAuthenticatedUser.pk_Especialista    = datLoggerUserInformation.Tables[0].Rows[0][0].ToString();
                        objAuthenticatedUser.Activo             = datLoggerUserInformation.Tables[0].Rows[0][1].ToString();
                        objAuthenticatedUser.Cedula             = datLoggerUserInformation.Tables[0].Rows[0][2].ToString();
                        objAuthenticatedUser.Numero_Control     = datLoggerUserInformation.Tables[0].Rows[0][3].ToString();
                        objAuthenticatedUser.Nombre             = datLoggerUserInformation.Tables[0].Rows[0][5].ToString();
                        objAuthenticatedUser.Apellido           = datLoggerUserInformation.Tables[0].Rows[0][6].ToString();
                        objAuthenticatedUser.FechaNacimiento    = datLoggerUserInformation.Tables[0].Rows[0][7].ToString();
                        objAuthenticatedUser.Genero             = datLoggerUserInformation.Tables[0].Rows[0][8].ToString();
                        objAuthenticatedUser.Direccion          = datLoggerUserInformation.Tables[0].Rows[0][9].ToString();
                        objAuthenticatedUser.Correo             = datLoggerUserInformation.Tables[0].Rows[0][10].ToString();
                        objAuthenticatedUser.Telefono           = datLoggerUserInformation.Tables[0].Rows[0][11].ToString();
                        objAuthenticatedUser.fk_Especialidad    = datLoggerUserInformation.Tables[0].Rows[0][12].ToString();
                        objAuthenticatedUser.Rol                = Convert.ToInt32(datLoggerUserInformation.Tables[0].Rows[0][13].ToString());
                        objAuthenticatedUser.Especialidad_texto = datLoggerUserInformation.Tables[0].Rows[0][15].ToString();

                        ViewEspecialista.UsuarioLogeadoEspecialista = objAuthenticatedUser;
                    }
                    catch (Exception)
                    {
                        ViewEspecialista.UsuarioLogeadoEspecialista = null;
                    }
                }
                else
                {
                    ViewEspecialista.Mensaje("No valido", 2);
                }
            }
            else
            {
                ViewEspecialista.Mensaje("No hay conexion en red", 2);
            }
        }