Beispiel #1
0
        protected void btnExcluir_Click(object sender, EventArgs e)
        {
            //Resgata o argumento que foi configurado para cada LinkButton
            string idComandaProduto = (sender as ImageButton).CommandArgument;

            ControllerComandaProduto.deleteComandaProduto(Convert.ToInt32(idComandaProduto));

            //Muda o botão Pedido para o número de produtos no Pedido(Comanda_Produto)
            int i = ControllerComandaProduto.getNumeroProdutosNoPedido();

            Session["nComandaPedido"] = i;
            Response.Redirect("~/Mobile/Pages/Pedidos.aspx");
        }
Beispiel #2
0
        //protected void btnAddAoPedido_Click(object sender, ImageClickEventArgs e)
        //{
        //    int qtde = Convert.ToInt32(txtNumero.Text);
        //    int idProd = Convert.ToInt32(Request.QueryString["id"]);
        //    int idCurrentUser = Convert.ToInt32(Session["idCurrentUser"].ToString());
        //    int idConta = Convert.ToInt32(Session["conta"]);

        //    //Insere a Comanda_Produto
        //    ControllerComandaProduto.inserirComandaProduto(qtde, idProd, idCurrentUser, idConta);

        //    //Muda o botão Pedido para o número de produtos no Pedido(Comanda_Produto)
        //    int i = ControllerComandaProduto.getNumeroProdutosNoPedido();
        //    Session["nComandaPedido"] = i;
        //    Response.Redirect(HttpContext.Current.Request.Url.PathAndQuery);
        //}

        protected void Yes_Click(object sender, EventArgs e)
        {
            int qtde          = Convert.ToInt32(txtNumero.Text);
            int idProd        = Convert.ToInt32(Request.QueryString["id"]);
            int idCurrentUser = Convert.ToInt32(Session["idCurrentUser"].ToString());
            int idConta       = Convert.ToInt32(Session["conta"]);

            //Insere a Comanda_Produto
            ControllerComandaProduto.inserirComandaProduto(qtde, idProd, idCurrentUser, idConta);

            //Muda o botão Pedido para o número de produtos no Pedido(Comanda_Produto)
            int i = ControllerComandaProduto.getNumeroProdutosNoPedido();

            Session["nComandaPedido"] = i;
            Response.Redirect(HttpContext.Current.Request.Url.PathAndQuery);
        }
Beispiel #3
0
        protected void btnEnviarPedido_Click(object sender, ImageClickEventArgs e)
        {
            List <ComandaProduto> lcp = ControllerComandaProduto.getComandaProduto();

            //Pega o maior número de IDPedido, soma um e envia pra atualizar no
            int idPedido = ControllerComandaProduto.getMaiorPedido();

            idPedido++;

            foreach (ComandaProduto comandaProd in lcp)
            {
                ControllerComandaProduto.updateComandaProduto(comandaProd.idComandaProduto, idPedido);
            }

            //Muda o botão Pedido para o número de produtos no Pedido(Comanda_Produto)
            int i = ControllerComandaProduto.getNumeroProdutosNoPedido();

            Session["nComandaPedido"] = i;
            Response.Redirect("~/Mobile/Pages/Pedidos.aspx");
        }