Ejemplo 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);
        }
    }
Ejemplo n.º 2
0
    private void init()
    {
        string msg = string.Format("if(confirm('{0}')) {1}; else return false;",
                                   MessageCode.GetMessageByCode(MESSAGE_QUESTION_REMOVE_CATEGORY),
                                   Page.GetPostBackEventReference(btnRemove));

        btnRemove.Attributes["onclick"] = msg;
        modelTree = CategoryManager.GetInstance().GetMyCategorys(typeof(CategoryTreeView));
    }
Ejemplo n.º 3
0
    protected void lnkRegister_Click(object sender, EventArgs e)
    {
        if (txtTitle.Text.Length == 0)
        {
            Utility.JS_Alert(sender, MessageCode.GetMessageByCode("message.no.title"));
            return;
        }
        if (FCKeditor1.Value.Length == 0)
        {
            Utility.JS_Alert(sender, MessageCode.GetMessageByCode("message.no.content"));
            return;
        }
        bool tagValidate = true;

        foreach (string noTag in noTagList)
        {
            if (txtTag.Text.IndexOf(noTag) != -1)
            {
                tagValidate = false;
                break;
            }
        }
        if (!tagValidate)
        {
            Utility.JS_Alert(sender, MessageCode.GetMessageByCode("message.article.notaglist"));
            return;
        }

        HttpFileCollection fileCollection = Request.Files;
        //CategoryNodeValue node				= CategoryNodeValue.Parse( ddlCategoryM.SelectedValue );

        ArticleModel model = new ArticleModel();

        model.CategoryID     = int.Parse(ddlCategoryM.SelectedValue);
        model.Title          = txtTitle.Text;
        model.Content        = FCKeditor1.Value;
        model.TrackbackUrl   = txtTrackbackUrl.Text;
        model.PublicFlag     = bool.Parse(rblPublicFlag.SelectedValue);
        model.PublicRss      = bool.Parse(rblPublicRss.SelectedValue);
        model.AllowComment   = bool.Parse(rblAllowComment.SelectedValue);
        model.AllowTrackback = bool.Parse(rblAllowTrackback.SelectedValue);

        string[] tags = txtTag.Text.Split(',');

        foreach (string tag in tags)
        {
            model.Tag.Add(new TagModel(tag));
        }

        // 아티클 수정모드라면 다른곳으로 분기
        if (articleNo > 0)
        {
            updateArticle(model);
            return;
        }

        int seqNo = ArticleManager.GetInstance().InsertArticle(model, fileCollection);

        TrackbackModel trackbackModel = new TrackbackModel();

        trackbackModel.ArticleNo = seqNo;
        trackbackModel.Blog_Name = BlogManager.GetInstance().BlogBaseModel.BlogModel.Title;
        trackbackModel.Title     = model.Title;
        trackbackModel.Exceprt   = model.Content;
        trackbackModel.Url       = Utility.MakeArticleUrl(seqNo);
        trackbackModel.UserIP    = Request.UserHostAddress;

        // 트랙백 보내는 아티클이면..
        if (txtTrackbackUrl.Text.Length > 0)
        {
            TrackbackManager.GetInstance().SendTrackback(txtTrackbackUrl.Text, trackbackModel);
        }

        string script = string.Format("alert('{0}'); location.href='{1}';",
                                      UmcConfiguration.Message[ArticleConst.MESSAGE_ARTICLE_REGIST],
                                      ListQueryString);

        Utility.JsCall(sender, script);
    }