コード例 #1
0
        public void FillTransactionDetails(ForeignExchange forEx)
        {
            string amountInWords = ConvertNumbers.EnglishFromNumber((double)forEx.AmountReleased);
            lblCustomerName.Text = forEx.PartyRole1.Party.Name;
            lblAmountReceived.Text = forEx.AmountReceived.ToString("N") + " " + forEx.Currency.Symbol;
            lblCurrencyTo.Text = forEx.AmountReleased.ToString("N") + " " + forEx.Currency1.Symbol;
            lblCurrencyToWords.Text = amountInWords + " ( " + forEx.Currency1.Description + " ) ";
            lblExchangeRate.Text = forEx.Rate.ToString("N") + " " + forEx.Currency1.Symbol;
            lblProcessedBy.Text = forEx.PartyRole.Party.Name;
            lblTotalAmount.Text = forEx.AmountReleased.ToString("N") + " " + forEx.Currency1.Symbol;
            lblReceivedby.Text = forEx.PartyRole1.Party.Name.ToUpper();

            var forExAssoc = ObjectContext.ForeignExchangeDetailAssocs.SingleOrDefault(x => x.ForExId == forEx.Id);

            var cash = from fed in ObjectContext.ForExDetails
                       where fed.PaymentMethodTypeId == PaymentMethodType.CashType.Id &&
                        fed.ParentForExDetailId == forExAssoc.ForExDetailId
                        select new ExchangeBreakdown {
                            PaymentMethod = fed.PaymentMethodType.Name,
                            TotalAmount = fed.Amount,
                            CheckNumber = "N/A",
                            ForExDetail = fed
                        };

            var check = from fed in ObjectContext.ForExDetails
                        join fec in ObjectContext.ForExCheques on fed.Id equals fec.ForExDetailId
                        where (fed.PaymentMethodTypeId == PaymentMethodType.PersonalCheckType.Id ||
                        fed.PaymentMethodTypeId == PaymentMethodType.PayCheckType.Id) &&
                        fed.ParentForExDetailId == forExAssoc.ForExDetailId
                        select new ExchangeBreakdown
                        {
                            PaymentMethod = fed.PaymentMethodType.Name,
                            TotalAmount = fed.Amount,
                            CheckNumber = fec.CheckNumber,
                            ForExDetail = fed
                        };

            check = check.Concat(cash);
            strBreakdown.DataSource = check.ToList();
            strBreakdown.DataBind();
        }
コード例 #2
0
 public void TradeForeignExchange(ForeignExchange foreignEx)
 {
     int value = foreignEx.value;
     Console.WriteLine(value);
     Console.ReadLine();
 }