public List <Cita> BusCita(string Fec) { Paciente p = new Paciente(); List <Cita> LP = new List <Cita>(); Cita P = new Cita(); dsl = new DSL(); try { P = new Cita(); dsl.Open(Con, Proveedor.SQLServer); dsl.InitialSQLStatement("SELECT * FROM dbo.ConsCitFec('" + Fec + "');", CommandType.Text); DataTable Dt = dsl.ReturnTable(); for (int i = 0; i < Dt.Rows.Count; i++) { P = new Cita(); P.FechaHora = Dt.Rows[i]["FechaHora"].ToString(); P.Nombre = Dt.Rows[i]["Nombre"].ToString(); LP.Add(P); } //dsl.Close(); return(LP); } catch (Exception ex) { throw new Exception(ex.Message, ex); } finally { dsl = null; } }
public void GenerarReporteCitasDesdeBD() { FormarDoctoPDF documentoPDF = new FormarDoctoPDF(); documentoPDF.ConfiguracionArchivo = new ConfigArchivo(); documentoPDF.ConfiguracionEncabezado = new ConfigEncabezado(); documentoPDF.ConfiguracionPiePagina = new ConfigPiePagina(); //configuracion del archivo documentoPDF.ConfiguracionArchivo.TipoHoja = eTipoHoja.Carta; documentoPDF.ConfiguracionArchivo.Fuente = eTipoFuente.Arial; documentoPDF.ConfiguracionArchivo.SizeFuente = eSizeFuente.Standar; documentoPDF.ConfiguracionArchivo.OrientacionPagina = eOrientacion.Vertical; documentoPDF.ConfiguracionArchivo.BCopiar = true; documentoPDF.ConfiguracionArchivo.BImprimir = false; //false se puede imprimir, true no se puede documentoPDF.ConfiguracionArchivo.BAccesibilidadContenido = true; documentoPDF.ConfiguracionArchivo.Resumen = false; #region Reporte apartir de un HTML ReporteSimple reportecitas = new ReporteSimple(); dsl.Open(Con, RNConnection.DataAbstractionLayer.Proveedor.SQLServer); dsl.InitialSQLStatement("SELECT * FROM ReturnValuesCitas()", System.Data.CommandType.Text); DataTable tabla = dsl.ReturnTable(); reportecitas.Escuela = ""; reportecitas.Universidad = reportecitas.Escuela; //configuracion de archivo documentoPDF.ConfiguracionArchivo.NombreArchivo = ruta + "reporteCitas" + DateTime.Now.Ticks.ToString() + ".pdf"; documentoPDF.ConfiguracionArchivo.TipoReporte = eTipoReporte.Simple; for (int i = 0; i < tabla.Rows.Count; i++) { string html = File.ReadAllText(ConfigurationManager.ConnectionStrings["RutaHTML"].ToString() + @"\Reporte_Citas.html"); html = html.Replace("#IDCITA#", tabla.Rows[i]["IdCita"].ToString()); html = html.Replace("#IDPACIENTE#", tabla.Rows[i]["IdPaciente"].ToString()); html = html.Replace("#FECHAHORA#", tabla.Rows[i]["FechaHora"].ToString()); reportecitas.ParrafoCuerpo = html; } reportecitas.InicialesUsuario = "JCVE"; documentoPDF.ObtenerDocumentoPDF(null, reportecitas); }
public List <Paciente> BusIdPac(Paciente PP) { List <Paciente> LP = new List <Paciente>(); Paciente P = new Paciente(); dsl = new DSL(); try { P = new Paciente(); dsl.Open(Con, Proveedor.SQLServer); dsl.InitialSQLStatement("SELECT * FROM dbo.ConsIdPac(" + PP.IdPersona + ");", CommandType.Text); DataTable Dt = dsl.ReturnTable(); for (int i = 0; i < Dt.Rows.Count; i++) { P = new Paciente(); P.Nombre = Dt.Rows[i]["Nombre"].ToString(); P.ApePaterno = Dt.Rows[i]["ApePat"].ToString(); P.ApeMaterno = Dt.Rows[i]["ApeMat"].ToString(); P.Edad = int.Parse(Dt.Rows[i]["Edad"].ToString()); P.Sexo = Dt.Rows[i]["Sexo"].ToString(); P.FechaNacimiento = Dt.Rows[i]["FechaNac"].ToString(); P.EstadoCivil = Dt.Rows[i]["EstadoCivil"].ToString(); P.RFC = Dt.Rows[i]["RFC"].ToString(); P.CURP = Dt.Rows[i]["CURP"].ToString(); P.Ocupacion = Dt.Rows[i]["Ocupacion"].ToString(); P.NumeroCasa = Dt.Rows[i]["NumeroCasa"].ToString(); P.Calle = Dt.Rows[i]["Calle"].ToString(); P.Colonia = Dt.Rows[i]["Colonia"].ToString(); P.Estado = Dt.Rows[i]["Estado"].ToString(); P.Municipio = Dt.Rows[i]["Municipio"].ToString(); P.TelCasa = Dt.Rows[i]["TelefonoCasa"].ToString(); P.TelMovil = Dt.Rows[i]["TelefonoMovil"].ToString(); LP.Add(P); } //dsl.Close(); return(LP); } catch (Exception ex) { throw new Exception(ex.Message, ex); } finally { dsl = null; } }
public List <Laboratorio> BusLab() { List <Laboratorio> LP = new List <Laboratorio>(); Laboratorio P = new Laboratorio(); dsl = new DSL(); try { P = new Laboratorio(); dsl.Open(Con, Proveedor.SQLServer); dsl.InitialSQLStatement("SELECT * FROM dbo.ConsAllLab();", CommandType.Text); DataTable Dt = dsl.ReturnTable(); for (int i = 0; i < Dt.Rows.Count; i++) { P = new Laboratorio(); P.IdLab = int.Parse(Dt.Rows[i]["IdLab"].ToString()); P.Nombre = Dt.Rows[i]["Nombre"].ToString(); P.Director = Dt.Rows[i]["Director"].ToString(); P.Telefono = Dt.Rows[i]["Telefono"].ToString(); P.Calle = Dt.Rows[i]["Calle"].ToString(); P.Colonia = Dt.Rows[i]["Colonia"].ToString(); P.Municipio = Dt.Rows[i]["Municipio"].ToString(); P.Estado = Dt.Rows[i]["Estado"].ToString(); LP.Add(P); } //dsl.Close(); return(LP); } catch (Exception ex) { throw new Exception(ex.Message, ex); } finally { dsl = null; } }