Exemple #1
0
        public Medicion MedirEspacioLineas(Letra letra)
        {
            Font  f      = _letras.Obtener(letra);
            float factor = f.SizeInPoints / (float)f.FontFamily.GetEmHeight(f.Style);

            return(new Medicion(f.FontFamily.GetLineSpacing(f.Style) * factor, Unidad.Puntos));
        }
        public void JugarLetra(char letra)
        {
            EstadoJuego estado = m_juego.Estado;

            if (estado == EstadoJuego.Jugando)
            {
                Letra letraJugada = new Letra(letra);
                bool  letraUsada  = m_juego.LetraUtilizada(letraJugada);

                if (letraUsada)
                {
                    m_ctlAhorcado.EtiquetarMensaje("Letra Ya Jugada");
                }
                else if (!(m_juego.JugarLetra(letraJugada)) && !letraUsada)
                {
                    m_ctlAhorcado.EtiquetarMensaje("Incorrecto");
                }
                else
                {
                    m_ctlAhorcado.EtiquetarMensaje(String.Empty);
                }

                m_ctlAhorcado.Actualizar();
            }
        }
Exemple #3
0
        public Medicion MedirBaseTexto(Letra letra)
        {
            Font  f      = _letras.Obtener(letra);
            float factor = f.SizeInPoints / (float)f.FontFamily.GetEmHeight(f.Style);

            return(new Medicion(f.FontFamily.GetCellDescent(f.Style) * factor, Unidad.Puntos));
        }
Exemple #4
0
        public ActionResult DeleteConfirmed(int id)
        {
            Letra letra = db.Letras.Find(id);

            db.Letras.Remove(letra);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #5
0
 private void InsertKey(Letra letra)
 {
     if (letra.Valor_Letra == correct_key)
     {
         key_is_correct = true;
         Debug.Log("Key is correta");
         PuzzleManager.Instance.CheckPuzzleLetras();
     }
 }
 public bool Guardar(Letra entity)
 {
     try{
         context.Add(entity);
         context.SaveChanges();
     }catch (System.Exception) {
         return(false);
     }
     return(true);
 }
Exemple #7
0
        public void DibujarTexto(Punto posicion, Letra letra, Brocha brocha, string texto)
        {
            Font  f = _letras.Obtener(letra);
            Brush b = _brochas.Obtener(brocha);

            //StringFormat st = new StringFormat(StringFormat.GenericTypographic);
            //st.SetMeasurableCharacterRanges(new CharacterRange[]{new CharacterRange(0, texto.Length)});
            //Region[] regs = g.MeasureCharacterRanges(texto, f, new RectangleF(Traducir(posicion), new SizeF(g.DpiX * 100, g.DpiY * 100)),st);
            g.DrawString(texto, f, b, Traducir(posicion), FormatoPresentacion);
        }
Exemple #8
0
        private static Letra LoadLetra(IDataReader dr)
        {
            var letra = new Letra
            {
                id     = GetDataValue <int>(dr, "id_letra"),
                Nombre = GetDataValue <string>(dr, "nombre_letra"),
            };


            return(letra);
        }
Exemple #9
0
        public Estilo(Bloque bloque)
        {
            //Debug.Assert(bloque != null);
            Debug.Assert(bloque.Formato != null);
            Formato f = bloque.Formato;

            ColorFondo = new BrochaSolida(f.ObtenerColorFondo());
            ColorLetra = new BrochaSolida(f.ObtenerColorLetra());
            Letra      = Letra.Crear(f.FamiliaLetra, f.ObtenerTamLetraEscalado(),
                                     f.ObtenerNegrilla(), f.ObtenerCursiva(), f.ObtenerSubrayado());
        }
Exemple #10
0
        private Letra GetAnyButThis(Letra letra)
        {
            Letra lt2 = null;

            while (lt2 == null || lt2 == letra)
            {
                int idx1 = rnd.Next(0, Preguntas.Count - 1);
                lt2 = Preguntas[idx1];
            }
            return(lt2);
        }
Exemple #11
0
 public ActionResult Edit([Bind(Include = "Pk_Letra,Titulo,Genero,Publicada,Fk_Compositor")] Letra letra)
 {
     if (ModelState.IsValid)
     {
         db.Entry(letra).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Fk_Compositor = new SelectList(db.Compositors, "Pk_Compositor", "Nome", letra.Fk_Compositor);
     return(View(letra));
 }
Exemple #12
0
 public Medicion MedirUnion(Letra letra, string a, string b)
 {
     if (a.Length > 0 && b.Length > 0)
     {
         TamBloque t1 = MedirTexto(letra, a[a.Length - 1].ToString() + b[0]);
         TamBloque t2 = MedirTexto(letra, a[a.Length - 1].ToString());
         TamBloque t3 = MedirTexto(letra, b[0].ToString());
         //return t1.Ancho-(t2.Ancho + t3.Ancho);
         return(t1.Ancho - (t2.Ancho + t3.Ancho));
     }
     return(Medicion.Cero);
 }
 public bool Delete(int id)
 {
     try
     {
         Letra letra = Get(id);
         context.Letras.Remove(letra);
         context.SaveChanges();
     }
     catch (Exception)
     {
         return(false);
     }
     return(true);
 }
Exemple #14
0
        // GET: Letras/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Letra letra = db.Letras.Find(id);

            if (letra == null)
            {
                return(HttpNotFound());
            }
            return(View(letra));
        }
        public Letra Get(int id)
        {
            var result = new Letra();

            try
            {
                result = context.Letras.Single(x => x.Id == id);
            }
            catch (Exception)
            {
                throw;
            }
            return(result);
        }
Exemple #16
0
        // GET: Letras/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Letra letra = db.Letras.Find(id);

            if (letra == null)
            {
                return(HttpNotFound());
            }
            ViewBag.Fk_Compositor = new SelectList(db.Compositors, "Pk_Compositor", "Nome", letra.Fk_Compositor);
            return(View(letra));
        }
Exemple #17
0
    void CleanupPositions()
    {
        //foreach(LetterPosition lp in positions)
        for (int i = 0; i < positions.Length; i++)

        {
            LetterPosition lp = positions[i];

            Letra l = lp.transform.GetComponentInChildren <Letra> ();

            if (l)
            {
                Destroy(l.gameObject);
            }
        }
    }
Exemple #18
0
        public TamBloque MedirTexto(Letra letra, string texto)
        {
            Font f = _letras.Obtener(letra);

            //RectangleF c=new RectangleF(0,0,1000000,1000000);
            //Region[] regs=g.MeasureCharacterRanges(texto, f, c, FormatoMedicion);
            //Region r = regs[0].GetBounds(g);
            if (texto.Length == 0)
            {
                SizeF tam2 = g.MeasureString("M", f, new PointF(0, 0), FormatoMedicion);
                tam2.Width = 0;
                return(Traducir(tam2));
            }
            SizeF tam = g.MeasureString(texto, f, new PointF(0, 0), FormatoMedicion);

            return(Traducir(tam));
        }
Exemple #19
0
 public int InsertarLetrasP(Letra item)
 {
     lock (locker)
     {
         if (GetLetrasPExists(item.IdLeccion, item.Numero) == true)
         {
             //Update Item
             database.Update(item);
             return(item.IdLeccion);
         }
         else
         {
             //Insert item
             return(database.Insert(item));
         }
     }
 }
Exemple #20
0
        private void SeleccionaSiguienteTest()
        {
            var lt1 = GetAnyButThis(this.PreguntaActual);
            var lt2 = GetAnyButThis(this.PreguntaActual);
            var lt3 = this.PreguntaActual;
            //set them randomly
            var all = new List <Letra>();

            all.Add(lt1);
            all.Add(lt2);
            all.Add(lt3);
            //assign them
            Letra1 = all[rnd.Next(0, 3)];
            all.Remove(Letra1);
            Letra2 = all[rnd.Next(0, 2)];
            all.Remove(Letra2);
            Letra3 = all.First();
            all.Clear();
        }
        public bool Update(Letra entity)
        {
            try
            {
                var originalLetra = context.Letras.Single(
                    letra => letra.Id == entity.Id
                    );

                originalLetra.Denominacion       = entity.Denominacion;
                originalLetra.LugarGiro          = entity.LugarGiro;
                originalLetra.FechaGiro          = entity.FechaGiro;
                originalLetra.ValorNominal       = entity.ValorNominal;
                originalLetra.NombreGirado       = entity.NombreGirado;
                originalLetra.DniGirado          = entity.DniGirado;
                originalLetra.NombreBeneficiario = entity.NombreBeneficiario;
                originalLetra.NombreGirador      = entity.NombreGirador;
                originalLetra.DniGirador         = entity.DniGirador;
                originalLetra.FirmaGirador       = entity.FirmaGirador;
                originalLetra.FechaVencimiento   = entity.FechaVencimiento;
                originalLetra.LugarPago          = entity.LugarPago;
                originalLetra.Retencion          = entity.Retencion;
                originalLetra.UserId             = entity.UserId;

                /*
                 * foreach (var item in entity.Gastos) {
                 *  Gasto gasto = new Gasto {
                 *      Nombre = item.Nombre,
                 *      Tipo = item.Tipo,
                 *      Valor = item.Valor,
                 *      LetraId = entity.Id
                 *  };
                 *  originalLetra.Gastos = gasto;
                 * }*/

                context.Update(originalLetra);
                context.SaveChanges();
            }
            catch (Exception)
            {
                return(false);
            }
            return(true);
        }
        /*
         * public bool Save(Letra entity)
         * {
         *  try
         *  {
         *      context.Add(entity);
         *      context.SaveChanges();
         *  }
         *  catch (Exception)
         *  {
         *      return false;
         *  }
         *  return true;
         * }
         */
        public bool Save(Letra entity)
        {
            Letra letra = new Letra {
                Denominacion       = entity.Denominacion,
                LugarGiro          = entity.LugarGiro,
                FechaGiro          = entity.FechaGiro,
                ValorNominal       = entity.ValorNominal,
                NombreGirado       = entity.NombreGirado,
                DniGirado          = entity.DniGirado,
                NombreBeneficiario = entity.NombreBeneficiario,
                NombreGirador      = entity.NombreGirador,
                DniGirador         = entity.DniGirador,
                FirmaGirador       = entity.FirmaGirador,
                FechaVencimiento   = entity.FechaVencimiento,
                LugarPago          = entity.LugarPago,
                Retencion          = entity.Retencion,
                UserId             = entity.UserId,
            };

            try {
                context.Letras.Add(letra);
                context.SaveChanges();
                var letraId = letra.Id;
                foreach (var item in entity.Gastos)
                {
                    Gasto gasto = new Gasto {
                        Nombre  = item.Nombre,
                        Tipo    = item.Tipo,
                        Valor   = item.Valor,
                        LetraId = letraId
                    };
                    context.Gastos.Add(gasto);
                }
                context.SaveChanges();
            } catch (Exception ex) {
                return(false);
            }
            return(true);
        }
Exemple #23
0
        public ActionResult Create([Bind(Include = "PK_Publicacao,Data,Fk_Letra")] Publicacao publicacao)
        {
            if (ModelState.IsValid)
            {
                Letra letra = db.Letras.Find(publicacao.Fk_Letra);
                publicacao.Letra = letra;
                if (publicacao.validaPublicacao())
                {
                    db.Publicacaos.Add(publicacao);
                    db.SaveChanges();
                    letra.Publicada       = true;
                    db.Entry(letra).State = EntityState.Modified;
                    db.SaveChanges();
                    return(RedirectToAction("Index"));

                    return(RedirectToAction("Index"));
                }
            }

            ViewBag.Fk_Letra = new SelectList(db.Letras, "Pk_Letra", "Titulo", publicacao.Fk_Letra);
            return(View(publicacao));
        }
    private String NombrarArchivo()
    {
        String Retorno = "";

        try
        {
            Random Ran            = new Random();
            String Posibles       = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
            int    LongitudMaxima = Posibles.Length;
            char   Letra;
            int    LongitudNuevaCadena = 20;
            for (int i = 0; i < LongitudNuevaCadena; i++)
            {
                Letra    = Posibles[Ran.Next(LongitudMaxima)];
                Retorno += Letra.ToString();
            }
        }
        catch
        {
            Retorno = "";
        }
        return(Retorno);
    }
Exemple #25
0
    void CheckDestroyedLetters()
    {
        if (builtWord.Count > 0)
        {
            //foreach(GameObject g in builtWord)
            for (int i = 0; i < builtWord.Count; i++)
            {
                GameObject g = builtWord[i];

                if (g)
                {
                    Letra l = g.GetComponent <Letra>();

                    if (l)
                    {
                        if (l.IsDestroyed)
                        {
                            builtWord.Remove(g.gameObject);


                            if (l.IsCorrect() && myWordType == WordType.misspelledSingle)
                            {
                                SetWordWrong();
                            }

                            Destroy(g.gameObject);
                        }
                    }
                }
            }
        }

        if (builtWord.Count <= 0)
        {
        }
    }
Exemple #26
0
 public ActionResult Post([FromBody] Letra letra)
 {
     return(Ok(letraService.Guardar(letra)));
 }
Exemple #27
0
        /// <summary>
        /// Enqueue a line segment
        /// </summary>
        /// <param name="pos">Position of the line segment</param>
        /// <param name="duration">Duration the line segment should take to become the full length</param>
        /// <returns>True if enqueued, false if not</returns>
        public bool Enqueue(Vector3 pos, float duration)
        {
            bool cerrarGrafo = false;
            bool pintar      = true;
            int  ultimo      = -1;

            for (int i = 0; i < alLetras.Count; i++)
            {
                Letra l = alLetras[i];


                if (Math.Abs(l.posicion.x - (pos.x)) < 1 && Math.Abs(l.posicion.y - (pos.y)) < 1)
                {
                    cerrarGrafo = true;
                    pos         = alLetras[i].posicion;


                    if ((lastLetra) >= 0)
                    {
                        //print(lastLetra);
                        print(alLetras[lastLetra].letra + " -> " + alLetras[i].letra);

                        if (alLetras[lastLetra].letra != alLetras[i].letra)
                        {
                            if (!alLetras[lastLetra].alLetrasRelaciones.Contains(alLetras[i]))
                            {
                                alLetras[lastLetra].alLetrasRelaciones.Add(alLetras[i]);
                            }
                            if (!alLetras[i].alLetrasRelaciones.Contains(alLetras[lastLetra]))
                            {
                                alLetras[i].alLetrasRelaciones.Add(alLetras[lastLetra]);
                            }
                        }


                        if (!hmRelaciones.Contains(alLetras[lastLetra].letra + "" + alLetras[i].letra) && !hmRelaciones.Contains(alLetras[i].letra + "" + alLetras[lastLetra].letra))
                        {
                            hmRelaciones.Add(alLetras[lastLetra].letra + "" + alLetras[i].letra);
                        }
                        else
                        {
                            print("Ya esta2");
                            pos = alLetras[i].posicion;

                            ultimo = i;
                            //return false;
                        }
                        //print(alLetras[i].letra);
                    }



                    /*
                     *
                     *  for (int j = 0; j < alLetras.Count; j++)
                     *  {
                     *      if(alLetras[j].letra == alLetras[i].letra   && (lastLetra >= 0 && alLetras[j].letra != alLetras[lastLetra].letra) )
                     *      {
                     *          print(l.letra);
                     *          print(alLetras[j].letra);
                     *          if (lastLetra >= 0)
                     *          {
                     *              print(alLetras[lastLetra].letra);
                     *              pintar = false;
                     *              //EndPoint = alLetras[j].posicion;
                     *              return pintar;
                     *          }
                     *      }
                     *  }
                     *
                     *  lastLetra = i;
                     *
                     */
                    lastLetra = i;
                }


                for (int h = 0; h < alLetras.Count; h++)
                {
                    alLetras[h].txtLetra.color = Color.black;

                    Color color = new Color();
                    ColorUtility.TryParseHtmlString("#0000B4", out color);
                    alLetras[h].txtLetraPunto.color = color;
                }

                if (cerrarGrafo)
                {
                    l.txtLetraPunto.color = Color.green;
                    break;
                }
            }



            /*
             *
             * if (true)
             * {
             *  return false;
             * }
             */

            if (Resetting)
            {
                return(false);
            }
            else if (MinimumDistance > 0.0f && lastQueued != null)
            {
                Vector3 prevPos  = lastQueued.Value.Position;
                float   distance = Vector3.Distance(prevPos, pos);

                if (distance < MinimumDistance)
                {
                    return(false);
                }
                else
                {
                    // Debug.LogFormat("Distance between {0} and {1}: {2}", prevPos, pos, distance);
                }
            }

            float     durationSeconds = Mathf.Max(0.0f, duration);
            QueueItem item            = new QueueItem
            {
                Position            = pos,
                TotalSecondsInverse = (durationSeconds == 0.0f ? 0.0f : 1.0f / durationSeconds),
                TotalSeconds        = durationSeconds,
                ElapsedSeconds      = 0.0f
            };

            queue.Enqueue(item);
            lastQueued = item;

            if (!cerrarGrafo)
            {
                crearPivote(sigLetra++, pos);

                if (lastLetra >= 0)
                {
                    print(alLetras[lastLetra].letra + " -> " + alLetras[alLetras.Count - 1].letra);

                    if (alLetras[lastLetra].letra != alLetras[alLetras.Count - 1].letra)
                    {
                        if (!alLetras[lastLetra].alLetrasRelaciones.Contains(alLetras[alLetras.Count - 1]))
                        {
                            alLetras[lastLetra].alLetrasRelaciones.Add(alLetras[alLetras.Count - 1]);
                        }
                        if (!alLetras[alLetras.Count - 1].alLetrasRelaciones.Contains(alLetras[lastLetra]))
                        {
                            alLetras[alLetras.Count - 1].alLetrasRelaciones.Add(alLetras[lastLetra]);
                        }
                    }

                    if (!hmRelaciones.Contains(alLetras[lastLetra].letra + "" + alLetras[alLetras.Count - 1].letra) && !hmRelaciones.Contains(alLetras[alLetras.Count - 1].letra + "" + alLetras[lastLetra].letra))
                    {
                        hmRelaciones.Add(alLetras[lastLetra].letra + "" + alLetras[alLetras.Count - 1].letra);
                    }
                    else
                    {
                        print("Ya esta");
                        //return false;
                    }
                }



                lastLetra = alLetras.Count - 1;
            }


            return(true);
        }
Exemple #28
0
        private void crearPivote(int indice, Vector3 p)
        {
            if (p.x < minX)
            {
                minX = p.x;
            }
            if (p.x > maxX)
            {
                maxX = p.x;
            }
            if (p.y < minY)
            {
                minY = p.y;
            }
            if (p.y > maxY)
            {
                maxY = p.y;
            }


            Letra  l     = new Letra();
            String letra = "v";

            if (indice > 0)
            {
                letra = Number2String(indice, false);
            }


            /* Dibujar Letra*/
            GameObject UItextGO = new GameObject(letra);

            UItextGO.transform.SetParent(this.transform);

            RectTransform trans = UItextGO.AddComponent <RectTransform>();

            trans.anchoredPosition = new Vector2(p.x - 0.1f, p.y + 0.3f);

            //Text text = UItextGO.AddComponent<Text>();

            // TextMesh textMesh = new TextMesh();
            TextMesh text = UItextGO.AddComponent <TextMesh>();


            text.text          = letra;
            text.font          = Resources.GetBuiltinResource(typeof(Font), "Arial.ttf") as Font;
            text.fontSize      = 28;
            text.characterSize = 0.33f;
            text.anchor        = TextAnchor.LowerRight;
            text.color         = Color.black;

            alTxtLetras.Add(UItextGO);

            l.txtLetra = text;

            /* Dibujar Punto*/
            UItextGO = new GameObject(letra + "-O");
            UItextGO.transform.SetParent(this.transform);

            trans = UItextGO.AddComponent <RectTransform>();
            trans.anchoredPosition = new Vector2(p.x, p.y);

            //Text text = UItextGO.AddComponent<Text>();

            // TextMesh textMesh = new TextMesh();
            text = UItextGO.AddComponent <TextMesh>();


            text.text          = "●";
            text.font          = Resources.GetBuiltinResource(typeof(Font), "Arial.ttf") as Font;
            text.fontSize      = 50;
            text.characterSize = 0.33f;
            text.anchor        = TextAnchor.MiddleCenter;
            text.fontStyle     = FontStyle.Bold;

            Color color = new Color();

            ColorUtility.TryParseHtmlString("#0000B4", out color);
            text.color = color;

            alTxtLetrasPunto.Add(UItextGO);


            l.txtLetraPunto = text;

            l.letra              = letra;
            l.posicion           = p;
            l.alLetrasRelaciones = new List <Letra>();
            l.alLineas           = new List <LineRenderer>();
            alLetras.Add(l);


            //l.txtLetra.color = Color.green;
            l.txtLetraPunto.color = Color.green;
        }
Exemple #29
0
 public Nodo(Letra letra)
 {
     this.letra = letra;
     derecho    = null;
     izquierdo  = null;
 }
        //Carnet Nuevo
        public string NuevoCarnet()
        {
            //VARIABLES
            string vlc_CarnetNuevo = string.Empty, vlc_AnioActual = string.Empty, vlc_Prefijo = string.Empty, vlc_sentencia = string.Empty, consecut = string.Empty;
            int    Consecutivo;
            char   Letra;

            //SE EXTRAE EL AÑO DE LA FECHA ACTUAL.
            vlc_AnioActual = DateTime.Now.Year.ToString();
            //SE EXTRAE EL PENULTIMO VALOR DEL AÑO.
            vlc_Prefijo += vlc_AnioActual[2];
            //SE CONVIERTE ESTE VALOR EN UN SU VALOR ASCCI QUE SE HACE SUMANDOLE 65 AL PENULTIMO NÚMERO DEL AÑO Y S EGUARDA EN LA VARIABLE LETRA..
            Letra = (char)(int.Parse(vlc_Prefijo) + 65);
            //SE LIMPIA EL VALOR DEL STRING.
            vlc_Prefijo = string.Empty;
            //SE GUARDA LA LETRA YA CONVERTIDA EN EL STRING.
            vlc_Prefijo = Letra.ToString();
            //SE LE CONCATENA EL ULTIMO DIGITO DEL AÑO.
            vlc_Prefijo += vlc_AnioActual[3];
            //SE ESTABLECE LAS VARIABLES DEL CLIENTE SQL.
            SqlCommand    vlo_Command  = new SqlCommand();
            SqlConnection vlo_Conexion = new SqlConnection(vgc_CadenaConexion);

            //SE ESTABLECE LA CONEXION CON LA BASE DE DATOS
            vlo_Command.Connection = vlo_Conexion;
            // SE ESTABLECE LA SENTENCIA LA CUAL VERIFICA LA CANTIDA DE CON ESE PREFIJO DE CARNET.
            vlc_sentencia = string.Format("select COUNT(CARNET) from ESTUDIANTES where CARNET like '%{0}%'", vlc_Prefijo);
            try
            {
                //SE ABRE LA CONEXION
                vlo_Conexion.Open();
                vlo_Command.CommandText = vlc_sentencia;

                // SE VERIFICA QUE SI LA CANTIDAD DE REGISTRO CON ESE PREFIJO ES CERO.
                if (Convert.ToInt32(vlo_Command.ExecuteScalar()) == 0)
                {
                    //SI ES CERO SE GUARDA EL CARNE CON EL PREFIJO Y SE CONCATENA QUE ES EL PRIMER REGISTRO.
                    vlc_CarnetNuevo = vlc_Prefijo + "0001";
                }
                else
                {
                    // DE CASO CONTRARIO SE BUSCA EL MAXIMO VALORCON ESE PREFIJO Y VALOR NÚMERO CO MAYOR.
                    vlc_sentencia           = string.Format("select max(CONVERT(int,SUBSTRING(CARNET,3,LEN(CARNET)))) from ESTUDIANTES where CARNET like '%{0}%'", vlc_Prefijo);
                    vlo_Command.CommandText = vlc_sentencia;

                    //EL VALOR CONSECUTIVO OBTENIDO SE LE SUMA UNO PARA GENERAR EL SIGUIENTE CARNET.
                    Consecutivo = int.Parse(vlo_Command.ExecuteScalar().ToString()) + 1;
                    vlo_Conexion.Close();
                    //SE CONVIRTE ESTE NÚMERO A STRING
                    consecut = Consecutivo.ToString();
                    // SE VERIFICA LA LONGITUD DE ESTE Y SE LE CONCATENA CEROS ANTES DEL VALOR SEGÚN LO QUE SEA NECESARIO.
                    if (consecut.Length == 1)
                    {
                        vlc_CarnetNuevo = vlc_Prefijo + "000" + consecut;
                    }
                    else
                    {
                        if (consecut.Length == 2)
                        {
                            vlc_CarnetNuevo = vlc_Prefijo + "00" + consecut;
                        }
                        else
                        {
                            if (consecut.Length == 3)
                            {
                                vlc_CarnetNuevo = vlc_Prefijo + "0" + consecut;
                            }
                            else
                            {
                                if (consecut.Length == 4)
                                {
                                    vlc_CarnetNuevo = vlc_Prefijo + consecut;
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
            // SE RETORNA EL CARNET NUEVO.
            return(vlc_CarnetNuevo);
        }