コード例 #1
0
        private void createNew_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;
            switch (DataComboBox.Text)
            {
            case CustomersText:
                _ldf.AddData("code", "Customer", new CustomerForm(_session), typeof(Customer));
                break;

            case SuppliersText:
                _ldf.AddData("code", "Supplier", new SupplierForm(_session), typeof(Supplier));
                break;

            case ArticlesText:
                _ldf.AddData("code", "Article", new ArticleForm(_session), typeof(Article));
                break;

            case SalesInvoicesText:
                _ldf.AddData("InvoiceTypeAndNumber", "Sales invoice", new SalesInvoiceForm(_session), typeof(SalesInvoice));
                break;

            case BalanceSheetsText:
                _ldf.AddData("code", "Balance sheet", new GeneralLedgerForm(_session, "BAS"), typeof(GeneralLedger));
                break;

            case ProfitAndLossText:
                _ldf.AddData("code", "Profit and loss", new GeneralLedgerForm(_session, "PNL"), typeof(GeneralLedger));
                break;

            case CostCentersText:
                _ldf.AddData("code", "Cost center", new CostCenterForm(_session), typeof(CostCenter));
                break;
            }
        }