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; } }
/// <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; } }
public void Save(int postId) { Categories1.SaveData(postId); Tags1.SaveTags(postId); }