I have all CRUD done, but I would like it when I click the approve button in my View where you are listing the Registered data, just change the Location property. I put it by default, so it always gets "Pending" in the ActionResult Registration .
[HttpPost]
public ActionResult Cadastrar(Reserva reserva)
{
reserva.Situacao = "Pendente";
_RRE.Inserir(reserva);
return RedirectToAction("Index");
}
So far everything is beautiful. And in My Index I put a button that sends to my ActionResult Approved . The idea would be to use the same logic, putting my Situation property to receive "Approved" when ActionResult Approved is called, but does not work. The other values come null.
[HttpPost]
public ActionResult Aprovado(Reserva item)
{
item.Situacao = "Aprovado";
if (ModelState.IsValid)
{
// TODO: Add update logic here
_RRE.Alterar(item);
return RedirectToAction("Index");
}
else
{
return View(item);
}
}
Resultaaftertheclickonthe"Approve" button
Seethatithasreceived"Approved", but the other values have been null.