Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Programación web
PROYECTO:
ENFERMERIA
3° avance de Proyecto
INTEGRANTES
ARROYOS RODRÍGUEZ MIREYA NOEMI
SALDIVAR GONZALES KARLA JOSEFINA
sp_tables
go
--implementando las llaves primarias
ALTER TABLE ENFERMERA ADD PRIMARY KEY NONCLUSTERED (id_enfermera)
ALTER TABLE ESTUDIANTE ADD PRIMARY KEY NONCLUSTERED (id_estudiante)
ALTER TABLE HISTORIAL_MEDICO ADD PRIMARY KEY NONCLUSTERED (id_historial)
ALTER TABLE MEDICAMENTO ADD PRIMARY KEY NONCLUSTERED (id_medicamento)
ALTER TABLE REGISTRO ADD PRIMARY KEY NONCLUSTERED (id_registro)
go
--CRecaion de vistas
create view informaciongeneral as
select estudiante.nombre,estudiante.apellido_pa,
estudiante.apellido_ma,historial_medico.alergias_med,
medicamento.nombre_medicamento,registro.fecha,registro.hora,
estudiante.carrera from estudiante,medicamento,registro,
historial_medico where estudiante.id_estudiante=registro.id_estudiante
and historial_medico.id_historial=registro.id_historial and
medicamento.id_medicamento=registro.id_medicamento;
Réplica de la
maquina 192.168.1.66
192.168.1.65 Base de datos enfermería
Tabla estudiantes
Información general
Enfermera
Historial
medicamento
medicamento
Clases de conexión y operación de la
BD(Select,Insert,Delete,Update)
namespace Enfermeria
lblStatus.Visible = false;
ValidarLogin();
//Metodo ValidarLogin()
try
{
//Crear y usar objeto de conexion SQL
conSQL.Open();
//Parametrizar valores
cmdSQL.Parameters.AddWithValue("@usuario", txtUsuario.Text.Trim());
cmdSQL.Parameters.AddWithValue("@password", txtPassword.Text.Trim());
if (count == 1)
Session["usuario"] = txtUsuario.Text.Trim();
Response.Redirect("Enfermera.aspx");
}
else
lblStatus.Visible = true;
lblStatus.ForeColor = System.Drawing.Color.Red;
lblStatus.Font.Bold = true;
lblStatus.Visible = true;
lblStatus.Text = ex.Message;
lblStatus.ForeColor = System.Drawing.Color.Red;
lblStatus.Font.Bold = true;
La de estudiantes
namespace Enfermeria
if (!IsPostBack)
IniciarLlenado();
if (Page.IsValid)
Registrar();
else
lblStatus.Visible = true;
lblStatus.ForeColor = System.Drawing.Color.Red;
lblStatus.Font.Bold = true;
carrera.DataTextField = "carrera";
carrera.DataValueField = "carrera";
carrera.DataBind();
try
//Console.Write(datoSeleccionado);
conSQL.Open();
//String Query SQL
cmdSQL.Parameters.AddWithValue("@Nombre", txtNombre.Text.Trim());
cmdSQL.Parameters.AddWithValue("@Paterno", txtAppa.Text.Trim());
cmdSQL.Parameters.AddWithValue("@Materno", txtApma.Text.Trim());
cmdSQL.Parameters.AddWithValue("@NoControl", txtNumc.Text.Trim());
cmdSQL.Parameters.AddWithValue("@Carrera",(carrera.SelectedValue));
cmdSQL.ExecuteNonQuery();
//Liberar Recursos
cmdSQL.Dispose();
}
//Mensaje Registro Correcto
lblStatus.Visible = true;
lblStatus.ForeColor = System.Drawing.Color.Green;
lblStatus.Font.Bold = true;
//Mensaje Excepcion
lblStatus.Text = ex.Message;
lblStatus.Visible = true;
lblStatus.ForeColor = System.Drawing.Color.Red;
lblStatus.Font.Bold = true;
con.Open();
con.Close();
return ds;
La de enfermera
namespace Enfermeria
if (Page.IsValid)
Registrar();
}
else
lblStatus.Visible = true;
lblStatus.ForeColor = System.Drawing.Color.Red;
lblStatus.Font.Bold = true;
try
conSQL.Open();
cmdSQL.Parameters.AddWithValue("@Nombre", txtNombre.Text.Trim());
cmdSQL.Parameters.AddWithValue("@Paterno", txtAppa.Text.Trim());
cmdSQL.Parameters.AddWithValue("@Materno", txtApma.Text.Trim());
cmdSQL.Parameters.AddWithValue("@Telefono", txtTel.Text.Trim());
cmdSQL.Parameters.AddWithValue("@Celular", txtcel.Text.Trim());
if(RaMat.Checked)
turno = "matutino";
else
turno = "vespertino";
cmdSQL.Parameters.AddWithValue("@Turno", turno);
cmdSQL.ExecuteNonQuery();
//Liberar Recursos
cmdSQL.Dispose();
lblStatus.Visible = true;
lblStatus.ForeColor = System.Drawing.Color.Green;
lblStatus.Font.Bold = true;
//Mensaje Excepcion
lblStatus.Text = ex.Message;
lblStatus.Visible = true;
lblStatus.ForeColor = System.Drawing.Color.Red;
lblStatus.Font.Bold = true;
{
public partial class informaciongeneral : System.Web.UI.Page
Consulta();
//Metodo Consulta()
try
conSQL.Open();
//String Query SQL
"nombre_medicamento,fecha,hora,carrera FROM[dbo].[informaciongeneral]";
adaptadorSQL.Fill(tablaSQL);
//lblNombre.Text = row["regnom"].ToString();
//txtNombre.Text = row["nombre"].ToString();
//txtApellido.Text = row["apellido"].ToString();
//lblNombre.Text = tablaSQL.Rows[0][0].ToString();
//Recorrer DataTable
//foreach(DataRow dtRow in tablaSQL.Rows)
//{
// {
// Response.Write(dato);
// }
//}
GV_Consulta.DataSource = tablaSQL;
GV_Consulta.DataBind();
//Liberar Recursos
cmdSQL.Dispose();
adaptadorSQL.Dispose();
tablaSQL.Dispose();
//Mensaje de Exito
lblStatus.ForeColor = System.Drawing.Color.Green;
lblStatus.Font.Bold = true;
}
lblStatus.Text = ex.Message;
lblStatus.ForeColor = System.Drawing.Color.Red;
lblStatus.Font.Bold = true;
Historial medico
namespace Enfermeria
if (Page.IsValid)
{
Registrar();
else
lblStatus.Visible = true;
lblStatus.ForeColor = System.Drawing.Color.Red;
lblStatus.Font.Bold = true;
try
conSQL.Open();
cmdSQL.Parameters.AddWithValue("@Sangre", txtSangre.Text.Trim());
cmdSQL.Parameters.AddWithValue("@Alergias", txtAlergias.Text.Trim());
cmdSQL.Parameters.AddWithValue("@Seguro", txtSeguro.Text.Trim());
cmdSQL.ExecuteNonQuery();
//Liberar Recursos
cmdSQL.Dispose();
lblStatus.Visible = true;
lblStatus.ForeColor = System.Drawing.Color.Green;
lblStatus.Font.Bold = true;
//Mensaje Excepcion
lblStatus.Text = ex.Message;
lblStatus.Visible = true;
lblStatus.ForeColor = System.Drawing.Color.Red;
lblStatus.Font.Bold = true;
La de registro la medicamento
namespace Enfermeria
}
protected void BtnEnviar_Click(object sender, EventArgs e)
if (Page.IsValid)
Registrar();
else
lblStatus.Visible = true;
lblStatus.ForeColor = System.Drawing.Color.Red;
lblStatus.Font.Bold = true;
try
conSQL.Open();
"VALUES (@Nombremed,
@Clasificacion,@Fecha_cad, @Cantidad, @marca)";
cmdSQL.Parameters.AddWithValue("@Nombremed",
txtNomMed.Text.Trim());
cmdSQL.Parameters.AddWithValue("@Clasificacion",
txtClasi.Text.Trim());
cmdSQL.Parameters.AddWithValue("@Fecha_cad",
txtFec.Text.Trim());
cmdSQL.Parameters.AddWithValue("@Cantidad",
txtCant.Text.Trim());
cmdSQL.Parameters.AddWithValue("@marca",
txtMarca.Text.Trim());
cmdSQL.ExecuteNonQuery();
//Liberar Recursos
cmdSQL.Dispose();
lblStatus.Visible = true;
lblStatus.ForeColor = System.Drawing.Color.Green;
lblStatus.Font.Bold = true;
//Mensaje Excepcion
lblStatus.Text = ex.Message;
lblStatus.Visible = true;
lblStatus.ForeColor = System.Drawing.Color.Red;
lblStatus.Font.Bold = true;
La de reporte
namespace Enfermeria
//Tabla de Datos
try
{
//Crear y usar objeto de conexion SQL
conSQL.Open();
"nombre_medicamento,fecha,hora,carrera FROM[dbo].[informaciongeneral]";
adaptadorSQL.Fill(tablaDatos);
lblStatus.Text = ex.Message;
lblStatus.ForeColor = System.Drawing.Color.Red;
lblStatus.Font.Bold = true;
}
//Crear Documento
doc.AddAuthor("Mireya Noemi");
//Abrir Documento
doc.Open();
imagen.BorderWidth = 0;
imagen.Alignment = Element.ALIGN_RIGHT;
imagen.ScalePercent(percentage * 100);
doc.Add(imagen);
doc.Add(Chunk.NEWLINE);
//Metodo LlenarTabla
LlenarTabla();
tablaPDF.AddCell(new Phrase(col.Caption));
tablaPDF.AddCell(new Phrase(ren[0].ToString()));
tablaPDF.AddCell(new Phrase(ren[1].ToString()));
tablaPDF.AddCell(new Phrase(ren[2].ToString()));
tablaPDF.AddCell(new Phrase(ren[3].ToString()));
tablaPDF.AddCell(new Phrase(ren[4].ToString()));
tablaPDF.AddCell(new Phrase(ren[5].ToString()));
doc.Add(tablaPDF);
/*
// de nuestros visitante.
tblPrueba.WidthPercentage = 100;
// Configuramos el título de las columnas de la tabla
clNombre.BorderWidth = 0;
clNombre.BorderWidthBottom = 0.75f;
clApellido.BorderWidth = 0;
clApellido.BorderWidthBottom = 0.75f;
clPais.BorderWidth = 0;
clPais.BorderWidthBottom = 0.75f;
tblPrueba.AddCell(clNombre);
tblPrueba.AddCell(clApellido);
tblPrueba.AddCell(clPais);
clNombre.BorderWidth = 0;
clApellido.BorderWidth = 0;
clPais = new PdfPCell(new Phrase("Mexico", _standardFont));
clPais.BorderWidth = 0;
tblPrueba.AddCell(clNombre);
tblPrueba.AddCell(clApellido);
tblPrueba.AddCell(clPais);
doc.Add(tblPrueba);
*/
//Cerrar Documento
doc.Close();
writer.Close();