Esempio n. 1
0
        public void OnTransferToAccountChange(object param)
        {
            if (SelectedtransferToCashBankAcntID != 0)
            {
                var actType = TransferFromCashAndBankAccountsLst.SingleOrDefault(e => e.AccountID == SelectedtransferToCashBankAcntID);
                if (actType != null)
                {
                    TransferToBeforeBalance    = actType.CurrentBalance == null ? 0 : actType.CurrentBalance;
                    TransferToBeforeBalanceStr = Convert.ToString(TransferToBeforeBalance);

                    if (AmountStr != string.Empty)
                    {
                        decimal dec   = 0;
                        bool    isDec = Decimal.TryParse(AmountStr, out dec);
                        if (isDec)
                        {
                            TransferToAfterBalance    = TransferToBeforeBalance + dec;
                            TransferToAfterBalanceStr = Convert.ToString(TransferToAfterBalance);
                        }
                        else
                        {
                            TransferToAfterBalanceStr = TransferToBeforeBalanceStr;
                        }
                    }
                    else
                    {
                        TransferToAfterBalanceStr = TransferToBeforeBalanceStr;
                    }
                }
            }
        }
Esempio n. 2
0
        public void CheckAccountDetails(object param)
        {
            if (IsNew == true)
            {
                if (SelectedtransferFromCashAndBankAcntID != 0)
                {
                    var actType = TransferFromCashAndBankAccountsLst.SingleOrDefault(e => e.AccountID == SelectedtransferFromCashAndBankAcntID);
                    if (actType != null)
                    {
                        TransferFromBeforeBalance    = actType.CurrentBalance == null ? 0 : actType.CurrentBalance;
                        TransferFromBeforeBalanceStr = Convert.ToString(TransferFromBeforeBalance);

                        if (AmountStr != string.Empty)
                        {
                            decimal dec   = 0;
                            bool    isDec = Decimal.TryParse(AmountStr, out dec);
                            if (isDec)
                            {
                                TransferFromAfterBalance    = TransferFromBeforeBalance - dec;
                                TransferFromAfterBalanceStr = Convert.ToString(TransferFromAfterBalance);
                            }
                            else
                            {
                                TransferFromAfterBalanceStr = TransferFromBeforeBalanceStr;
                            }
                        }
                        else
                        {
                            TransferFromAfterBalanceStr = TransferFromBeforeBalanceStr;
                        }

                        if (actType.AccountType == Convert.ToByte(Account_Type.Cash) && actType.IsLinked == true)
                        {
                            IsChequeTrue      = false;
                            IsChequeFalse     = true;
                            IsTextBoxReadOnly = true;
                            CashChequeNo      = "TM-" + rmRepository.GetLastCashNo();
                            IsCheque          = false;
                        }
                        else
                        {
                            IsChequeTrue      = true;
                            IsChequeFalse     = false;
                            IsTextBoxReadOnly = false;
                            CashChequeNo      = string.Empty;
                            IsCheque          = true;
                        }
                    }
                }
            }
        }