Exemplo n.º 1
0
        private void FrmMain_Shown(object sender, EventArgs e)
        {
            cmbTipoInscricao.EnumDataSource(ACBrPessoa.pJuridica);
            cmbTipoDocumento.EnumDataSource(ACBrTipoDocumento.Tradicional);
            cmbTipoCarteira.EnumDataSource(ACBrTipoCarteira.tctSimples);
            cmbModeloImpressao.EnumDataSource(ACBrBolLayOut.lPadrao);
            cmbBanco.EnumDataSource(ACBrTipoCobranca.cobNenhum);
            cmbRespEmissao.EnumDataSource(ACBrResponEmissao.tbCliEmite);
            cmbLayoutCNAB.EnumDataSource(ACBrLayoutRemessa.c240);

            foreach (string printer in PrinterSettings.InstalledPrinters)
            {
                cmbImpressora.Items.Add(printer);
            }

            if (PrinterSettings.InstalledPrinters.Count > 0)
            {
                cmbImpressora.SelectedIndex = 0;
            }

            // Altera as config de log
            boleto.ConfigGravarValor(ACBrSessao.Principal, "LogNivel", NivelLog.logParanoico);

            var logPath = Path.Combine(Application.StartupPath, "Docs");

            if (!Directory.Exists(logPath))
            {
                Directory.CreateDirectory(logPath);
            }

            boleto.ConfigGravarValor(ACBrSessao.Principal, "LogPath", logPath);
            boleto.ConfigGravar();

            LoadConfig();
        }