//Recupera el ultimo Id de Orden registrada (usado en el metodo "insertar(Orden)")
        private static string getUltimoIdDeOrden()
        {
            string        consulta = "select top 1 id from OrdenesDeTrabajo order by id desc";
            SqlDataReader reader   = ConexionBd.ejecConsulta(consulta);

            reader.Read();
            string id = reader["id"].ToString();

            reader.Close();
            return(id);
        }
Esempio n. 2
0
        //Logeo al sistema
        public bool login(string password)
        {
            string consulta = String.Format("Select tipo,contra from Usuarios where " +
                                            "tipo = 1 and contra = '{0}'", password);
            SqlDataReader reader = ConexionBd.ejecConsulta(consulta);

            if (reader.HasRows)
            {
                reader.Read();
                permiso = true;
                reader.Close();
                return(true);
            }
            else
            {
                reader.Close();
                return(false);
            }
        }