Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Código do método post de inserir a informação no bd
- [HttpPost]
- [ActionName("Create")]
- public ActionResult Create_POST(Produto produto, int Id)
- {
- if (ModelState.IsValid)
- {
- ProdutoBLL produtoBll = new ProdutoBLL();
- produto.Id = produtoBll.PesquisaId(produto);
- Session["IdProduto"] = produto.Id;
- return RedirectToAction("Catalogo", "Material", new { produto = produto.Id });
- }
- return View();
- }
- // Código do método GET que utiliza o Id que acabou de ser criado.
- [HttpGet]
- [Authorize(Roles = "Gerente,Funcionario")]
- [ActionName("Catalogo")]
- public ActionResult Catalogo(int produto, int? pag, int? mats)
- {
- material.produto = produto;
- return View(materialBll.BuscaMaterial().ToPagedList(pag ?? 1, 3));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement