protected void btnSubmit_Click(object sender, EventArgs e) { ArticleInfo articleinfo = new ArticleInfo(); articleinfo.Columnid = Convert.ToInt32(ddlColumns.SelectedValue); articleinfo.Title = tbxTitle.Text.Trim(); articleinfo.Highlight = ddlHightlight.SelectedValue; articleinfo.Summary = tbxSummary.Text.TrimEnd(); articleinfo.Content = tbxContent.Text.TrimEnd(); articleinfo.Postdate = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"); articleinfo.Recommend = Convert.ToInt32(ckbxRecommand.Checked); articleinfo.Uid = userinfo.Uid; articleinfo.Username = userinfo.Username; if (articleid > 0) { articleinfo.Articleid = articleid; Articles.EditArticle(articleinfo); } else { Articles.CreateArticle(articleinfo); } Articles.RemoveArtilceCache(); ShowMsg("文章管理", "文章提交成功.", "", "articlelist.aspx?cid=" + articleinfo.Columnid, true); //Response.Redirect("articlelist.aspx?cid=" + articleinfo.Columnid); }
protected void btnSubmit_Click(object sender, EventArgs e) { ArticleInfo articleinfo = new ArticleInfo(); articleinfo.Columnid = Convert.ToInt32(ddlColumns.SelectedValue); articleinfo.Title = tbxTitle.Text.Trim(); articleinfo.Highlight = ddlHightlight.SelectedValue; articleinfo.Content = tbxContent.Text.TrimEnd(); articleinfo.Postdate = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"); articleinfo.Uid = 1; articleinfo.Username = "******"; if (articleid > 0) { articleinfo.Articleid = articleid; Articles.EditArticle(articleinfo); } else { Articles.CreateArticle(articleinfo); } Response.Redirect("articlelist.aspx?cid=" + articleinfo.Columnid); }