private void bind() { model = BlogManager.GetInstance().BlogBaseModel; txtTitle.Text = model.BlogModel.Title; txtUrl.Text = model.BlogModel.Url; txtEmail.Text = model.BlogModel.EMail; txtName.Text = model.BlogModel.Name; txtNickName.Text = model.BlogModel.NickName; txtIntroduction.Text = model.BlogModel.Introduction; ddlAddress.SelectedValue = model.BlogModel.Address; txtHobby.Text = model.BlogModel.Hobby; ddlGender.SelectedValue = ((BlogConst.Gender)model.BlogModel.Gender).ToString(); rblAlram.SelectedValue = model.BlogModel.Alarm.ToString(); rblAutoClip.SelectedValue = model.BlogModel.AutoClip.ToString(); rblPostCount.SelectedValue = model.BlogModel.PostCount.ToString(); rblRecentComment.SelectedValue = model.BlogModel.RecentCommentListCount.ToString(); rblRecentArticleCount.SelectedValue = model.BlogModel.RecentArticleListCount.ToString(); rblUseEmoticon.SelectedValue = model.BlogModel.UseEmoticon.ToString(); ddlNewIcon.SelectedValue = model.BlogModel.PeridoNewIcon.ToString(); if (model.BlogModel.Picture != string.Empty) { lblMyPicture.Text = BlogManager.GetInstance().GetMyPictureForImgTag(); } else { lblMyPicture.Text = MessageCode.GetMessageByCode(BlogConst.MESSAGE_HAS_NOT_MYPICTURE); } }
private void bind() { model = BlogManager.GetInstance().BlogBaseModel; rblCanWriteMemo.SelectedValue = model.PrivacyModel.CanWriteMemo.ToString(); rblCanWriteGuestBoard.SelectedValue = model.PrivacyModel.CanWriteGuestBoard.ToString(); rblCanWriteBbs.SelectedValue = model.PrivacyModel.CanWriteBbs.ToString(); rblPublicRSS.SelectedValue = model.PrivacyModel.PublicRSS.ToString(); rblAllowMouseRightButton.SelectedValue = model.PrivacyModel.AllowMouseRightButton.ToString(); rblLimitRssCount.SelectedValue = model.PrivacyModel.LimitRssCount.ToString(); if (IsPostBack) { return; } ArticleBindModel articleBindModel = ArticleManager.GetInstance().GetRecentArticleList(int.MaxValue); foreach (ArticleModel articleModel in articleBindModel) { ddlGuestBookArticle.Items.Add(new ListItem(articleModel.Title, articleModel.ArticleNo.ToString())); } ddlGuestBookArticle.SelectedValue = model.PrivacyModel.GuestBoardArticleNo.ToString(); }
protected void bind() { model = BlogManager.GetInstance().BlogBaseModel; rblPublicName.SelectedValue = model.ProfileInfoModel.PublicName.ToString(); rblPublicGender.SelectedValue = model.ProfileInfoModel.PublicGender.ToString(); rblPublicAddress.SelectedValue = model.ProfileInfoModel.PublicAddress.ToString(); rblPublicGuestBoard.SelectedValue = model.ProfileInfoModel.PublicGuestBoard.ToString(); }
private void bind() { model = BlogManager.GetInstance().BlogBaseModel; imgPicture.ImageUrl = model.BlogModel.Picture; lblName.Text = model.BlogModel.Name; lblNickName.Text = model.BlogModel.NickName; lblIntroduction.Text = model.BlogModel.Introduction.Replace("\r\n", "<br/>"); lblAddress.Text = model.BlogModel.Address; lblHobby.Text = model.BlogModel.Hobby; }
/// <summary> /// RSS ¸¦ XML ·Î ¾´´Ù. /// </summary> /// <returns></returns> public override TextWriter XmlWriter() { TextWriter tw = new StringWriter(); XmlTextWriter writer = new XmlTextWriter(tw); writer.Formatting = Formatting.Indented; writer.Indentation = 4; BlogBaseModel blogModel = BlogManager.GetInstance().BlogBaseModel; writer.WriteStartElement("rss"); writer.WriteAttributeString("version", "2.0"); writer.WriteStartElement("channel"); writer.WriteElementString("title", this.Title); writer.WriteElementString("link", this.Link); writer.WriteElementString("description", this.Description); writer.WriteElementString("copyright", this.Copyright); writer.WriteElementString("generator", this.Generator); foreach (RssItemModel model in this.Item) { writer.WriteStartElement("item"); writer.WriteElementString("title", model.Title); writer.WriteElementString("link", model.Link); //writer.WriteStartElement("description"); // writer.WriteCData( model.Description ); //writer.WriteEndElement(); writer.WriteElementString("author", model.Author); writer.WriteElementString("pubDate", model.PubDate); foreach (TagModel tagModel in model.Category) { writer.WriteElementString("category", tagModel.TagName); } writer.WriteEndElement(); } writer.WriteEndElement(); writer.WriteEndElement(); return(tw); }
/// <summary> /// 블로그 기본 정보를 저장한다 /// </summary> /// <param name="path"></param> /// <param name="model"></param> public void WriteBlogBaseInfo(string path, BlogBaseModel model) { XmlTextWriter writer = null; try { writer = new XmlTextWriter(path, Encoding.Default); writer.Formatting = Formatting.Indented; XmlSerializer serializer = new XmlSerializer(typeof(BlogBaseModel)); serializer.Serialize(writer, model); } catch (Exception ex) { throw new Exception("Blog.Xml 쓰는중 오류발생" + ex.Message); } finally { writer.Close(); } }
/// <summary> /// 블로그 기본 정보를 Xml 로 부터 읽는다 /// </summary> /// <param name="path"></param> /// <returns></returns> public BlogBaseModel ReadBlogBaseInfo(string path) { XmlTextReader reader = null; BlogBaseModel model = new BlogBaseModel(); try { reader = new XmlTextReader(path); XmlSerializer serializer = new XmlSerializer(typeof(BlogBaseModel)); return((BlogBaseModel)serializer.Deserialize(reader)); } catch // Xml 이 없거나 잘못된 경우 새로 만든다 { WriteBlogBaseInfo(path, model); return(model); } finally { reader.Close(); model = null; } }
/// <summary> /// Xml 의 블로그 기본 정보를 설정한다 /// </summary> public void Init() { string path = Utility.GetAbsolutePath(UmcConfiguration.Core["BlogXmlPath"]); _blogBaseModel = BlogManager.GetInstance().ReadBlogBaseInfo(path); }