예제 #1
0
 public static PageEditModel FromDomain(Page p)
 {
     return(new PageEditModel {
         Content = ContentEditModel.FromDomain(p.Content),
         Availability = AvailabilityEditModel.FromResource(p),
     });
 }
예제 #2
0
        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;
        }