Пример #1
0
        public Form1()
        {
            InitializeComponent();
            dataConnector = new DataConnector();

            dataConnector.OpenConnection("all");
            // Recupera os relatórios em formato Crystal Reports ( Categoria C )
            ReportingDocumentDAO        reportingDocumentDAO = new ReportingDocumentDAO(dataConnector.SqlServerConnection);
            List <ReportingDocumentDTO> reportList           = reportingDocumentDAO.GetReports("Category = 'C'");
            // Recupera dados do firebird
            ProdutoDAO               productDAO        = new ProdutoDAO(dataConnector.FirebirdConnection);
            List <ProdutoDTO>        productList       = productDAO.GetAll();
            CidadeDAO                cidadeDAO         = new CidadeDAO(dataConnector.FirebirdConnection);
            List <CidadeDTO>         cityList          = cidadeDAO.GetAll();
            FormaPagamentoDAO        formaPagamentoDAO = new FormaPagamentoDAO(dataConnector.FirebirdConnection);
            List <FormaPagamentoDTO> paymentMethodList = formaPagamentoDAO.GetAll();

            dataConnector.CloseConnection();

            cmbReport.Items.AddRange(reportList.ToArray());
            cmbReport.SelectedIndex = 0;

            cmbProduct.Items.AddRange(productList.ToArray());
            cmbProduct.SelectedIndex = 0;

            cmbCity.Items.AddRange(cityList.ToArray());
            cmbCity.SelectedIndex = 0;

            cmbPaymentMethod.Items.AddRange(paymentMethodList.ToArray());
            cmbPaymentMethod.SelectedIndex = 0;
        }
Пример #2
0
 public string[] GetUf()
 {
     return(_DAO.GetAll().Select(c => c.ESTADO).Distinct().ToArray());
 }