public MobileTransactionViewModel(MobileTransaction mobileTransaction) { ID = mobileTransaction.ID; MobileOperator = new MobileOperatorViewModel(mobileTransaction.MobileOperator); CreditSum = mobileTransaction.CreditSum; if (mobileTransaction.Transaction.Price != null) Price = mobileTransaction.Transaction.Price.Value; if (mobileTransaction.Transaction.Contragent != null) Client = new ContragentViewModel(mobileTransaction.Transaction.Contragent); Salesman = new SalesmanViewModel(mobileTransaction.Transaction.Operator.Salesman); Date = mobileTransaction.Transaction.Date; Profit = Price - CreditSum; }
public MobileTransactionViewModel(MobileTransaction mobileTransaction) { ID = mobileTransaction.ID; MobileOperator = new MobileOperatorViewModel(mobileTransaction.MobileOperator); CreditSum = mobileTransaction.CreditSum; if (mobileTransaction.Transaction.Price != null) { Price = mobileTransaction.Transaction.Price.Value; } if (mobileTransaction.Transaction.Contragent != null) { Client = new ContragentViewModel(mobileTransaction.Transaction.Contragent); } Salesman = new SalesmanViewModel(mobileTransaction.Transaction.Operator.Salesman); Date = mobileTransaction.Transaction.Date; Profit = Price - CreditSum; }