Esempio n. 1
0
    protected void btnSavePost_Click(object sender, EventArgs e)
    {
        try
        {
            int iFileID = 0;
            int.TryParse(Request["FileID"], out iFileID);

            BSPost bsPost = BSPost.GetPost(iFileID);

            bsPost.Content    = tmceContent.Content;
            bsPost.State      = (PostStates)Convert.ToInt16(ddState.SelectedValue);
            bsPost.AddComment = cblAddComment.Checked;
            bsPost.UpdateDate = DateTime.Now;

            Categories1.SaveData(bsPost.PostID);
            Tags1.SaveTags(bsPost.PostID);
            if (bsPost.Save())
            {
                Response.Redirect("Library.aspx?FileID=" + bsPost.PostID + "&Message=1");
            }
            else
            {
                MessageBox1.Message = "Error";
                MessageBox1.Type    = MessageBox.ShowType.Error;
            }
        }
        catch (Exception ex)
        {
            MessageBox1.Message = ex.Message;
            MessageBox1.Type    = MessageBox.ShowType.Error;
        }
    }
Esempio n. 2
0
    protected void btnSaveLink_Click(object sender, EventArgs e)
    {
        int iLinkID = 0;

        int.TryParse(Request["LinkID"], out iLinkID);

        if (iLinkID > 0)
        {
            BSLink link = BSLink.GetLink(iLinkID);
            link.Name         = txtLinkTitle.Text;
            link.Description  = txtLinkDescription.Text;
            link.Url          = txtLinkURL.Text;
            link.Target       = rblLinkTarget.SelectedValue;
            link.LanguageCode = lpLinkLanguage.LangaugeCode;

            if (link.Save())
            {
                Categories1.TermType = TermTypes.LinkCategory;
                Categories1.SaveData(link.LinkID);
                MessageBox1.Message = Language.Admin["LinkSaved"];
                MessageBox1.Type    = MessageBox.ShowType.Information;
            }
            else
            {
                MessageBox1.Message = Language.Admin["LinkError"];
            }
        }
    }
    /// <summary>
    /// Save Post(s) click action.
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnSavePost_Click(object sender, EventArgs e)
    {
        try
        {
            string PostID  = Request.QueryString["PostID"];
            int    iPostID = 0;

            int.TryParse(PostID, out iPostID);

            BSPost bsPost = BSPost.GetPost(iPostID);

            bsPost.Title      = txtTitle.Text;
            bsPost.Code       = BSHelper.CreateCode(txtTitle.Text);
            bsPost.Content    = tmceContent.Content;
            bsPost.State      = (PostStates)Convert.ToInt16(ddState.SelectedValue);
            bsPost.AddComment = cblAddComment.Checked;
            bsPost.UpdateDate = DateTime.Now;

            if (rblDate.SelectedValue == "1")
            {
                bsPost.Date = dtsDateTime.SelectedDateTime;
            }

            Categories1.SaveData(bsPost.PostID);
            Tags1.SaveTags(bsPost.PostID);

            if (bsPost.Save())
            {
                Response.Redirect("Posts.aspx?PostID=" + PostID + "&Message=1");
            }
            else
            {
                MessageBox1.Message = Language.Admin["PostError"];
                MessageBox1.Type    = MessageBox.ShowType.Error;
            }
        }
        catch (Exception ex)
        {
            MessageBox1.Message = ex.Message;
            MessageBox1.Type    = MessageBox.ShowType.Error;
        }
    }
Esempio n. 4
0
 public void Save(int postId)
 {
     Categories1.SaveData(postId);
     Tags1.SaveTags(postId);
 }