コード例 #1
0
        public DataTable GetTabla(int id)
        {
            DataTable dt = new DataTable();

            try
            {
                conexion = new UConexion();
                SqlConnection con = conexion.Conexion();
                using (con)
                {
                    string query = "SELECT * FROM AlumCom where alu_ID = @alu_ID";
                    comando = new SqlCommand(query, con);
                    comando.Parameters.Add("@alu_ID", SqlDbType.Int).Value = id;
                    dt.Load(comando.ExecuteReader());
                    con.Close();
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(dt);
        }
コード例 #2
0
        public int ObtenerID(string matricula)
        {
            conexion = new UConexion();
            SqlConnection con = conexion.Conexion();
            int           id  = 0;

            using (con)
            {
                instruccion = "SELECT alu_ID from Alumno WHERE (alu_NumControl = @alu_NumControl)";
                comando     = new SqlCommand(instruccion, con);
                comando.Parameters.Add("@alu_NumControl", SqlDbType.VarChar).Value = matricula;
                SqlDataReader rd = comando.ExecuteReader();
                if (rd.HasRows)
                {
                    while (rd.Read())
                    {
                        id = rd.GetInt32(0);
                    }
                }
                conexion.Conexion().Close();
            }
            return(id);
        }
コード例 #3
0
        public DataTable GetTabla(int id)
        {
            DataTable dt = new DataTable();
            try
            {
                conexion = new UConexion();
                SqlConnection con = conexion.Conexion();
                using (con)
                {
                    string query = "SELECT * FROM Alumno INNER JOIN Especialidades ON Alumno.esp_ID=Especialidades.esp_ID ";
                    query += "WHERE alu_ID = @alu_ID";

                    comando = new SqlCommand(query, con);
                    comando.Parameters.Add("@alu_ID", SqlDbType.Int).Value = id;
                    dt.Load(comando.ExecuteReader());
                    con.Close();
                }
            }
            catch (Exception)
            {
                throw;
            }
            return dt;
        }
コード例 #4
0
        public void InsertEsc(AlumComDTO obj, int id)
        {
            conexion = new UConexion();
            using (conexion.Conexion())
            {
                int x = 0;
                comando = new SqlCommand();

                instruccion  = "INSERT INTO AlumCom (alc_PromBachi,alc_AnioTerminoBachi,mun_Escue_ID,est_Escue_ID,esc_ID,alc_EspBachill, alu_ID) VALUES ";
                instruccion += "(@alc_PromBachi,@alc_AnioTerminoBachi,@mun_Escue_ID,@est_Escue_ID,@esc_ID,@alc_EspBachill, @alu_ID) ";

                comando = new SqlCommand(instruccion, conexion.Conexion());


                comando.Parameters.Add("@alc_PromBachi", SqlDbType.VarChar).Value        = obj.alc_PromBachi;
                comando.Parameters.Add("@alc_EspBachill", SqlDbType.VarChar).Value       = obj.alc_EspBachill;
                comando.Parameters.Add("@mun_Escue_ID", SqlDbType.Int).Value             = obj.mun_Escue_ID;
                comando.Parameters.Add("@est_Escue_ID", SqlDbType.Int).Value             = obj.est_Escue_ID;
                comando.Parameters.Add("@esc_ID", SqlDbType.Int).Value                   = obj.esc_ID;
                comando.Parameters.Add("@alc_AnioTerminoBachi", SqlDbType.VarChar).Value = obj.alc_AnioTerminoBachi;
                comando.Parameters.Add("@alu_ID", SqlDbType.Int).Value                   = id;
                x = comando.ExecuteNonQuery();
            }
        }
コード例 #5
0
 public ViviendaDAOSQL()
 {
     c = new UConexion();
 }
コード例 #6
0
 public FacadeAspirante(IAspirante a)
 {
     con    = new UConexion();
     this.a = a;
 }
コード例 #7
0
 public LogInDAOSQL()
 {
     c = new UConexion();
 }
コード例 #8
0
 public IngrEgrFamiliaresDAOSQL()
 {
     c = new UConexion();
 }
コード例 #9
0
 public AntecedentesAluQL()
 {
     c = new UConexion();
 }
コード例 #10
0
 public BecasDAOSQL()
 {
     c = new UConexion();
 }
コード例 #11
0
 public EncuestasDAO()
 {
     c = new UConexion();
 }