Esempio n. 1
0
        public OutGetResumenRegistrosHistorial GetResumenRegistrosHistorial(InGetRegistrosHistorial Input)
        {
            //var response = new ResponseServices<List<MasterBue>>();

            var connectionString = ConfigurationManager.ConnectionStrings["AbcMedicalContext"].ConnectionString;
            var response         = new OutGetResumenRegistrosHistorial();

            try
            {
                var conn = new MySqlConnection(connectionString);


                conn.Open();
                MySqlCommand command = new MySqlCommand();
                command.CommandTimeout = 0;
                command.Connection     = conn;

                var PI_PacienteId = new MySqlParameter("_PacienteId", Input.PacienteId);
                command.Parameters.Add(PI_PacienteId);

                command.CommandText = "getResumenRegistrosHistorial";
                command.CommandType = CommandType.StoredProcedure;

                MySqlDataReader datos = command.ExecuteReader();

                var list = new List <ResumenRegistroHistorial>();
                while (datos.Read())
                {
                    var master = new ResumenRegistroHistorial
                    {
                        RegistroClinicoId = datos["RegistroClinicoId"].ToString(),
                        RegistroClinico   = datos["RegistroClinico"].ToString(),
                        Cantidad          = datos["Cantidad"].ToString()
                    };
                    list.Add(master);
                }
                response.ResumenRegistroHistorial = list;
                response.State   = true;
                response.Message = "OK";
                datos.Close();
                command.Dispose();
                conn.Dispose();
            }
            catch (Exception ex)
            {
                response.State   = false;
                response.Message = ex.Message;
            }
            return(response);
        }
Esempio n. 2
0
        public OutGetRegistrosHistorial getHistorialRegistros(InGetRegistrosHistorial Input)
        {
            var response = new OutGetRegistrosHistorial();

            try
            {
                var dal = new  HistoriaDAL();
                response = dal.GetRegistrosHistorial(Input);
            }
            catch (Exception ex)
            {
                response.State   = false;
                response.Message = ex.Message;
            }

            return(response);
        }
Esempio n. 3
0
        public OutGetRegistrosHistorial GetRegistrosHistorial(InGetRegistrosHistorial Input)
        {
            //var response = new ResponseServices<List<MasterBue>>();

            var connectionString = ConfigurationManager.ConnectionStrings["AbcMedicalContext"].ConnectionString;
            var response         = new OutGetRegistrosHistorial();

            try
            {
                var conn = new MySqlConnection(connectionString);


                conn.Open();
                MySqlCommand command = new MySqlCommand();
                command.CommandTimeout = 0;
                command.Connection     = conn;

                var PI_PacienteId        = new MySqlParameter("_PacienteId", Input.PacienteId);
                var PI_RegistroClinicoId = new MySqlParameter("_registroClinicoId", Input.RegistroClinicoId);
                command.Parameters.Add(PI_PacienteId);
                command.Parameters.Add(PI_RegistroClinicoId);

                command.CommandText = "getRegistrosHistorial";
                command.CommandType = CommandType.StoredProcedure;

                MySqlDataReader datos = command.ExecuteReader();

                var list       = new List <RegistroHistorial>();
                int numeroFila = 0;
                while (datos.Read())
                {
                    if (numeroFila == 1)
                    {
                        numeroFila = 2;
                    }
                    else
                    {
                        numeroFila = 1;
                    }
                    var master = new RegistroHistorial
                    {
                        NumeroFila         = numeroFila,
                        RegistroHistoriaId = datos["RegistroHistoriaId"].ToString(),
                        Asunto             = datos["Asunto"].ToString(),
                        Fecha           = datos["Fecha"].ToString().Substring(0, 10),
                        Hora            = datos["Hora"].ToString(),
                        Profesional     = datos["Profesional"].ToString(),
                        RegistroClinico = datos["RegistroClinico"].ToString()
                    };
                    list.Add(master);
                }
                response.RegistrosHistorial = list.OrderByDescending(x => x.RegistroHistoriaId).ToList();
                response.State   = true;
                response.Message = "OK";
                datos.Close();
                command.Dispose();
                conn.Dispose();
            }
            catch (Exception ex)
            {
                response.State   = false;
                response.Message = ex.Message;
            }
            return(response);
        }
        public IHttpActionResult getResumenHistorialRegistros([FromBody] InGetRegistrosHistorial Input)
        {
            var action = new RegistroHistoriaAction();

            return(Ok(action.getResumenHistorialRegistros(Input)));
        }