예제 #1
0
        public static int obtenerCantidadProducto(string nombre_producto)
        {
            int x  = 0;
            var db = new InmodbDB("Inmodb");
            var id = db.Fetch <int>("SELECT COUNT(*) FROM producto WHERE producto.nombre_producto = @0", nombre_producto);

            try
            {
                x = id.First();
            }
            catch (Exception ex)
            {
                messageError = ex.Message;
                x            = 0;
            }
            return(x);
        }
예제 #2
0
        public static int ObtenerUltimoCorrelativo(int prefijo)
        {
            int x  = 0;
            var db = new InmodbDB("Inmodb");
            var id = db.Fetch <int>("SELECT COUNT(*) FROM concaja WHERE concaja.prefijo = @0", prefijo);

            try
            {
                x = id.First();
            }
            catch (Exception ex)
            {
                messageError = ex.Message;
                x            = 0;
            }
            return(x);
        }