public ActionResult Detalhes(int?id) { if (id == null) { return(View("Error")); } try { if (!UsuarioEstaLogado) { return(RedirectToAction("Index", "Login")); } return(View(_pedidoBo.GetById((int)id))); } catch (BoException exception) { ErroMessage = exception.Message; return(View()); } catch (Exception exception) { LogMessage = exception; return(View("Error")); } }
public ActionResult Pagamento() { if (!UsuarioEstaLogado) { ErroMessage = "Voce precisa entrar"; return(RedirectToAction("Index", "Home")); } if (TempData["pedidoId"] == null) { ErroMessage = "Erro ao carregar, verifique seus pedidos"; return(RedirectToAction("Index", "Home")); } try { return(View(_pedidoBo.GetById((int)TempData["pedidoId"]))); } catch (BoException boException) { ErroMessage = boException.Message; return(View()); } catch (Exception exception) { LogMessage = exception; return(View("Error")); } }