Ejemplo n.º 1
0
        public Publisher AddPublisher(Publisher newPublisher)
        {
            PublisherRepo repo = new PublisherRepo();

            Repository.Models.Publisher dbPublisher = repo.Create(Map(newPublisher));
            return(Map(dbPublisher));
        }
Ejemplo n.º 2
0
        public Publisher Update(Publisher publisher)
        {
            PublisherRepo repo = new PublisherRepo();

            Repository.Models.Publisher dbPublisher = repo.Update(Map(publisher));
            return(Map(dbPublisher));
        }
Ejemplo n.º 3
0
 public Publisher Map(Repository.Models.Publisher publisher, string language = "")
 {
     if (publisher == null)
     {
         return(new Publisher()
         {
             Language = language
         });
     }
     return(new Publisher()
     {
         Domain = publisher.Domain,
         ID = publisher.ID,
         Language = publisher.Language,
         NACEID = publisher.NACEID,
         Name = publisher.Name,
         Status = publisher.Status,
         Category = publisher.NACE == null ? string.Empty : publisher.NACE.Description,
         CreatorId = publisher.CreatorId,
         UpdaterId = publisher.UpdaterId,
         LastReceivedEmail = publisher.LastReceivedEmail.HasValue ? FormatHelper.ConvertDateToString(publisher.LastReceivedEmail.Value) : "",
         FormatedStatus = FormatHelper.GetFormtedStatus(publisher.Status, publisher.StatusChanged)
     });
 }