private void LoadContent(HtmlItemFullInfo htmlItem)
 {
     lblTitle.Text = htmlItem.Title;
     lblCreateTime.Text = htmlItem.CreateTime.ToString("yyyy年MM月dd日 hh:mm:ss");
     lblUpdateTime.Text = htmlItem.LastUpdateTime.ToString("yyyy年MM月dd日 hh:mm:ss");
     lblContent.Text = htmlItem.Content;
 }
    protected void lbtnSave_Click(object sender, EventArgs e)
    {
        try
        {
            string name1 = txtName.Text.Trim();
            string title = txtTitle.Text.Trim();
            if (string.IsNullOrEmpty(title))
            {
                title = name1;
            }
            string content = txtContent.Text;

            PageFacade facade = PageHelper.GetPageFacade(this.Page);
            HtmlItemFullInfo html = new HtmlItemFullInfo();
            html.Name = name1;
            html.Title = title;
            html.Content = content;
            string listId = Request["lid"];
            if (string.IsNullOrEmpty(listId))
            {
                listId = Guid.Empty.ToString("N");
            }
            if (listId == Guid.Empty.ToString("N"))
            {
                html.ItsListId = null;
            }
            else
            {
                html.ItsListId = listId;
            }

            string msg, url;
            if (IsAdd)
            {
                facade.AddHtml(html);
                msg = string.Format("添加页面成功 - \"{0}\"", name1);
            }
            else
            {
                html.Id = Request["id"];
                facade.ModifyHtml(html);
                msg = string.Format("修改页面成功 - \"{0}\"", name1);
            }
            url = string.Format("EditList.aspx?id={0}", listId);
            JavascriptAlertAndRedirect(msg, url);
        }
        catch (FacadeException ex)
        {
            JavascriptAlert(ex.Message);
        }
        catch
        {
            JavascriptAlert(@"保存页面发生未知错误,请联系系统配置人员!");
        }
    }
Ejemplo n.º 3
0
        public void ModifyHtml(HtmlItemFullInfo item)
        {
            try
            {
                HtmlItemEntity entity = new HtmlItemEntity();
                entity.Id      = item.Id;
                entity.Content = item.Content;
                entity.Name    = item.Name;
                entity.Title   = item.Title;

                PageManager manager = new PageManager(DbAccess);
                manager.ModifyEntity <HtmlItemEntity>(entity);
            }
            catch (Exception ex)
            {
                throw HandleException("Page", "ModifyHtml - " + item.Name, ex);
            }
        }
Ejemplo n.º 4
0
        public void AddHtml(HtmlItemFullInfo item)
        {
            try
            {
                HtmlItemEntity entity = new HtmlItemEntity();
                entity.Content = item.Content;
                entity.ItsListId = item.ItsListId;
                entity.Name = item.Name;
                entity.Title = item.Title;

                PageManager manager = new PageManager(DbAccess);
                manager.AddEntity<HtmlItemEntity>(entity);
                item.Id = entity.Id;
            }
            catch (Exception ex)
            {
                throw HandleException("Page", "AddHtml - " + item.Name, ex);
            }
        }
 private void LoadStyles(HtmlItemFullInfo htmlItem)
 {
     //if (htmlItem.IncludeStyleFileList != null && htmlItem.IncludeStyleFileList.Count > 0)
     //{
     //}
 }
 private void BindHtmlInfo(HtmlItemFullInfo htmlItem)
 {
     txtName.Text = htmlItem.Name;
     txtTitle.Text = htmlItem.Title;
     txtContent.Text = htmlItem.Content;
 }