public List <OfertaEmpleo> GetAllOfertas() { List <OfertaEmpleo> result = new List <OfertaEmpleo>(); dtsOfertaEmpleo dts = new dtsOfertaEmpleo(); dtsOfertaEmpleo.OfertasEmpleoDataTable dt = (dtsOfertaEmpleo.OfertasEmpleoDataTable)Repo.Leer(dts.OfertasEmpleo); int i = 0; foreach (DataRow dtRow in dt) { OfertaEmpleo oferta = new OfertaEmpleo(); oferta = MappingOfertaEmpleo.ToOfertaEmpleo(dt, i); result.Add(oferta); i++; } return(result); }
/// <summary> /// Obtiene un objeto EmpleadorModel (llamando al procedimiento 'pEmpleadosLectura') a partir de una id ofrecida por parámetro. /// </summary> /// <param name="id"></param> /// <returns>Devuelve un objeto EmpleadorModel</returns> public List <OfertaEmpleo> GetOfertasNOInscritasByDemandanteId(int id) { dtsOfertaEmpleo dts = new dtsOfertaEmpleo(); SqlParameter param = new SqlParameter("@idDemandante", id); dts.Merge(this.Repo.Leer("pObtenerOfertasNoInscrito", CommandType.StoredProcedure, dts.OfertasEmpleo.TableName, param)); List <OfertaEmpleo> result = new List <OfertaEmpleo>(); int i = 0; foreach (DataRow dtRow in dts.OfertasEmpleo) { OfertaEmpleo oferta = new OfertaEmpleo(); oferta = MappingOfertaEmpleo.ToOfertaEmpleo(dts.OfertasEmpleo, i); result.Add(oferta); i++; } return(result); }
public List <OfertaEmpleo> GetOfertasDeEmpleador(int idEmpleador) { List <OfertaEmpleo> result = new List <OfertaEmpleo>(); dtsOfertaEmpleo dts = new dtsOfertaEmpleo(); Dictionary <DataColumn, Object> parametros = new Dictionary <DataColumn, object>(); parametros.Add(dts.OfertasEmpleo.IdEmpleadorColumn, idEmpleador); dts.Merge(Repo.Leer(dts.OfertasEmpleo, parametros)); for (int i = 0; i < dts.OfertasEmpleo.Rows.Count; i++) { OfertaEmpleo oferta = MappingOfertaEmpleo.ToOfertaEmpleo(dts.OfertasEmpleo, i); result.Add(oferta); } return(result); }
public JsonResult Acciones(OfertaEmpleo modelo) { mRespuestaAjax = new RespuestaServidor(); if (ModelState.IsValid) { bool result = false; result = modelo.SetOferta(); if (result) { mRespuestaAjax.SetResponse(true, "Ok"); mRespuestaAjax.href = Url.Action(""); } else { mRespuestaAjax.SetResponse(false, "Error de acceso a la Base de Datos"); } } else { mRespuestaAjax.SetResponse(false, "Los campos marcados con * son obligatorios"); } return(Json(mRespuestaAjax)); }
public ActionResult Acciones(int id = 0) { if (id == 0) { mOferta.id = 0; mOferta.Usuario_id = SesionHelper.GetUser(); ViewBag.Title = "Nueva Oferta de empleo"; } else { ViewBag.Title = "Modificar Oferta"; mOferta = mOferta.GetOferta(id); // Solo puedo leer mis ofertas if (mOferta == null) { return(RedirectToAction("Index")); } } ViewBag.LPago = mEstado.GetPago(); ViewBag.LModoPago = mEstado.GetModoPago(); ViewBag.LCategoria = mCategoria.GetListado(); return(View(mOferta)); }