Exemple #1
0
        /// <summary>
        /// 保存所有的操作
        /// </summary>
        private void SubmitPageContentInfo()
        {
            PageTextPropertyItem property = new PageTextPropertyItem();

            ReadControlValue(property);

            ///查看是否出现时间的错误提示
            //if (isTip)
            //{
            //   // MessageBox.Show(GetTextResource("timeErrorTip"));
            //}
            //else
            {
                ///在进行控件的验证
                //Control errorControl = null;
                //if (this.ValidateForm(out errorControl))
                //{
                //    Service.HistoryInput.AddValue(this.authorByNameCombo.Text, HistoryInputRecordType.CreaterBy);
                //    Service.HistoryInput.AddValue(this.modifyByComboBox.Text, HistoryInputRecordType.ModifyBy);
                //    Service.HistoryInput.AddValue(this.contentSourceComboBox.Text, HistoryInputRecordType.ContentSource);
                //    mgr.WritePageTextProp(property, _pageID);
                //    mgr.SaveXmlDocument();

                //    this.Close();
                //}
                //else
                //{
                //    Control.ControlCollection ctrls = this.Controls;
                //    if (ctrls.Contains(errorControl))
                //    {
                //        errorControl.Focus();
                //    }
                //}
            }
        }
Exemple #2
0
        /// <summary>
        /// 读出文件中的所有关键字
        /// </summary>
        /// <param name="property"></param>
        /// <param name="tagsNode"></param>
        private void ReadXmlTag(PageTextPropertyItem property, XmlNode tagsNode)
        {
            XmlNodeList xnl = tagsNode.ChildNodes;

            foreach (XmlNode node in xnl)
            {
                property.tag.Add(node.InnerText);
            }
        }
Exemple #3
0
        /// <summary>
        /// 加载窗体时前
        /// </summary>
        private void LoadingForm()
        {
            PageTextPropertyItem property = mgr.ReadPageTextProp();

            WriteControlValue(property);
            ReadAuthorAlias();
            ReadModifyBy();
            ReadContentSource();
        }
Exemple #4
0
        /// <summary>
        /// 保存所有的操作
        /// </summary>
        public void SubmitPageContentInfo()
        {
            PageTextPropertyItem property = new PageTextPropertyItem();

            ReadControlValue(property);
            Service.HistoryInput.AddValue(this.authorByNameCombo.Text, HistoryInputRecordType.CreaterBy);
            Service.HistoryInput.AddValue(this.modifyByComboBox.Text, HistoryInputRecordType.ModifyBy);
            Service.HistoryInput.AddValue(this.contentSourceComboBox.Text, HistoryInputRecordType.ContentSource);
            mgr.WritePageTextProp(property, _pageID);
            mgr.SaveXmlDocument();
        }
Exemple #5
0
        /// <summary>
        /// 读取控件的值
        /// </summary>
        private void ReadControlValue(PageTextPropertyItem prop)
        {
            prop.Title         = this.txtTitle.Text;
            prop.TitleAlias    = this.txtTitleAlias.Text;
            prop.DeliverTime   = this.creatDTPicker.Text;
            prop.AuthorAlias   = this.authorByNameCombo.Text;
            prop.ModifyBy      = this.modifyByComboBox.Text;
            prop.DesignSummary = this.txtDesignSummary.Text;
            prop.Summary       = this.txtSummary.Text;

            prop.ContentSource = this.contentSourceComboBox.Text;

            ///读取关键字
            prop.tag = ReadControlKeyWords();
        }
Exemple #6
0
        /// <summary>
        /// 将窗体值转入xml文件中
        /// </summary>
        public void WritePageTextProp(PageTextPropertyItem property, string PageId)
        {
            PageXmlDocument        doc = Service.Sdsite.CurrentDocument.GetPageDocumentById(PageId) as PageXmlDocument;
            PageSimpleExXmlElement ele = Service.Sdsite.CurrentDocument.GetPageElementById(PageId) as PageSimpleExXmlElement;

            ele.IsModified     = true;
            doc.Title          = property.Title;
            doc.PageTitleAlias = property.TitleAlias;
            doc.PageCreateTime = property.DeliverTime;
            doc.PageSummary    = property.Summary;
            doc.Author         = property.AuthorAlias;
            doc.AuthorAlias    = property.AuthorAlias;
            doc.ModifyAlias    = property.ModifyBy;
            doc.DesignSummary  = property.DesignSummary;

            doc.PageKeywords  = property.tag.ToArray();
            doc.ContentSource = property.ContentSource;

            //                doc.DocumentElement.Attributes["content_source"].Value = property.ContentSource;
            //doc.DocumentElement.Attributes["is_always_pub"].Value = property.IsAlwaysPub.ToString();

            //doc.DocumentElement.Attributes["stop_time"].Value = property.EndPubTime;
            doc.Save();
            Service.Sdsite.CurrentDocument.Save();
            ///写入文章摘要

            /*
             *
             * doc.DocumentElement.Attributes["content_source"].Value = property.ContentSource;
             * doc.DocumentElement.Attributes["is_always_pub"].Value = property.IsAlwaysPub.ToString();
             *
             * doc.DocumentElement.Attributes["stop_time"].Value = property.EndPubTime;
             *
             *
             * XmlNode tagNode = ContentDoc.SelectSingleNode("/content/tags");
             * WriteXmlTag(property.tag, tagNode);
             *
             * if (text != "")
             * {
             *   ///重新存储
             *   XmlNode textNode = ContentDoc.SelectSingleNode("/content/article_text");
             *   textNode.RemoveAll();
             *   XmlCDataSection xmlData = ContentDoc.CreateCDataSection(text);
             *   textNode.AppendChild(xmlData);
             * }*/
        }
Exemple #7
0
        /// <summary>
        /// 写入控件的值
        /// </summary>
        private void WriteControlValue(PageTextPropertyItem prop)
        {
            this.txtTitle.Text      = prop.Title;
            this.txtTitleAlias.Text = prop.TitleAlias;

            this.authorByNameCombo.Text     = prop.AuthorAlias;
            this.modifyByComboBox.Text      = prop.ModifyBy;
            this.txtDesignSummary.Text      = prop.DesignSummary;
            this.txtSummary.Text            = prop.Summary;
            this.contentSourceComboBox.Text = prop.ContentSource;
            ///创建时间
            if (prop.DeliverTime != "")
            {
                DateTime dateTime;
                if (!DateTime.TryParseExact(prop.DeliverTime, "yyyy-MM-dd HH:mm:ss", null, System.Globalization.DateTimeStyles.None, out dateTime)) ///验证时间的格式是否正确
                {
                    dateTime = DateTime.Now;
                }
                this.creatDTPicker.Value = dateTime; ///此时的创建时间都已经开始比较了,与另外两个时间
            }
            else
            {
                this.creatDTPicker.Value = DateTime.Now;
            }

            this.isAlwaysPubCheckBox.Checked = prop.IsAlwaysPub ? true : false;

            ///将读出的关键字显示在列表框中
            StringBuilder sb = new StringBuilder();

            if (prop.tag.Count > 0)
            {
                foreach (string str in prop.tag)
                {
                    sb.Append(str);
                    sb.Append(",");
                }
                string tags = sb.ToString().Remove(sb.Length - 1);
                this.txtContentTag.Text = tags;
            }
        }
Exemple #8
0
        /// <summary>
        /// 读出相应的属性值
        /// </summary>
        public PageTextPropertyItem ReadPageTextProp()
        {
            PageTextPropertyItem propertyItem = new PageTextPropertyItem();

            propertyItem.Title         = PageTextDoc.Title;
            propertyItem.TitleAlias    = PageTextDoc.PageTitleAlias;
            propertyItem.DeliverTime   = PageTextDoc.PageCreateTime.ToString();
            propertyItem.AuthorAlias   = PageTextDoc.AuthorAlias;
            propertyItem.DeliverTime   = PageTextDoc.PageCreateTime;
            propertyItem.Summary       = PageTextDoc.PageSummary;
            propertyItem.ModifyBy      = PageTextDoc.ModifyAlias;
            propertyItem.DesignSummary = PageTextDoc.DesignSummary;
            if (PageTextDoc.PageKeywords != null)
            {
                foreach (string keyWord in PageTextDoc.PageKeywords)
                {
                    propertyItem.tag.Add(keyWord);
                }
            }
            propertyItem.ContentSource = PageTextDoc.ContentSource;
            return(propertyItem);
        }
Exemple #9
0
        /// <summary>
        /// 读取控件的值
        /// </summary>
        private void ReadControlValue(PageTextPropertyItem prop)
        {
            prop.Title         = this.txtTitle.Text;
            prop.TitleAlias    = this.txtTitleAlias.Text;
            prop.DeliverTime   = this.creatDTPicker.Text;
            prop.AuthorAlias   = this.authorByNameCombo.Text;
            prop.ModifyBy      = this.modifyByComboBox.Text;
            prop.DesignSummary = this.txtDesignSummary.Text;
            prop.Summary       = this.txtSummary.Text;

            prop.ContentSource = this.contentSourceComboBox.Text;
            prop.IsAlwaysPub   = this.isAlwaysPubCheckBox.Checked ? true : false;

            if (!isAlwaysPubCheckBox.Checked)
            {
                prop.EndPubTime = this.contPubEndDTPicker.Text.ToString();
            }
            else
            {
                prop.EndPubTime = contPubEndDTPicker.MaxDate.ToString();
            }
            ///读取关键字
            prop.tag = ReadControlKeyWords();
        }