// GET: DetalhePedido
        public ActionResult Index(int?id)
        {
            try {
                if (Session["idUsuario"] == null)
                {
                    return(RedirectToAction("Index", "Entrar"));
                }
                if (id == null || !(id is int))
                {
                    return(RedirectToAction("Index", "MeusPedidos"));
                }

                BDConexao conexao = new BDConexao();
                conexao.connection.Open();
                conexao.command.CommandText = "SELECT * FROM PEDIDO WHERE idPedido = @IDPEDIDO AND IDCLIENTE = @IDCLIENTE";
                conexao.command.Parameters.Clear();
                conexao.command.Parameters.Add("@IDPEDIDO", System.Data.SqlDbType.Int).Value  = id;
                conexao.command.Parameters.Add("@IDCLIENTE", System.Data.SqlDbType.Int).Value = (int)Session["idUsuario"];

                VisaoGeral visao = new VisaoGeral();

                visao.DetalhePedido((int)id);

                return(View(visao));
            }
            catch
            {
                return(RedirectToAction("Index", "Ops"));
            }
        }
        // GET: VisaoGeralCompra
        public ActionResult Index()
        {
            try {
                if (Session["TipoDePagamento"] == null || Session["idUsuario"] == null || Session["idEndereco"] == null)
                {
                    return(RedirectToAction("Index", "Entrar"));
                }

                VisaoGeral visaoGeral = new VisaoGeral();
                visaoGeral.CompraVisaoGeral();
                return(View(visaoGeral));
            }
            catch {
                return(RedirectToAction("Index", "Ops"));
            }
        }
Beispiel #3
0
        private void menuItem3_Click(object sender, EventArgs e)
        {
            VisaoGeral vg = new VisaoGeral();

            vg.Show();
        }