コード例 #1
0
        private void SetAccountSource(BankStatementLineGridClient rec)
        {
            SQLCache cache;

            switch (rec._AccountType)
            {
            case (byte)GLJournalAccountType.Finans:
                cache = LedgerCache;
                break;

            case (byte)GLJournalAccountType.Debtor:
                cache = DebtorCache;
                break;

            case (byte)GLJournalAccountType.Creditor:
                cache = CreditorCache;
                break;

            default: return;
            }

            if (cache != null)
            {
                int ver = cache.version + 10000 * (rec._AccountType + 1);
                if (ver != rec.AccountVersion)
                {
                    rec.AccountVersion = ver;
                    rec.accntSource    = cache.GetNotNullArray;
                    rec.NotifyPropertyChanged("AccountSource");
                }
            }
        }
コード例 #2
0
        DCAccount copyDCAccount(BankStatementLineGridClient rec, GLJournalAccountType type, string Acc)
        {
            var dc = getDCAccount(type, Acc);

            if (dc == null)
            {
                return(null);
            }
            if (dc._Dim1 != null)
            {
                rec.Dimension1 = dc._Dim1;
            }
            if (dc._Dim1 != null)
            {
                rec.Dimension2 = dc._Dim2;
            }
            if (dc._Dim1 != null)
            {
                rec.Dimension3 = dc._Dim3;
            }
            if (dc._Dim1 != null)
            {
                rec.Dimension4 = dc._Dim4;
            }
            if (dc._Dim1 != null)
            {
                rec.Dimension5 = dc._Dim5;
            }
            return(dc);
        }
コード例 #3
0
        async void GetSearchOpenInvoice(BankStatementLineGridClient line, GLJournalAccountType type)
        {
            InvoiceAPI InvApi     = new InvoiceAPI(api);
            string     strAccount = (string)await InvApi.SearchOpenInvoice(type, line._Invoice);

            if (strAccount != null)
            {
                line.Account = strAccount;
            }
        }
コード例 #4
0
        private void Account_GotFocus(object sender, RoutedEventArgs e)
        {
            BankStatementLineGridClient selectedItem = dgBankStatementLine.SelectedItem as BankStatementLineGridClient;

            if (selectedItem != null)
            {
                SetAccountSource(selectedItem);
                if (prevAccount != null)
                {
                    prevAccount.isValidate = false;
                }
                var editor = (CorasauGridLookupEditorClient)sender;
                prevAccount       = editor;
                editor.isValidate = true;
            }
        }
コード例 #5
0
        void DataControl_CurrentItemChanged(object sender, DevExpress.Xpf.Grid.CurrentItemChangedEventArgs e)
        {
            BankStatementLineGridClient oldselectedItem = e.OldItem as BankStatementLineGridClient;

            if (oldselectedItem != null)
            {
                oldselectedItem.PropertyChanged -= selectedItem_PropertyChanged;
            }

            BankStatementLineGridClient selectedItem = e.NewItem as BankStatementLineGridClient;

            if (selectedItem != null)
            {
                selectedItem.PropertyChanged += selectedItem_PropertyChanged;
                SetAccountSource(selectedItem);
            }
        }