Exemplo n.º 1
0
 public static PageSchemaModel GetPageModel(PageSchema page)
 {
     if (page == null) return null;
     var result = new PageSchemaModel {Id =  page.Id, IdPerson = page.IdPerson, IdEvent = page.IdEvent, IdHall = page.IdHall,
         PageType = (int)page.Page};
     if (result.IdPerson != null) result.Person = PersonModelHelper.GetPersonModel(page.Person);
     if (result.IdEvent != null) result.Event = EventModelHelper.GetEventModel(page.Event);
     //TODO get Hall model
     return result;
 }
Exemplo n.º 2
0
 private static ActorModel GetActorModel(Actor model)
 {
     return(model != null ? new ActorModel
     {
         Id = model.Id,
         IdPerson = model.IdPerson,
         IdGroup = model.IdGroup,
         Group = GetGroupModel(model.Group),
         Role = model.Role,
         Person = PersonModelHelper.GetPersonModel(model.Person),
         Programms = model.Programms.Select(GetProgrammModel)
     } : null);
 }
Exemplo n.º 3
0
 /// <summary>
 /// Оборачивает <paramref name="connection"/> в модель
 /// </summary>
 /// <param name="connection"></param>
 /// <returns></returns>
 public static EventConnectionModel GetConnectionModel(EventConnection connection)
 {
     return(connection != null ? new EventConnectionModel
     {
         Id = connection.Id,
         id_ConnectionType = connection.id_ConnectionType,
         id_Event = connection.id_Event,
         id_Person = connection.id_Person,
         id_EventConnectTo = connection.id_EventConnectTo,
         Person = PersonModelHelper.GetPersonModel(connection.Person),
         Event = GetEventModel(connection.Event),
         Description = connection.Description,
         EventConnectionType = connection.ConnectionType?.Name
     } : new EventConnectionModel());
 }