0
I got all the CRUD done, but I wish when I click the button "approve" in my View where you are listing Registered Data, change only the property Situation. I put by default, so she always gets "Pending" on Actionresult Registration.
[HttpPost]
public ActionResult Cadastrar(Reserva reserva)
{
reserva.Situacao = "Pendente";
_RRE.Inserir(reserva);
return RedirectToAction("Index");
}
So far so good. And in My Index I put a button that sends to my Actionresult Approved. The idea would be to use the same logic, placing for my property Situation receive "Approved" when the 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);
}
}
Result after clicking on "Approve"
Note that he received "Approved", but the other values came null.
Leandro, but in the creation of Action, I’m doing it right ?
– Cesar Alves Pereira