コード例 #1
0
ファイル: InvoiceNew.cs プロジェクト: rjreeves/Vectra
 public string getCurrentAcntPeriod()
 {
     Vectra.DataSet2TableAdapters.configurationTableAdapter da = new Vectra.DataSet2TableAdapters.configurationTableAdapter();
     return da.getCurrentAcntPeriod().ToString();
 }
コード例 #2
0
ファイル: AdjustmentEdit.cs プロジェクト: rjreeves/Vectra
        private void AdjustmentEdt_Load(object sender, EventArgs e)
        {
            this.invoice_header_unpaidTableAdapter.Fill(this.dataSet2.invoice_header_unpaid);
            this.iNVOICE_HEADERTableAdapter.Fill(this.dataSet2.INVOICE_HEADER);
            this.customerTableAdapter.Fill(this.dataSet2.customer);
            this.customer_transTableAdapter.Fill(this.dataSet2.customer_trans);

            // Invoice header binding source
            invoice_header_unpaidBindingSource.Filter = String.Format("cust_id = '{0}'", ((DataRowView)customerBindingSource.DataSource).Row["cust_id"]);

            // Load the drop down list for Invoices with custom invoice list
            sqLiteConnection1.Open();
            string cmd = String.Format("select 0 invoice_number, 'Customer Level' invoice_text from customer where cust_id = '{0}'  union select invoice_number, invoice_number || ' - ' ||ifnull(docket_number,0) || ' - ' || ifnull(date(invoice_date),' ') || ' - ' || invoice_unpaid as invoice_text from invoice_header where cust_id = '{0}' and invoice_unpaid != 0 order by 1", ((DataRowView)customerBindingSource.DataSource).Row["cust_id"]);
            SQLiteDataAdapter da = new SQLiteDataAdapter(cmd, sqLiteConnection1);
            DataSet ds = new DataSet();
            da.Fill(ds, "inv");
            invoice_header_unpaidComboBox.DataSource = ds.Tables["inv"];
            invoice_header_unpaidComboBox.DisplayMember = ds.Tables["inv"].Columns[1].ToString();
            invoice_header_unpaidComboBox.ValueMember = ds.Tables["inv"].Columns[0].ToString();
            sqLiteConnection1.Close();

            // Load the drop down list for Payments with custom payments list
            sqLiteConnection1.Open();
            string cmd1 = String.Format("select 0 recpt_number, 'Customer Level' payment_text from customer where cust_id = '{0}'  union select recpt_number, recpt_number || ' - ' || ifnull(date(recpt_date), ' ') || ' - ' || amount as payment_text from INVOICE_RECIEPTS where cust_id = '{0}' and amount != 0 order by 1", ((DataRowView)customerBindingSource.DataSource).Row["cust_id"]);
            SQLiteDataAdapter da1 = new SQLiteDataAdapter(cmd1, sqLiteConnection1);
            DataSet ds1 = new DataSet();
            da1.Fill(ds1, "pay");
            paymentCB.DataSource = ds1.Tables["pay"];
            paymentCB.DisplayMember = ds1.Tables["pay"].Columns[1].ToString();
            paymentCB.ValueMember = ds1.Tables["pay"].Columns[0].ToString();
            sqLiteConnection1.Close();
            comboBox1.Text = comboBox1.Items[0].ToString();

            // Get the Current Accounting Period
            Vectra.DataSet2TableAdapters.configurationTableAdapter configDA = new Vectra.DataSet2TableAdapters.configurationTableAdapter();
            CurrentAcntPeriod =  configDA.getCurrentAcntPeriod().ToString();
        }