Esempio n. 1
0
        public void Edit(D.Beneficiary beneficiary)
        {
            EF.Beneficiary efBeneficiary = ConvertToEFwithID(beneficiary);


            _context.Entry(efBeneficiary).State = EntityState.Modified;
            _context.SaveChanges();
        }
Esempio n. 2
0
        private D.Payment ConvertToDomain(EF.Payment efPayment)
        {
            EF.Beneficiary efBeneficiary = _context.Beneficiaries.FirstOrDefault(b => b.BeneficiaryID == efPayment.BeneficiaryID);
            EF.Currency    efCurrency    = _context.Currencies.FirstOrDefault(c => c.CurrencyID == efPayment.CurrencyID);

            D.Beneficiary beneficiary = new D.Beneficiary(efBeneficiary.Name, efBeneficiary.Description);
            D.Currency    currency    = new D.Currency(efCurrency.CurrencyCode, efCurrency.Ratio, efCurrency.ExchangeRate);

            D.PaymentSource source = new D.PaymentSource(efPayment.PaymentSource.Source);
            D.PaymentType   type   = new D.PaymentType(efPayment.PaymentType.Type);

            string createdBy  = _context.Accounts.FirstOrDefault(b => b.AccountID == efPayment.CreatedByID).UserName;
            string modifiedBy = "";

            if (efPayment.ModifiedByID > 0)
            {
                modifiedBy = _context.Accounts.FirstOrDefault(b => b.AccountID == efPayment.ModifiedByID).UserName;
            }

            return(new D.Payment(efPayment.PaymentID, efPayment.Name, efPayment.Amount, currency, beneficiary, efPayment.Locked,
                                 efPayment.Email, efPayment.CreatedDate, efPayment.ModifiedDate, efPayment.PaymentDate, efPayment.PublishDate, createdBy, modifiedBy, source, type, efPayment.OptOut));
        }
Esempio n. 3
0
 private Beneficiary ConvertToDomain(EF.Beneficiary efBeneficiary)
 {
     return(new Beneficiary(efBeneficiary.BeneficiaryID, efBeneficiary.Name));
 }
Esempio n. 4
0
 private D.Beneficiary ConvertToDomain(EF.Beneficiary efBeneficiary)
 {
     return(new D.Beneficiary(efBeneficiary.BeneficiaryID, efBeneficiary.Name, efBeneficiary.Description));
 }
Esempio n. 5
0
 private Beneficiary ConvertBeneficiaryToDomain(EF.Beneficiary efBeneficiary)
 {
     return(new Beneficiary(efBeneficiary.Name, efBeneficiary.Description));
 }