예제 #1
0
        private String ArmaCadena(String descripcionAIngresar)
        {
            List <String> palabras = MisFunt.SplitStringWithoutStoppers(descripcionAIngresar);

            String sqlCadena = "";

            foreach (String palabra in palabras)
            {
                sqlCadena += " OR Descripcion LIKE '%" + palabra + "%'";
            }

            return(sqlCadena = sqlCadena.Substring(3));
        }
예제 #2
0
        private void SetEquiposInfo(ObservableCollection <Mobiliario> mobiliarios)
        {
            PdfPTable table = new PdfPTable(4);

            table.WidthPercentage = 100;

            table.SpacingBefore = 20f;
            table.SpacingAfter  = 5f;

            float[] widths = new float[] { 0.5f, 1f, 2f, 2f };
            table.SetWidths(widths);

            string[] encabezado = { " ", "No. de inventario", "Descripcion", "Observaciones" };
            PdfPCell cell;

            foreach (string cabeza in encabezado)
            {
                cell                     = new PdfPCell(new Phrase(cabeza, Fuentes.EncabezadoColumna));
                cell.Colspan             = 0;
                cell.HorizontalAlignment = 1; //0=Left, 1=Centre, 2=Right
                table.AddCell(cell);
            }

            int id = 1;

            foreach (Mobiliario mobiliario in mobiliarios)
            {
                string[] descs = { id.ToString(), mobiliario.Inventario.ToString(), MisFunt.GetTipoMobilDescrip(mobiliario.IdTipoMobiliario), mobiliario.Observaciones };

                foreach (string desc in descs)
                {
                    cell                     = new PdfPCell(new Phrase(desc, Fuentes.ContenidoCelda));
                    cell.Colspan             = 0;
                    cell.HorizontalAlignment = 1; //0=Left, 1=Centre, 2=Right
                    table.AddCell(cell);
                }
                id++;
            }

            myDocument.Add(table);
        }
예제 #3
0
        /// <summary>
        /// Agrega la información del usuario en cuestión al su resguardo
        /// </summary>
        /// <param name="myDocument"></param>
        /// <param name="serv"></param>
        /// <returns></returns>
        public static iTextSharp.text.Document SetUserInfo(iTextSharp.text.Document myDocument, ServidoresPublicos serv)
        {
            Phrase    phrase = new Phrase("Nombre: ", Fuentes.NomExpd);
            Paragraph para   = new Paragraph(phrase);

            phrase = new Phrase(serv.Nombre, Fuentes.NomExpdUnder);
            para.Add(phrase);
            phrase = new Phrase("                           ", Fuentes.NomExpd);
            para.Add(phrase);
            phrase = new Phrase("Expediente: ", Fuentes.NomExpd);
            para.Add(phrase);
            phrase = new Phrase(serv.Expediente.ToString(), Fuentes.NomExpdUnder);
            para.Add(phrase);
            myDocument.Add(para);

            phrase = new Phrase("Área:      ", Fuentes.NomExpd);
            para   = new Paragraph(phrase);
            phrase = new Phrase(MisFunt.GetAreasDescrip(serv.IdArea), Fuentes.NomExpdUnder);
            para.Add(phrase);
            myDocument.Add(para);

            phrase = new Phrase("Adscripción: ", Fuentes.NomExpd);
            para   = new Paragraph(phrase);
            phrase = new Phrase(MisFunt.GetAdscripcionDescrip(serv.IdAdscripcion), Fuentes.NomExpdUnder);
            para.Add(phrase);
            myDocument.Add(para);

            phrase = new Phrase("Fecha:   ", Fuentes.NomExpd);
            para   = new Paragraph(phrase);
            phrase = new Phrase(DateTime.Now.ToString("dd/MM/yyyy"), Fuentes.NomExpdUnder);
            para.Add(phrase);
            phrase = new Phrase("                                                             ", Fuentes.NomExpd);
            para.Add(phrase);
            phrase = new Phrase("Puerta: ", Fuentes.NomExpd);
            para.Add(phrase);
            phrase = new Phrase(serv.Puerta.ToString(), Fuentes.NomExpdUnder);
            para.Add(phrase);
            myDocument.Add(para);

            return(myDocument);
        }
예제 #4
0
        /// <summary>
        /// Agrega la zona de firmas al resguardo
        /// </summary>
        /// <param name="myDocument"></param>
        /// <param name="serv"></param>
        /// <returns></returns>
        public static iTextSharp.text.Document SetPageFooter(iTextSharp.text.Document myDocument, ServidoresPublicos serv)
        {
            PdfPTable firma = new PdfPTable(3);

            //table.TotalWidth = 400;
            firma.WidthPercentage = 100;

            //Evitan que la tabla se separe si quedca entre dos paginas
            firma.KeepTogether = true;
            firma.SplitLate    = true;
            firma.SplitRows    = false;

            //firma.SpacingBefore = 20f;
            firma.SpacingAfter = 30f;

            float[] widths = new float[] { 2f, 1f, 2f };
            firma.SetWidths(widths);

            PdfPCell cell = new PdfPCell(new Phrase(" Entrega:", Fuentes.ContenidoCelda));

            cell.Colspan             = 0;
            cell.Border              = 0;
            cell.HorizontalAlignment = 1; //0=Left, 1=Centre, 2=Right
            firma.AddCell(cell);

            cell                     = new PdfPCell(new Phrase("", Fuentes.ContenidoCelda));
            cell.Colspan             = 0;
            cell.Border              = 0;
            cell.HorizontalAlignment = 1; //0=Left, 1=Centre, 2=Right
            firma.AddCell(cell);

            cell                     = new PdfPCell(new Phrase("Recibe:", Fuentes.ContenidoCelda));
            cell.Colspan             = 0;
            cell.Border              = 0;
            cell.HorizontalAlignment = 1; //0=Left, 1=Centre, 2=Right
            firma.AddCell(cell);

            cell        = new PdfPCell(new Phrase("   ", Fuentes.ContenidoCelda));
            cell.Border = 0;
            for (int cellX = 0; cellX < 6; cellX++)
            {
                firma.AddCell(cell);
            }



            cell                     = new PdfPCell(new Phrase("        " + ConfigurationManager.AppSettings.Get("ResponsableComputo"), Fuentes.ContenidoCelda));
            cell.Colspan             = 0;
            cell.Border              = Rectangle.TOP_BORDER;
            cell.BorderWidthTop      = 1f;
            cell.HorizontalAlignment = 1; //0=Left, 1=Centre, 2=Right
            firma.AddCell(cell);

            cell                     = new PdfPCell(new Phrase("", Fuentes.ContenidoCelda));
            cell.Colspan             = 0;
            cell.Border              = 0;
            cell.HorizontalAlignment = 1; //0=Left, 1=Centre, 2=Right
            firma.AddCell(cell);

            cell                     = new PdfPCell(new Phrase(MisFunt.GetTituloDescrip(serv.IdTitulo) + " " + serv.Nombre, Fuentes.ContenidoCelda));
            cell.Colspan             = 0;
            cell.Border              = Rectangle.TOP_BORDER;
            cell.BorderWidthTop      = 1f;
            cell.HorizontalAlignment = 1; //0=Left, 1=Centre, 2=Right
            firma.AddCell(cell);
            myDocument.Add(firma);

            return(myDocument);
        }
예제 #5
0
 private void TxtExpediente_PreviewTextInput(object sender, System.Windows.Input.TextCompositionEventArgs e)
 {
     e.Handled = MisFunt.IsADigit(e.Text);
 }
 private void TxtExtension_PreviewTextInput(object sender, TextCompositionEventArgs e)
 {
     e.Handled = MisFunt.IsADigit(e.Text);
 }