Example #1
0
        public bool Eliminar_profesor(CEprofesor e_profesor)
        {
            try
            {
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Connection  = conexion.Conectar("BDCesde");
                cmd.CommandText = "eliminar_profesor";
                cmd.Parameters.AddWithValue("@idProfesor", e_profesor.IdProfesor);

                cmd.ExecuteNonQuery();
                return(true);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
Example #2
0
 public DataSet Consultar_profesor(CEprofesor e_profesor)
 {
     try
     {
         cmd.CommandType = CommandType.StoredProcedure;
         cmd.Connection  = conexion.Conectar("BDCesde");
         cmd.CommandText = "consultar_profesor";
         cmd.Parameters.AddWithValue("@nombre", e_profesor.Nombre);
         SqlDataAdapter da = new SqlDataAdapter(cmd);
         DataSet        ds = new DataSet();
         da.Fill(ds);
         return(ds);
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Example #3
0
        public bool IngresarActualizar_profesor(CEprofesor e_profesor)
        {
            try
            {
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Connection  = conexion.Conectar("BDCesde");
                cmd.CommandText = "ingresarActualizar_profesor";
                cmd.Parameters.AddWithValue("@idProfesor", e_profesor.IdProfesor);
                cmd.Parameters.AddWithValue("@nombre", e_profesor.Nombre);
                cmd.Parameters.AddWithValue("@apellido", e_profesor.Apellido);
                cmd.Parameters.AddWithValue("@sexo", e_profesor.Sexo);
                cmd.Parameters.AddWithValue("@direccion", e_profesor.Direccion);
                cmd.Parameters.AddWithValue("@telefono", e_profesor.Telefono);
                cmd.Parameters.AddWithValue("@especialidad", e_profesor.Especialidad);

                cmd.ExecuteNonQuery();
                return(true);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
Example #4
0
 public DataSet Consultar_profesor(CEprofesor e_profesor)
 {
     return(d_profesor.Consultar_profesor(e_profesor));
 }
Example #5
0
 public bool Eliminar_profesor(CEprofesor e_profesor)
 {
     return(d_profesor.Eliminar_profesor(e_profesor));
 }
Example #6
0
 public bool IngresarActualizar_profesor(CEprofesor e_profesor)
 {
     return(d_profesor.IngresarActualizar_profesor(e_profesor));
 }