// // GET: /Pregunta/ public ActionResult ObtenerPregunta(BePregunta obj) { GestorPregunta GestorPregunta = new GestorPregunta(); ViewBag.Pregunta = obj; return(View("Pregunta")); }
public List <BePregunta> ObtenerListadoPreguntaPorCurMat(Int32 cursoid, Int32 materialid) { List <BePregunta> listado = new List <BePregunta>(); DatabaseHelper helper = null; SqlDataReader reader = null; try { helper = new DatabaseHelper(DalConexion.getConexion()); helper.AddParameter("@P_CURSOID", cursoid); helper.AddParameter("@P_MATERIALID", materialid); reader = (SqlDataReader)helper.ExecuteReader("spr_ObtenerListadoPreguntaPorCurMat", System.Data.CommandType.StoredProcedure); while (reader.Read()) { BePregunta obj = new BePregunta(); obj.id = Validacion.DBToInt32(ref reader, "preguntaid"); obj.descripcion = Validacion.DBToString(ref reader, "desc_pregunta"); listado.Add(obj); } } catch (Exception ex) { clsException localException = new clsException(ex, "DalPregunta -> ObtenerListadoPreguntaPorCurMat()"); } finally { if (helper != null) { helper.Dispose(); } } return(listado); }