protected void Preparado_Click(object sender, ImageClickEventArgs e)
        {
            string idPedido = (sender as ImageButton).CommandArgument;

            ControllerComandaProduto.updateStatusComandaProdutoCozinha(Convert.ToInt32(idPedido));
            Response.Redirect("~/Admin/webPages/pedidosCozinha.aspx");
        }
Beispiel #2
0
        public void adicionarComanda()
        {
            List <Comanda> lc = ControllerComanda.getComanda();

            foreach (Comanda comanda in lc)
            {
                HtmlTable table = new HtmlTable();
                table.Attributes.Add("class", "tableCriarComandas");

                HtmlTableRow tr = new HtmlTableRow();

                HtmlTableCell td = new HtmlTableCell();

                HtmlTableCell td2 = new HtmlTableCell();
                td2.Attributes.Add("class", "tdBtnExcluir");

                ImageButton imgBtn = new ImageButton();
                imgBtn.Click          += btnExcluir_Click;
                imgBtn.CommandArgument = comanda.idComanda.ToString();

                if (ControllerComandaProduto.checarComandaProduto(comanda.idComanda) == 0)
                {
                    imgBtn.ImageUrl = "~/Mobile/images/paginaComandas/btnDecline.fw.png";
                }
                else
                {
                    imgBtn.ImageUrl = "~/Mobile/images/paginaComandas/btnDecline2.fw.png";
                }

                Button bt = new Button();
                bt.Text     = comanda.nome_Pessoa;
                bt.CssClass = "botoes";
                bt.Click   += btnNome1_Click;
                //Você envia como argumento o ID da comanda atual PARA O EVENTO DE CLICK QUE FOI CRIADO LÁ EM BAIXO
                bt.CommandArgument = comanda.idComanda.ToString();

                bt.PostBackUrl = "~/Mobile/Pages/paginaComandas.aspx";
                //bt.PostBackUrl = "~/Mobile/Pages/produtosCategoria.aspx?currentUser=" + comanda.nome_Pessoa;

                td.Controls.Add(bt);
                td2.Controls.Add(imgBtn);

                tr.Controls.Add(td);
                tr.Controls.Add(td2);

                table.Controls.Add(tr);

                lblComandas.Controls.Add(table);
            }

            txtNome.Focus();
        }
Beispiel #3
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 #4
0
        protected void btnExcluir_Click(object sender, EventArgs e)
        {
            string idComanda = (sender as ImageButton).CommandArgument;

            if (ControllerComandaProduto.checarComandaProduto(Convert.ToInt32(idComanda)) == 0)
            {
                ControllerComanda.deleteComanda(Convert.ToInt32(idComanda));
                Response.Redirect("~/Mobile/Pages/paginaComandas.aspx");
            }
            else
            {
                //MessageBox falando que essa comanda já fez pedidos!
            }
        }
Beispiel #5
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 #6
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");
        }
        public void Fill_Page()
        {
            List <int> lstIdPedido = ControllerComandaProduto.getIdPedido();

            foreach (int mp in lstIdPedido)
            {
                HtmlTable table = new HtmlTable();
                table.Attributes.Add("class", "tableCozinha");

                //
                HtmlTableRow tr = new HtmlTableRow();

                HtmlTableCell td = new HtmlTableCell();
                td.Attributes.Add("class", "tdMesa");
                td.ColSpan = 2;


                tr.Controls.Add(td);
                //

                //
                HtmlTableRow tr2 = new HtmlTableRow();

                HtmlTableCell td2 = new HtmlTableCell();
                td2.ColSpan = 2;

                ImageButton imgBtn = new ImageButton();
                imgBtn.ImageUrl        = "~/Admin/srcs/btnPreparado2.fw.png";
                imgBtn.ID              = mp.ToString();
                imgBtn.Click          += Preparado_Click;
                imgBtn.CommandArgument = mp.ToString();

                td2.Controls.Add(imgBtn);

                tr2.Controls.Add(td2);
                //

                table.Controls.Add(tr);
                table.Controls.Add(tr2);

                List <ModelPedido> ped = ControllerComandaProduto.getProdutosPedido(mp);

                foreach (ModelPedido pedido in ped)
                {
                    td.InnerText = "Mesa " + pedido.idMesa; //Nome da mesa aqui

                    //------------Td que será dinamicamente criada

                    HtmlTableRow tr3 = new HtmlTableRow();

                    HtmlTableCell td3 = new HtmlTableCell();
                    td3.InnerText = pedido.nome_Produto; //NOME PRODUTO

                    HtmlTableCell td4 = new HtmlTableCell();
                    td4.InnerText = pedido.qtdeItemComanda.ToString(); //QTDE PRODUTO

                    tr3.Controls.Add(td3);
                    tr3.Controls.Add(td4);

                    table.Controls.Add(tr3);
                }
                lblTable.Controls.Add(table);
            }
        }
Beispiel #8
0
        public void Fill_Page()
        {
            List <Comanda> lc = ControllerComanda.getComandaConta();

            foreach (Comanda comanda in lc)
            {
                HtmlTable table = new HtmlTable();
                table.Attributes.Add("class", "tabelaConta");

                //--------------------------------------- Padrão, vai ter que ser criado em toda tabela
                HtmlTableRow  tr1 = new HtmlTableRow();
                HtmlTableCell td1 = new HtmlTableCell();
                td1.Attributes.Add("class", "tdNome");
                td1.ColSpan   = 2;
                td1.InnerText = comanda.nome_Pessoa; //Colocar o nome da comanda

                tr1.Controls.Add(td1);
                table.Controls.Add(tr1);
                //-----------------------------------------

                List <ModelPedido> lmp = ControllerConta.getModelConta(comanda.idComanda);

                foreach (ModelPedido modelPedido in lmp)
                {
                    //----------------------------------------- Criar um foreach para pegar os Produtos comanda
                    HtmlTableRow  tr2 = new HtmlTableRow();
                    HtmlTableCell td2 = new HtmlTableCell();
                    td2.Attributes.Add("class", "auto-style1");
                    td2.InnerText = modelPedido.nome_Produto + " - " + modelPedido.qtdeItemComanda + " unid"; //Colocar o nome do Produto e a quantidade

                    HtmlTableCell td3 = new HtmlTableCell();
                    td3.InnerText = "R$ " + modelPedido.valorComandaProduto.ToString("F"); //Colcoar o valor da linha da ProdutoComanda

                    tr2.Controls.Add(td2);
                    tr2.Controls.Add(td3);


                    table.Controls.Add(tr2);
                    //------------------------------------------
                }
                lblTexto.Controls.Add(table);
            }

            //<=========================================== Parte da Comanda(Nome e preço) ========>

            List <Comanda> lc2 = ControllerComanda.getComandaByStatus();

            foreach (Comanda comanda in lc2)
            {
                HtmlTable table = new HtmlTable();
                table.Attributes.Add("class", "tabelaContaComanda");

                HtmlTableRow tr = new HtmlTableRow();

                HtmlTableCell td1 = new HtmlTableCell();
                td1.Attributes.Add("class", "nomePreco");
                td1.InnerText = comanda.nome_Pessoa + " - R$ " + comanda.valor_Total.ToString("F"); //Nome e valor total da comanda

                HtmlTableCell td2 = new HtmlTableCell();

                //Se estiverem logado como conta única o botão de fechamento de comanda única não será criado
                if (comanda.nome_Pessoa != "Mesa " + Session["idMesa"].ToString())
                {
                    //ImageButton btnComanda = new ImageButton();
                    //btnComanda.ImageUrl = "~/Mobile/images/conta/btnAccept.fw.png";
                    //btnComanda.Click += btnComanda_Click;
                    //btnComanda.CommandArgument = comanda.idComanda.ToString(); //Envia o id pelo parametro

                    //Se o numero de comandas for maior que 1 ela cria os botões
                    if (ControllerComandaProduto.checarComandas() > 1)
                    {
                        //-------------------- Imagem criada pra usar o javascript
                        Image img = new Image();
                        img.ID = comanda.idComanda.ToString();
                        if (ControllerComandaProduto.getNumeroComandaPedidoById(Convert.ToInt32(comanda.idComanda)) > 0)
                        {
                            img.ImageUrl = "~/Mobile/images/conta/btnAccept2.fw.png";
                        }
                        else
                        {
                            img.ImageUrl = "~/Mobile/images/conta/btnAccept.fw.png";
                            img.CssClass = "btnFinalizar_Click";
                        }
                        //--------------------
                        td2.Controls.Add(img);
                    }
                }

                tr.Controls.Add(td1);
                tr.Controls.Add(td2);

                table.Controls.Add(tr);

                lblComandaConta.Controls.Add(table);

                //-------------------------- Parte do botão dinamico da msgbox

                ImageButton imgBtnMsgBox = new ImageButton();
                imgBtnMsgBox.ID       = "btn" + comanda.idComanda.ToString();
                imgBtnMsgBox.ImageUrl = "~/Mobile/images/msgBox/btnOk.fw.png";
                //imgBtnMsgBox.Attributes.Add("class", "btnOkBox");
                imgBtnMsgBox.Attributes.Add("class", "btnOkBox hidden btnContentMain_" + comanda.idComanda.ToString());
                //imgBtnMsgBox.Attributes.Add("class", "btnContentMain_" + comanda.idComanda.ToString());
                imgBtnMsgBox.Click          += btnComanda_Click;
                imgBtnMsgBox.CommandArgument = comanda.idComanda.ToString();

                msgBoxProduto.Controls.Add(imgBtnMsgBox);
            }
        }
Beispiel #9
0
        public void Fill_Page()
        {
            List <ModelPedido> lmp = ControllerComandaProduto.getModelPedido();

            foreach (ModelPedido modelPedido in lmp)
            {
                //
                HtmlTable table = new HtmlTable();
                table.Attributes.Add("class", "tablePedido");

                HtmlTableRow  tr  = new HtmlTableRow();
                HtmlTableCell td1 = new HtmlTableCell();
                td1.Attributes.Add("class", "nomeUserTeste");
                td1.ColSpan   = 2;
                td1.InnerText = modelPedido.nome_Pessoa;//Deve inserir o nome do usuário, pegar pelo inner join

                HtmlTableCell tdX = new HtmlTableCell();
                tdX.Attributes.Add("class", "nomeUserTeste");
                tdX.Width = "50px";

                ImageButton ib = new ImageButton();
                ib.ImageUrl        = "~/Mobile/images/paginaPedidos/btnExcluirPequeno.fw.png";
                ib.Click          += btnExcluir_Click;
                ib.CommandArgument = modelPedido.idComandaProduto.ToString(); //coloco como argumento o ID do Produto_Comanda

                tdX.Controls.Add(ib);

                tr.Cells.Add(td1);
                tr.Cells.Add(tdX);
                //


                //
                HtmlImage img = new HtmlImage();
                img.Attributes.Add("class", "imagemProduto");
                img.Src = modelPedido.imagem; //Imagem do Produto, pegar pelo inner join

                HtmlTableRow  tr2 = new HtmlTableRow();
                HtmlTableCell td2 = new HtmlTableCell();
                td2.RowSpan = 3;
                td2.Attributes.Add("class", "auto-style2");
                td2.Controls.Add(img);

                HtmlTableCell td3 = new HtmlTableCell();
                td2.Attributes.Add("class", "auto-style3");
                td3.ColSpan   = 2;
                td3.InnerText = modelPedido.nome_Produto; //Nome do Produto, pegar pelo inner join

                tr2.Cells.Add(td2);
                tr2.Cells.Add(td3);
                //


                //
                HtmlTableRow  tr3 = new HtmlTableRow();
                HtmlTableCell td4 = new HtmlTableCell();
                td4.Attributes.Add("class", "auto-style3");
                td4.InnerText = "Qtde: " + modelPedido.qtdeItemComanda.ToString(); //Quantidade de itens na Comanda_Produto
                td4.ColSpan   = 2;
                tr3.Cells.Add(td4);
                //

                //
                HtmlTableRow  tr4 = new HtmlTableRow();
                HtmlTableCell td5 = new HtmlTableCell();
                td5.Attributes.Add("class", "auto-style3");
                td5.InnerText = "R$ " + modelPedido.valorComandaProduto.ToString("F"); //Preço do produto (Qtde * Preço - pegar BD)
                tr4.Cells.Add(td5);
                //

                table.Rows.Add(tr);
                table.Rows.Add(tr2);
                table.Rows.Add(tr3);
                table.Rows.Add(tr4);

                lblTexto.Controls.Add(table);
            }

            //-------------------------------Parte dos Nomes da Barra
            List <ModelPedido> lpc = ControllerComandaProduto.getNomePrecoComanda();

            foreach (ModelPedido modelPedido in lpc)
            {
                HtmlGenericControl li = new HtmlGenericControl("li");
                li.InnerText = modelPedido.nome_Pessoa + " - R$ " + modelPedido.somaProdutoNoPedido.ToString("F");
                ulNomesPedidos.Controls.Add(li);
            }
        }