public Payment(PaymentViewModel vm) { this.PaymentID = vm.PaymentID; this.CostCenterID = vm.CostCenterID; this.Year = vm.Year; this.PaymentNo = vm.PaymentNo; this.Sequence = vm.Sequence; this.Description = vm.Description; this.RequestBy = vm.RequestBy; this.PaymentDate = vm.PaymentDate; this.TotalAmount = vm.TotalAmount; this.Status = vm.Status; this.Type = vm.Type; this.ContractorID = vm.ContractorID; if (vm.Type == PaymentType.Contractor && vm.ContractorID != null) { Contractor = new Contractor(); Contractor.ID = (Guid)vm.ContractorID; Contractor.Name = vm.ContractorName; } if (vm.Transactions != null) { this.BudgetTransactions = new List <BudgetTransaction>(); foreach (var item in vm.Transactions) { var trans = new BudgetTransaction(item); BudgetTransactions.Add(trans); } } }
public BudgetTransaction(BudgetTransaction tran) { this.BudgetTransactionID = tran.BudgetTransactionID; this.BudgetID = tran.BudgetID; this.PaymentID = tran.PaymentID; this.RowVersion = tran.RowVersion; this.Description = tran.Description; this.Amount = tran.Amount; this.PreviousAmount = tran.PreviousAmount; this.RemainAmount = tran.RemainAmount; this.RefID = tran.RefID; this.Type = tran.Type; this.Status = tran.Status; }