예제 #1
0
 public DataSet Consultar_paciente(CEpaciente opaciente)
 {
     try
     {
         ocmd.CommandType = CommandType.StoredProcedure;
         ocmd.Connection  = oconexion.conectar("BDHospital");
         ocmd.CommandText = "consultar_paciente";
         ocmd.Parameters.Add("@id_paciente", opaciente.Id_paciente);
         SqlDataAdapter da = new SqlDataAdapter(ocmd);
         DataSet        ds = new DataSet();
         da.Fill(ds);
         return(ds);
     }
     catch (Exception err)
     {
         throw new Exception(err.Message);
     }
 }
예제 #2
0
        public bool Anular_paciente(CEpaciente opaciente)// de CEpaciente recibe la información para anular paciente.
        {
            //Se realiza un crud dependiendo de los procedimientos almacenados que se han realizado, se realiza un método por cada procedimiento
            try                                                      // desactiva la recoleccion automatica de errores
            {
                ocmd.CommandType = CommandType.StoredProcedure;      // comando de sql para abrir la conexión
                ocmd.Connection  = oconexion.conectar("BDHospital"); // se emplea para conectar
                ocmd.CommandText = "anula_paciente";
                ocmd.Parameters.Add("@id_paciente", opaciente.Id_paciente);
                ocmd.ExecuteNonQuery();
                return(true);
            }


            catch (Exception err)
            {
                throw new Exception(err.Message); // solo se ejecuta si hay error
            }
        }
 public DataSet consultar_paciente(CEpaciente oentpaciente)
 {
     return(odatpaciente.Consultar_paciente(oentpaciente));
 }
 public bool anular_paciente(CEpaciente oentpaciente)
 {
     return(odatpaciente.Anular_paciente(oentpaciente));
 }
 public bool guardar_paciente(CEpaciente oentpaciente)
 {
     return(odatpaciente.Guardar_paciente(oentpaciente));
 }