예제 #1
0
        public ClassResultV Usp_Paciente_Update_ByIdPaciente(DtoB dtoBase)
        {
            DtoPaciente  dto = (DtoPaciente)dtoBase;
            ClassResultV cr  = new ClassResultV();

            SqlParameter[] pr = new SqlParameter[9];
            try
            {
                pr[0] = new SqlParameter("@IdPaciente", SqlDbType.Int)
                {
                    Value = (dto.IdPaciente)
                };
                pr[1] = new SqlParameter("@Nombres", SqlDbType.VarChar, 100)
                {
                    Value = (V_ValidaPrNull(dto.Nombres))
                };
                pr[2] = new SqlParameter("@Apellidos", SqlDbType.VarChar, 100)
                {
                    Value = (V_ValidaPrNull(dto.Apellidos))
                };
                pr[3] = new SqlParameter("@IN_Tipodoc", SqlDbType.Int)
                {
                    Value = (V_ValidaPrNull(dto.IN_Tipodoc))
                };
                pr[4] = new SqlParameter("@Numdoc", SqlDbType.VarChar, 20)
                {
                    Value = (V_ValidaPrNull(dto.Numdoc))
                };
                pr[5] = new SqlParameter("@IN_TipoSeguro", SqlDbType.Int)
                {
                    Value = (V_ValidaPrNull(dto.IN_TipoSeguro))
                };
                pr[6] = new SqlParameter("@IN_EstadoPaciente", SqlDbType.Int)
                {
                    Value = (V_ValidaPrNull(dto.IN_EstadoPaciente))
                };
                pr[7] = new SqlParameter("@UsuarioModificacionId", SqlDbType.Int)
                {
                    Value = (V_ValidaPrNull(dto.UsuarioModificacionId))
                };
                pr[8] = new SqlParameter("@msj", SqlDbType.VarChar, 100)
                {
                    Direction = ParameterDirection.Output
                };
                SqlHelper.ExecuteNonQuery(ObjCn, CommandType.StoredProcedure, "Usp_Paciente_Update_ByIdPaciente", pr);
                if (!String.IsNullOrEmpty(Convert.ToString(pr[8].Value)))
                {
                    cr.ErrorMsj   = Convert.ToString(pr[8].Value);
                    cr.LugarError = "Usp_Paciente_Update_ByIdPaciente";
                }
            }
            catch (Exception ex)
            {
                cr.LugarError = ex.StackTrace;
                cr.ErrorEx    = ex.Message;
                cr.ErrorMsj   = "Error al actualizar los datos del paciente";
            }
            ObjCn.Close();
            return(cr);
        }
예제 #2
0
        public void LoguearContacto(object sender, EventArgs e)
        {
            try
            {
                DtoPaciente dto = new DtoPaciente
                {
                    Credencial = txtCredencial.Text.Trim()
                };
                DtoPaciente dtoP = new CtrContacto().Usp_Contacto_Login(dto);
                if (!dtoP.HuboError)
                {
                    Session["PacienteContacto"] = dtoP;

                    Response.Redirect("/contacto/menu");
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), "Pop", HelpE.mensajeConfirmacion("Error!", dtoP.ErrorMsj, "error"), true);
                }
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "Pop", HelpE.mensajeConfirmacion("Error!", "Oops, algo salió mal :(", "error"), true);
            }
        }
예제 #3
0
 protected void btnRegistrar_Click(object sender, EventArgs e)
 {
     try
     {
         DtoContacto userContacto = (DtoContacto)Session["ContactoSession"];
         DtoPaciente userPaciente = (DtoPaciente)Session["PacienteContacto"];
         DtoMensajes dtoPa        = new CtrMensajes().Usp_Mensajes_Insert(new DtoMensajes
         {
             ContactoId     = userContacto.IdContacto,
             Asunto         = txtAsunto.Text.Trim(),
             Mensaje        = txtMensaje.Text.Trim(),
             IN_TipoMensaje = Convert.ToInt32(ddlTipoMensaje.SelectedValue),
             OrganizacionId = userPaciente.OrganizacionId
         });
         if (dtoPa.HuboError)
         {
             ScriptManager.RegisterStartupScript(this, GetType(), "Pop", HelpE.mensajeConfirmacion("Error", dtoPa.ErrorMsj, "error"), true);
         }
         else
         {
             ScriptManager.RegisterStartupScript(this, GetType(), "Pop", HelpE.mensajeConfirmacionRedirect("Mensaje Enviado Correctamente", "Se envio correctamente el mensaje", "success", "/contacto/mensaje/lista"), true);
         }
     }
     catch (Exception ex)
     {
         ScriptManager.RegisterStartupScript(this, GetType(), "Pop", @"Swal.fire('Error!', '" + "No se pudo enviar el mensaje." + "', 'error');", true);
     }
 }
        public DtoPaciente Usp_Contacto_Login(DtoB dtoBase)
        {
            DtoPaciente dto = (DtoPaciente)dtoBase;

            SqlParameter[] pr = new SqlParameter[3];
            try
            {
                pr[0] = new SqlParameter("@Credencial", SqlDbType.VarChar, 100)
                {
                    Value = dto.Credencial
                };
                pr[1] = new SqlParameter("@msj", SqlDbType.VarChar, 100)
                {
                    Direction = ParameterDirection.Output
                };

                SqlDataReader reader = SqlHelper.ExecuteReader(ObjCn, CommandType.StoredProcedure, "Usp_Contacto_Login", pr);
                if (reader.Read())
                {
                    dto = new DtoPaciente
                    {
                        IdPaciente            = GetValue("IdPaciente", reader).ValueInt32,
                        Nombres               = GetValue("Nombres", reader).ValueString,
                        Apellidos             = GetValue("Apellidos", reader).ValueString,
                        IN_Tipodoc            = GetValue("IN_Tipodoc", reader).ValueInt32,
                        Numdoc                = GetValue("Numdoc", reader).ValueString,
                        IN_TipoSeguro         = GetValue("IN_TipoSeguro", reader).ValueInt32,
                        IN_EstadoPaciente     = GetValue("IN_EstadoPaciente", reader).ValueInt32,
                        UsuarioCreacionId     = GetValue("UsuarioCreacionId", reader).ValueInt32,
                        FechaCreacion         = GetValue("FechaCreacion", reader).ValueDateTime,
                        UsuarioModificacionId = GetValue("UsuarioModificacionId", reader).ValueInt32,
                        FechaModificacion     = GetValue("FechaModificacion", reader).ValueDateTime,
                        IB_Estado             = GetValue("IB_Estado", reader).ValueBool,
                        Credencial            = GetValue("Credencial", reader).ValueString,
                        OrganizacionId        = GetValue("OrganizacionId", reader).ValueInt32,
                        NombreTipodoc         = GetValue("NombreTipodoc", reader).ValueString,
                        NombreTipoSeguro      = GetValue("NombreTipoSeguro", reader).ValueString,
                        NombreEstadoPaciente  = GetValue("NombreEstadoPaciente", reader).ValueString
                    };
                }
                reader.Close();
                if (!String.IsNullOrEmpty(Convert.ToString(pr[1].Value)))
                {
                    dto.ErrorMsj   = Convert.ToString(pr[1].Value);
                    dto.LugarError = "Usp_Contacto_Login";
                }
            }
            catch (Exception ex)
            {
                dto.LugarError = ex.StackTrace;
                dto.ErrorEx    = ex.Message;
                dto.ErrorMsj   = "Error al loguear crendecial";
            }
            ObjCn.Close();
            return(dto);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            DtoPaciente userPaciente = (DtoPaciente)Session["PacienteContacto"];

            if (userPaciente != null)
            {
                FirstLoad();
            }
            else
            {
                Response.Redirect("/logOutContacto");
            }
        }
예제 #6
0
        public DtoPaciente Usp_Paciente_SelectOne(DtoB dtoBase)
        {
            DtoPaciente dto = (DtoPaciente)dtoBase;

            SqlParameter[] pr = new SqlParameter[1];

            try
            {
                pr[0] = new SqlParameter("@IdPaciente", SqlDbType.Int)
                {
                    Value = (dto.IdPaciente)
                };

                SqlDataReader reader = SqlHelper.ExecuteReader(ObjCn, CommandType.StoredProcedure, "Usp_Paciente_SelectOne", pr);

                //cr.List = new List<DtoB>();
                if (reader.Read())
                {
                    dto = new DtoPaciente
                    {
                        IdPaciente            = GetValue("IdPaciente", reader).ValueInt32,
                        Nombres               = GetValue("Nombres", reader).ValueString,
                        Apellidos             = GetValue("Apellidos", reader).ValueString,
                        IN_Tipodoc            = GetValue("IN_Tipodoc", reader).ValueInt32,
                        Numdoc                = GetValue("Numdoc", reader).ValueString,
                        IN_TipoSeguro         = GetValue("IN_TipoSeguro", reader).ValueInt32,
                        IN_EstadoPaciente     = GetValue("IN_EstadoPaciente", reader).ValueInt32,
                        UsuarioCreacionId     = GetValue("UsuarioCreacionId", reader).ValueInt32,
                        FechaCreacion         = GetValue("FechaCreacion", reader).ValueDateTime,
                        UsuarioModificacionId = GetValue("UsuarioModificacionId", reader).ValueInt32,
                        FechaModificacion     = GetValue("FechaModificacion", reader).ValueDateTime,
                        IB_Estado             = GetValue("IB_Estado", reader).ValueBool,
                        Credencial            = GetValue("Credencial", reader).ValueString,
                        OrganizacionId        = GetValue("OrganizacionId", reader).ValueInt32,
                        NombreTipodoc         = GetValue("NombreTipodoc", reader).ValueString,
                        NombreTipoSeguro      = GetValue("NombreTipoSeguro", reader).ValueString,
                        NombreEstadoPaciente  = GetValue("NombreEstadoPaciente", reader).ValueString
                    };
                }
                reader.Close();
            }
            catch (Exception ex)
            {
                dto.LugarError = ex.StackTrace;
                dto.ErrorEx    = ex.Message;
                dto.ErrorMsj   = "Error en Usp_Paciente_SelectOne";
            }
            ObjCn.Close();
            return(dto);
        }
예제 #7
0
        private void CargarDatosPaciente()
        {
            try
            {
                DtoPaciente userPaciente = (DtoPaciente)Session["PacienteContacto"];

                txtNombres.Text        = userPaciente.Nombres;
                txtApellidos.Text      = userPaciente.Apellidos;
                txtNumdoc.Text         = userPaciente.NombreTipodoc + "-" + userPaciente.Numdoc.ToString();
                txtEstadoPaciente.Text = userPaciente.NombreEstadoPaciente;
            }
            catch (Exception)
            {
                throw;
            }
        }
예제 #8
0
        private void CargarReporteMedico()
        {
            try
            {
                DtoPaciente          userPaciente = (DtoPaciente)Session["PacienteContacto"];
                DtoPacienteHistorial dtoPH        = new CtrPacienteHistoria().Usp_PacienteHistorial_SelectOne(new DtoPacienteHistorial
                {
                    PacienteId = userPaciente.IdPaciente
                });
                if (!dtoPH.HuboError)
                {
                    txtFechaCreacion.Text = dtoPH.FechaCreacion.ToString();
                    txtTemperatura.Text   = dtoPH.Temperatura;
                    txtFrecuencia.Text    = dtoPH.FrecuenciaCardiaca;
                    txtPresion.Text       = dtoPH.PresionArterial;
                    txtSaturacion.Text    = dtoPH.Saturacion;
                    txtPronostico.Text    = dtoPH.Pronostico;
                    txtRequerimiento.Text = dtoPH.Requerimiento;
                    txtEvolucion.Text     = dtoPH.Evolucion;

                    cbTraslado.Checked = dtoPH.IB_Traslado;
                    if (dtoPH.IB_Traslado)
                    {
                        lblTraslado.CssClass = "badge rounded-pill bg-danger";
                        lblTraslado.Text     = "Requiere Traslado!";

                        txtFechaTraslado.Text         = dtoPH.FechaSolicitudTraslado.ToString("dd/MM/yyyy");
                        ddlTipoTraslado.SelectedValue = dtoPH.IN_TipoTraslado.ToString();
                        txtComentario.Text            = dtoPH.DescTraslado;
                    }

                    DtoUsuario dtoUser = new CtrUsuario().Usp_Usuario_SelectOne(new DtoUsuario
                    {
                        IdUsuario = dtoPH.UsuarioCreacionId
                    });
                    if (!dtoUser.HuboError)
                    {
                        txtMedico.Text = dtoUser.PrimerNombre + " " + dtoUser.SegundoNombre + " " + dtoUser.ApellidoPaterno + " " + dtoUser.ApellidoMaterno;
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
        public void FirstLoad()
        {
            DtoPaciente userPaciente = (DtoPaciente)Session["PacienteContacto"];

            DtoContacto dtoC = new CtrContacto().Usp_Contacto_SelectOne(new DtoContacto
            {
                PacienteId = userPaciente.IdPaciente
            });

            Session["ContactoSession"] = dtoC;
            if (!dtoC.HuboError)
            {
                lbUserName.Text  = dtoC.NombreCompleto;
                title.Text       = "Essalud - " + userPaciente.Nombres + " " + userPaciente.Apellidos;
                titulo.InnerText = "Paciente - " + userPaciente.Nombres + " " + userPaciente.Apellidos;
            }
        }
예제 #10
0
 private void CargarReportes()
 {
     try
     {
         List <DtoPacienteHistorial> listaReporte = new List <DtoPacienteHistorial>();
         DateTime fistdate = new DateTime();
         DateTime lastdate = new DateTime();
         for (int i = 0; i < calendario.SelectedDates.Count; i++)
         {
             if (i == 0)
             {
                 fistdate = calendario.SelectedDates[i];
             }
             else if (i == calendario.SelectedDates.Count - 1)
             {
                 lastdate = calendario.SelectedDates[i];
             }
         }
         if (fistdate == lastdate)
         {
             lastdate = Convert.ToDateTime("01/01/0001");
         }
         DtoPaciente  userPaciente = (DtoPaciente)Session["PacienteContacto"];
         ClassResultV cr           = new CtrPacienteHistoria().Usp_PacienteHistorial_SelectAll_Usuario(new DtoPacienteHistorial
         {
             PacienteId  = userPaciente.IdPaciente,
             FechaInicio = fistdate,
             FechaFin    = lastdate
         });
         if (!cr.HuboError)
         {
             listaReporte.AddRange(cr.List.Cast <DtoPacienteHistorial>());
             gvReportes.DataSource = listaReporte;
         }
         gvReportes.DataBind();
     }
     catch (Exception ex)
     {
         ScriptManager.RegisterStartupScript(this, GetType(), "Pop", @"Swal.fire('Error!', '" + "No se pudieron cargar los Reportes." + "', 'error');", true);
     }
 }
예제 #11
0
        public DtoPaciente Usp_Paciente_Insert(DtoB dtoBase)
        {
            DtoPaciente dto = (DtoPaciente)dtoBase;

            SqlParameter[] pr = new SqlParameter[11];
            try
            {
                pr[0] = new SqlParameter("@IdPaciente", SqlDbType.Int)
                {
                    Direction = ParameterDirection.Output
                };
                pr[1] = new SqlParameter("@Nombres", SqlDbType.VarChar, 100)
                {
                    Value = (V_ValidaPrNull(dto.Nombres))
                };
                pr[2] = new SqlParameter("@Apellidos", SqlDbType.VarChar, 100)
                {
                    Value = (V_ValidaPrNull(dto.Apellidos))
                };
                pr[3] = new SqlParameter("@IN_Tipodoc", SqlDbType.Int)
                {
                    Value = (V_ValidaPrNull(dto.IN_Tipodoc))
                };
                pr[4] = new SqlParameter("@Numdoc", SqlDbType.VarChar, 20)
                {
                    Value = (V_ValidaPrNull(dto.Numdoc))
                };
                pr[5] = new SqlParameter("@IN_TipoSeguro", SqlDbType.Int)
                {
                    Value = (V_ValidaPrNull(dto.IN_TipoSeguro))
                };
                pr[6] = new SqlParameter("@IN_EstadoPaciente", SqlDbType.Int)
                {
                    Value = (V_ValidaPrNull(dto.IN_EstadoPaciente))
                };
                pr[7] = new SqlParameter("@UsuarioCreacionId", SqlDbType.Int)
                {
                    Value = (V_ValidaPrNull(dto.UsuarioCreacionId))
                };
                pr[8] = new SqlParameter("@Credencial", SqlDbType.VarChar)
                {
                    Value = (V_ValidaPrNull(dto.Credencial))
                };
                pr[9] = new SqlParameter("@OrganizacionId", SqlDbType.Int)
                {
                    Value = (V_ValidaPrNull(dto.OrganizacionId))
                };
                pr[10] = new SqlParameter("@msj", SqlDbType.VarChar, 100)
                {
                    Direction = ParameterDirection.Output
                };
                SqlHelper.ExecuteNonQuery(ObjCn, CommandType.StoredProcedure, "Usp_Paciente_Insert", pr);
                if (pr[0].Value != DBNull.Value)
                {
                    dto.IdPaciente = Convert.ToInt32(pr[0].Value);
                }
                if (!String.IsNullOrEmpty(Convert.ToString(pr[10].Value)))
                {
                    dto.ErrorMsj   = Convert.ToString(pr[10].Value);
                    dto.LugarError = "Usp_Paciente_Insert";
                }
            }
            catch (Exception ex)
            {
                dto.LugarError = ex.StackTrace;
                dto.ErrorEx    = ex.Message;
                dto.ErrorMsj   = "Error al insertar Paciente";
            }
            ObjCn.Close();
            return(dto);
        }