Exemplo n.º 1
0
    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);
    }
Exemplo n.º 2
0
    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();
    }
Exemplo n.º 3
0
 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;
 }
Exemplo n.º 4
0
        /// <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;
            }
        }
Exemplo n.º 5
0
 /// <summary>
 /// Xml �� ��α� �⺻ ������ �����Ѵ�
 /// </summary>
 public void Init()
 {
     string path		= Utility.GetAbsolutePath(UmcConfiguration.Core["BlogXmlPath"]);
     _blogBaseModel	= BlogManager.GetInstance().ReadBlogBaseInfo(path);
 }
Exemplo n.º 6
0
        /// <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();
            }
        }