コード例 #1
0
        /// <summary>
        /// Permite a impressão de DAV
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnImprimir_Click(object sender, EventArgs e)
        {
            decimal total       = Convert.ToDecimal(totalTextBox.Text);
            decimal totalAVista = Convert.ToDecimal(totalAVistaTextBox.Text);
            decimal desconto    = (1 - (totalAVista / total)) * 100;
            long    codSaida    = Convert.ToInt64(codSaidaTextBox.Text);
            bool    ehOrcamento = ((Saida)saidaBindingSource.Current).TipoSaida == Saida.TIPO_ORCAMENTO;

            FrmSaidaDAV frmSaidaDav = new FrmSaidaDAV(new HashSet <long>()
            {
                codSaida
            }, total, totalAVista, desconto, ehOrcamento);

            frmSaidaDav.ShowDialog();
            frmSaidaDav.Dispose();
        }
コード例 #2
0
        private void btnImprimir_Click(object sender, EventArgs e)
        {
            HashSet <long> codSaidas = new HashSet <long>();

            for (int i = contasPessoaDataGridView.SelectedRows.Count - 1; i >= 0; i--)
            {
                codSaidas.Add(Convert.ToInt64(contasPessoaDataGridView.SelectedRows[i].Cells[1].Value.ToString())); //pre-venda
            }

            decimal total       = Convert.ToDecimal(totalContasTextBox.Text);
            decimal totalAVista = Convert.ToDecimal(totalAVistaTextBox.Text);
            decimal desconto    = Convert.ToDecimal(descontoTextBox.Text);

            FrmSaidaDAV frmSaidaDAV = new FrmSaidaDAV(codSaidas, total, totalAVista, desconto, false);

            frmSaidaDAV.ShowDialog();
            frmSaidaDAV.Dispose();
        }