Example #1
0
        private void imprimirPromissoria(int idparcela)
        {
            //FImprimirPromissoria fi = new FImprimirPromissoria(idparcela);
            // fi.ShowDialog();
            return;

            DataTable     dt;
            CContaReceber creceber = new CContaReceber();
            CVenda        cvenda   = new CVenda();

            cvenda.pesquisarvendaIdVenda(idvenda);

            int    i     = 0;
            string texto = @"
            <html xmlns='http://www.w3.org/1999/xhtml' xml:lang='pt-br'>
            <head>
            <meta charset='UTF-8'>
            <title>Promissória</title>

            </head>
            <body>
            <div style='width:1024px;margin:0 auto'>
                
                <h1 style='border:1px solid black;background-color:highlight;text-align:center'>Relatório de Clientes</h1><br>
                <div style='width:100%;text-align:center'>" + DateTime.Today.ToLongDateString() + " - " + DateTime.Now.ToLongTimeString(); texto += @"</div>
                <br>
                <table>
                <tr style='font-size:20px;font-weight:bolder'><td width='230px'>Nome</td><td width='230px'>Endereço</td><td width='80px'>Número</td><td width='200px'>Bairro</td><td width='110px'>Telefone</td><td width='110px'>Telefone</td><td width='110px'>Telefone</td></tr>
                </table>
                <hr />
                " +

                                                                                                                                                    "<table>";
            //for (i = 0; i < dt.Rows.Count; i++)
            //  {
            // texto += "<tr "; if (i % 2 == 0) texto += "style='background-color:silver'"; texto += "><td  style='border-bottom:1px solid black'  style='border-bottom:1px solid black' width='230px'>" + dt.Rows[i]["cli_nome"].ToString() + "</td  style='border-bottom:1px solid black'  style='border-bottom:1px solid black'><td  style='border-bottom:1px solid black' width='230px'>" + dt.Rows[i]["cli_endereco"].ToString() + "</td  style='border-bottom:1px solid black'><td  style='border-bottom:1px solid black' width='80px'>" + dt.Rows[i]["cli_numero"].ToString() + "</td  style='border-bottom:1px solid black'><td  style='border-bottom:1px solid black' width='200px'>" + dt.Rows[i]["cli_bairro"].ToString() + "</td  style='border-bottom:1px solid black'><td  style='border-bottom:1px solid black' width='110px'>" + dt.Rows[i]["cli_ddd1"].ToString() + ' ' + dt.Rows[i]["cli_telefone1"].ToString() + "</td  style='border-bottom:1px solid black'><td  style='border-bottom:1px solid black' width='110px'>" + dt.Rows[i]["cli_ddd2"].ToString() + ' ' + dt.Rows[i]["cli_telefone2"].ToString() + "</td  style='border-bottom:1px solid black'><td  style='border-bottom:1px solid black' width='110px'>" + dt.Rows[i]["cli_ddd3"].ToString() + ' ' + dt.Rows[i]["cli_telefone3"].ToString() + "</td></tr>";
            //   }
            texto += "</table>"
                     + @"
                
            </div>
            </body>
            </html>";

            File.Create(Application.StartupPath + "\\RelPromissoria.html").Close();
            TextWriter f = File.AppendText(Application.StartupPath + "\\RelPromissoria.html");

            f.Write(texto);
            f.Close();
            System.Diagnostics.Process.Start(Application.StartupPath + "\\RelPromissoria.html");
        }
Example #2
0
        private void btnexcluir_Click(object sender, EventArgs e)
        {
            if (id > 0)
            {
                if (MessageBox.Show("Deseja Excluir?", "Excluir!", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    CCliente  c     = new CCliente();
                    CVenda    venda = new CVenda();
                    DataTable dt    = new DataTable();
                    dt = venda.pesquisarIDCliente(id);
                    if (dt.Rows.Count > 0)
                    {
                        MessageBox.Show("Não foi possivel efetuar a exclusão!");
                        return;
                    }
                    CVenda creceber = new CVenda();
                    dt = new DataTable();
                    dt = creceber.pesquisarIDCliente(id);
                    if (dt.Rows.Count > 0)
                    {
                        MessageBox.Show("Não foi possivel efetuar a exclusão!");
                        return;
                    }

                    if (c.excluircliente(id))
                    {
                        limpar();
                        leitura();
                        MessageBox.Show("Excluído com sucesso!");
                    }
                    else
                    {
                        MessageBox.Show("Não foi possivel efetuar a exclusão!");
                    }
                }
            }
            else
            {
                MessageBox.Show("Selecione um cliente para excluir!");
            }
        }