public static PageEditModel FromDomain(Page p) { return(new PageEditModel { Content = ContentEditModel.FromDomain(p.Content), Availability = AvailabilityEditModel.FromResource(p), }); }
protected virtual void Init(Program p, IAccountingService accounting) { base.Init(p); Content = ContentEditModel.FromDomain(p.Content); Issuance = IssuanceEditModel.FromDomain(p.Issuance); if (Issuance.Type == IssuanceType.ProgramBudget && !String.IsNullOrEmpty(p.Issuance.Account)) { var a = accounting.GetProgramAwardSource(p, null); if (null != a) { Issuance.Ledger = accounting.GetLedger(a); Issuance.Budget = BudgetEditModel.FromDomain(a.Budget); } } Title = p.Title; }