예제 #1
0
        public int ObtenerUltimoId()
        {
            Conexion repo     = new Conexion();
            string   consulta = "select (max(codigo) +1) from tarea Where Codigo < 1000";
            string   valor    = repo.TraerUltimoId(consulta);

            return(int.Parse(valor));
        }
예제 #2
0
        public int ObtenerUltimoId()
        {
            Conexion repo     = new Conexion();
            string   consulta = "select max(codigo) + 1 from curso";
            int      valor    = int.Parse(repo.TraerUltimoId(consulta));

            return(valor);
        }
예제 #3
0
        public int CantidadLegajo(int WCodigo, int WVersion)
        {
            Conexion repo     = new Conexion();
            string   consulta = "select COUNT (Renglon) from legajo where Codigo = " + WCodigo + " and version = " + WVersion;
            int      valor    = int.Parse(repo.TraerUltimoId(consulta));

            return(valor);
        }
예제 #4
0
        public int ObtenerUltimo(string tema)
        {
            Conexion repo     = new Conexion();
            string   consulta = "select max(tema) + 1 from Tema where Tema < 99 And curso =  " + tema;
            //string consulta = "select max(tema) + 1 from Tema where tema != 86";
            int valor = 0;

            int.TryParse(repo.TraerUltimoId(consulta), out valor);
            return(valor);
        }