Exemplo n.º 1
0
        public bool ExlcuiEstoqueAposSalvar(ExcluirEstoque estoque)
        {
            try
            {

                LimparParametros();
                AdicionaParametro("@Quantidade", estoque.Quantidade);
                AdicionaParametro("@IdProduto", estoque.Id);
                if ((ExecutaComando(CommandType.StoredProcedure, "_aspExCluirEstoque")) != null)
                {

                    return true;
                }
                else
                {
                    return false;
                }

            }
            catch (Exception Erro)
            {

                throw new Exception(Erro.Message);
            }
        }
Exemplo n.º 2
0
        private void AdicionarItemsNoListBox(DataRow Linha, ValorComComanda volorComanda)
        {
            try
            {
                if (Convert.ToInt32(Linha["Quantidade"]) != 0)
                {
                    //  if ()
                    //{

                    //}
                    volorComanda.Nome = Linha["NOME"].ToString();
                    volorComanda.Id = Convert.ToInt32(Linha["ID"]);
                    exckui.Id = volorComanda.Id;
                    volorComanda.PrecoTotal = Convert.ToDouble(Linha["TOTAL"]);
                    volorComanda.Quantidade = Convert.ToInt32(Linha["Quantidade"]);
                    exckui.Quantidade = volorComanda.Quantidade;
                    lucroTotal += Convert.ToDouble(Linha["Lucro"]);
                    listExluirEstoque.Add(exckui);
                    exckui = new ExcluirEstoque();
                    string ValoresParaMostrar = volorComanda.ToString();
                    Total += volorComanda.PrecoTotal;
                    lbl_Total.Values.ExtraText = Total.ToString("C");
                    rtb_MiniRelatorio.Text += ValoresParaMostrar;
                }
                else
                {
                    volorComanda = new ValorComComanda();
                    volorComanda.Nome = Linha["NOME"].ToString();
                    volorComanda.Id = Convert.ToInt32(Linha["ID"]);
                    exckui.Id = volorComanda.Id;
                    volorComanda.PrecoTotal = Convert.ToDouble(Linha["TOTAL"]);
                    exckui.Quantidade = 0;
                    lucroTotal += Convert.ToDouble(Linha["Lucro"]);
                    listExluirEstoque.Add(exckui);
                    exckui = new ExcluirEstoque();
                    string ValoresParaMostrar = volorComanda.ToString();
                    Total += volorComanda.PrecoTotal;
                    lbl_Total.Values.ExtraText = Total.ToString("C");
                    rtb_MiniRelatorio.Text += ValoresParaMostrar;
                }

            }
            catch (Exception Erro)
            {
                LimparTxtDeCodigo();
                Message("Não Foi Possível Carregar Os Items: " + Erro, "Erro");
            }
        }