Exemple #1
0
 public static PageLightDTO GetPageLightDTO(Core.Entities.Page entity)
 {
     return(new PageLightDTO
     {
         Id = entity.Id,
         Title = entity.Title,
         Slug = entity.Slug,
         Description = entity.Description,
         CreatedAt = entity.CreatedAt,
         CreatedBy = entity.CreatedBy,
         UpdatedAt = entity.UpdatedAt,
         UpdatedBy = entity.UpdatedBy,
         Owner = GetAppUserLightDTO(entity.Owner)
     });
 }
Exemple #2
0
        public static PageDTO GetPageDTO(Core.Entities.Page entity)
        {
            var dto = new PageDTO
            {
                Id          = entity.Id,
                Title       = entity.Title,
                Slug        = entity.Slug,
                Description = entity.Description,
                Content     = entity.Content,
                CreatedAt   = entity.CreatedAt,
                CreatedBy   = entity.CreatedBy,
                UpdatedAt   = entity.UpdatedAt,
                UpdatedBy   = entity.UpdatedBy,
                Owner       = GetAppUserLightDTO(entity.Owner),
                Space       = GetSpaceLightDTO(entity.Space),
            };

            return(dto);
        }
 void btnSave_Click(object sender, EventArgs e)
 {
     try
     {
         CMS.Core.Entities.Page page = new Core.Entities.Page();
         page.CreationDate = DateTime.Now;
         page.Description = txtDescription.Text;
         page.IsDeleted = false;
         page.KeyWords = txtKeyword.Text;
         page.LanguageID = CMSContext.LanguageID;
         page.Name = txtName.Text;
         page.PageType = (CMSEnums.PageType)Convert.ToInt32(cddPageType.SelectedValue);
         page.PortalID = CMSContext.PortalID;
         page.SEOName = txtSEOName.Text;
         page.TemplateID = Convert.ToInt32(cddTemplate.SelectedValue);
         page.Title = txtTitle.Text;
         page.CreatedBy = CMSContext.CurrentUserID;
         PageManager.Add(page);
         BeginAddMode();
         FillPages(-1);
         upnlPage.Update();
     }
     catch (Exception ex)
     {
         dvProblems.Visible = true;
         dvProblems.InnerText = ex.Message;
         upnlPage.Update();
     }
 }