Ejemplo n.º 1
0
        public void TransButton_Click(object sender, RoutedEventArgs e)
        {
            var transaction = new Transaction
            {
                BankId          = _bankingService.GetBankingInfo(FinanceListComboBox.SelectedItem.ToString()).BankId,
                ACnameID        = _bankingService.GetAcNameInfo(AccountNameCombo.SelectedItem.ToString()).ACnameID,
                TranstionTypeId = _bankingService.GetTransTypeInfo(TransTypeComboBox.SelectedItem.ToString())
                                  .TransactionTypeId,
                Amount    = (Convert.ToDouble(AmountTextBox.Text)),
                TransDesc = TransReasonTextBox.Text,
                Date      = DateTime.Now
            };

            _initiateDataUpdate.UpdateTblTransaction(transaction);
            _initiateDataUpdate.UpdateTblEntity(_objectConversions.ConvertTransactionToEachEntityTran(transaction));
        }
        public EachEntityTran ConvertTransactionToEachEntityTran(Transaction tran)
        {
            var tes = new EachEntityTran()
            {
                AccountName     = _bankingService.GetAcNameInfo((int)tran.ACnameID).ACname,
                TransactionType = _bankingService.GetTransTypeInfo((int)tran.TranstionTypeId).TransactionTypeName,
                BankName        = _bankingService.GetBankingInfo((int)tran.BankId).BankName,
                TransDesc       = tran.TransDesc,
                Amount          = (long)tran.Amount,
                CurrentBalance  = 0,
                Date            = tran.Date,
                TransID         = tran.TransID
            };

            return(tes);
        }