Beispiel #1
0
 public void eliminarPreguntaPorPrueba(int pid)
 {
     PreguntasPorPrueba preguntaPorPrueba = new PreguntasPorPrueba{Id = pid};
     UoW.PreguntaPorPruebaRepository.Delete(preguntaPorPrueba);
 }
Beispiel #2
0
 public void registrarPreguntaPorPrueba(int idPrueba, int idPregunta)
 {
     PreguntasPorPrueba preguntaPorPrueba = new PreguntasPorPrueba(idPrueba,idPregunta);
     UoW.PreguntaPorPruebaRepository.Insert(preguntaPorPrueba);
 }
 public void Delete(PreguntasPorPrueba entity)
 {
     _deleteItems.Add(entity);
 }
        private void InsertPreguntasPorPrueba(PreguntasPorPrueba preguntaPorPrueba)
        {
            try
            {
                SqlCommand cmd = new SqlCommand();
                cmd.Parameters.Add(new SqlParameter("@id_prueba", preguntaPorPrueba.IdPrueba));
                cmd.Parameters.Add(new SqlParameter("@id_pregunta", preguntaPorPrueba.IdPregunta));
                DBAccess.ExecuteSPNonQuery(cmd, "USP_PreguntasPorPrueba_Insert");

            }
            catch (SqlException ex)
            {

                    //logear la excepcion a la bd con un Exceptionv
                throw new DataAccessException("Ha ocurrido un error al registrar una Pregunta", ex);

            }
            catch (Exception ex)
            {
                //logear la excepcion a la bd con un Exception
                throw new DataAccessException("Ha ocurrido un error al registrar una Pregunta", ex);
            }
        }
        private void DeletePreguntasPorPrueba(PreguntasPorPrueba preguntaPorPrueba)
        {
            try
            {
                SqlCommand cmd = new SqlCommand();
                cmd.Parameters.Add(new SqlParameter("@id_pregunta_prueba", preguntaPorPrueba.Id));
                DataSet ds = DBAccess.ExecuteSPWithDS(cmd, "USP_PreguntasPorPrueba_Delete");

            }
            catch (SqlException ex)
            {
                //logear la excepcion a la bd con un Exception
                throw new DataAccessException("Ha ocurrido un error al eliminar una Pregunta", ex);

            }
            catch (Exception ex)
            {
                //logear la excepcion a la bd con un Exception
                throw new DataAccessException("Ha ocurrido un error al eliminar una Pregunta", ex);
            }
        }
 public void Update(PreguntasPorPrueba entity)
 {
     _updateItems.Add(entity);
 }
 public void Insert(PreguntasPorPrueba entity)
 {
     _insertItems.Add(entity);
 }