protected void Page_Load(object sender, EventArgs e) { int blogid = Convert.ToInt32(Request.QueryString["blogid"]); Johnny.CMS.BLL.SeH.Blog bll = new Johnny.CMS.BLL.SeH.Blog(); Johnny.CMS.OM.SeH.Blog model = bll.GetModel(blogid); if (model != null) { lblTitle.Text = model.Title; lblUpdateTime.Text = DataConvert.GetString(model.UpdatedTime); lblDescription.Text = model.Content; } }
protected void Page_Load(object sender, EventArgs e) { Johnny.CMS.BLL.SeH.Blog bll = new Johnny.CMS.BLL.SeH.Blog(); IList<Johnny.CMS.OM.SeH.Blog> list = bll.GetList(); StringBuilder sb = new StringBuilder(); foreach (Johnny.CMS.OM.SeH.Blog blog in list) { sb.Append("<div>"); sb.Append(string.Format(" <a href=\"blogdetail.aspx?blogid={0}\">{1}</a>", blog.BlogId, blog.Title)); sb.Append(string.Format(" <h4>{0} by {1} | <a href=\"http://www.extjs.com/blog/2009/12/17/ext-js-3-1-massive-memory-improvements-treegrid-and-more%e2%80%a6/#comments\">评论(51) »</a></h4>", blog.UpdatedTime, blog.UpdatedByName)); sb.Append(" <div>"); sb.Append(string.Format(" <p>{0}</p>", blog.Content)); sb.Append(" <div style=\"clear:both;\"></div>"); sb.Append(" </div>"); sb.Append("</div>"); sb.Append("<hr />"); } lblBlogList.Text = StringHelper.htmlOutputText(sb.ToString()); }
protected void btnDelete_Click(object sender, EventArgs e) { foreach (GridViewRow row in myManageGridView.Rows) { TableCell cell = row.Cells[0]; Johnny.Controls.Web.CheckBox.CheckBox chkSelect = (Johnny.Controls.Web.CheckBox.CheckBox)cell.FindControl("chkSelect"); if (chkSelect.Checked) { string strId = ((Label)row.FindControl(STR_LABEL_ID)).Text; //delete Johnny.CMS.BLL.SeH.Blog bll = new Johnny.CMS.BLL.SeH.Blog(); bll.Delete(DataConvert.GetInt32(strId)); } } SetMessage(GetMessage("C00005")); //update grid getData(); }
protected void Page_Load(object sender, EventArgs e) { Johnny.CMS.BLL.SeH.Blog bll = new Johnny.CMS.BLL.SeH.Blog(); IList <Johnny.CMS.OM.SeH.Blog> list = bll.GetList(); StringBuilder sb = new StringBuilder(); foreach (Johnny.CMS.OM.SeH.Blog blog in list) { sb.Append("<div>"); sb.Append(string.Format(" <a href=\"blogdetail.aspx?blogid={0}\">{1}</a>", blog.BlogId, blog.Title)); sb.Append(string.Format(" <h4>{0} by {1} | <a href=\"http://www.extjs.com/blog/2009/12/17/ext-js-3-1-massive-memory-improvements-treegrid-and-more%e2%80%a6/#comments\">评论(51) »</a></h4>", blog.UpdatedTime, blog.UpdatedByName)); sb.Append(" <div>"); sb.Append(string.Format(" <p>{0}</p>", blog.Content)); sb.Append(" <div style=\"clear:both;\"></div>"); sb.Append(" </div>"); sb.Append("</div>"); sb.Append("<hr />"); } lblBlogList.Text = StringHelper.htmlOutputText(sb.ToString()); }
public override void getData() { Johnny.CMS.BLL.SeH.Blog bll = new Johnny.CMS.BLL.SeH.Blog(); myManageGridView.DataSource = bll.GetList(); myManageGridView.DataBind(); }
protected void btnAdd_Click(object sender, System.EventArgs e) { //validation if (!CheckInputEmptyAndLength(txtTitle, "E00901", "E00902", false)) { return; } if (!CheckInputEmptyAndLength(txtHits, "E00901", "E00902", false)) { return; } Johnny.CMS.BLL.SeH.Blog bll = new Johnny.CMS.BLL.SeH.Blog(); Johnny.CMS.OM.SeH.Blog model = new Johnny.CMS.OM.SeH.Blog(); if (Request.QueryString["action"] == "modify") { //update model.BlogId = Convert.ToInt32(Request.QueryString["id"]); model.BlogCategoryId = DataConvert.GetInt32(ddlCategory.SelectedValue); model.Title = txtTitle.Text; model.Tag = txtTag.Text; model.Content = fckContent.Value; model.Hits = DataConvert.GetInt32(txtHits.Text); model.IsDisplay = rdbDisplay0.Checked; model.UpdatedTime = System.DateTime.Now; model.UpdatedById = DataConvert.GetInt32(Session["UserId"]); model.UpdatedByName = DataConvert.GetString(Session["UserName"]); bll.Update(model); SetMessage(GetMessage("C00003")); } else { //insert model.BlogCategoryId = DataConvert.GetInt32(ddlCategory.SelectedValue); model.Title = txtTitle.Text; model.Tag = txtTag.Text; model.Content = StringHelper.htmlInputText(fckContent.Value); model.Hits = DataConvert.GetInt32(txtHits.Text); model.IsDisplay = rdbDisplay0.Checked; model.CreatedTime = System.DateTime.Now; model.CreatedById = DataConvert.GetInt32(Session["UserId"]); model.CreatedByName = DataConvert.GetString(Session["UserName"]); model.UpdatedTime = System.DateTime.Now; model.UpdatedById = DataConvert.GetInt32(Session["UserId"]); model.UpdatedByName = DataConvert.GetString(Session["UserName"]); if (bll.Add(model) > 0) { SetMessage(GetMessage("C00001")); ddlCategory.SelectedIndex = 0; txtTitle.Text = ""; txtTag.Text = ""; fckContent.Value = ""; txtHits.Text = "0"; rdbDisplay0.Checked = true; lblCreatedTime.Text = ""; lblCreatedByName.Text = ""; lblUpdatedTime.Text = ""; lblUpdatedByName.Text = ""; } else { SetMessage(GetMessage("C00002")); } } }
protected override void Page_Load(object sender, EventArgs e) { base.Page_Load(sender, e); if (!this.IsPostBack) { litPageTitle.Text = GetLabelText("Blog_Title"); litCategory.Text = GetLabelText("Blog_BlogCategoryId"); ddlCategory.ToolTip = GetLabelText("Blog_BlogCategoryId"); litTitle.Text = GetLabelText("Blog_Title"); txtTitle.ToolTip = GetLabelText("Blog_Title"); litTag.Text = GetLabelText("Blog_Tag"); txtTag.ToolTip = GetLabelText("Blog_Tag"); litContent.Text = GetLabelText("Blog_Content"); litHits.Text = GetLabelText("Blog_Hits"); txtHits.ToolTip = GetLabelText("Blog_Hits"); litIsDisplay.Text = GetLabelText("Blog_IsDisplay"); rdbDisplay0.Text = GetLabelText("Common_Yes"); rdbDisplay1.Text = GetLabelText("Common_No"); litRdbDisplayTip.Text = GetLabelText("Blog_IsDisplay"); litCreatedTime.Text = GetLabelText("Common_CreatedTime"); litCreatedByName.Text = GetLabelText("Common_CreatedByName"); litUpdatedTime.Text = GetLabelText("Common_UpdatedTime"); litUpdatedByName.Text = GetLabelText("Common_UpdatedByName"); if (Request.QueryString["action"] == "modify") { //get id int BlogId = Convert.ToInt32(Request.QueryString["id"]); Johnny.CMS.BLL.SeH.Blog bll = new Johnny.CMS.BLL.SeH.Blog(); Johnny.CMS.OM.SeH.Blog model = new Johnny.CMS.OM.SeH.Blog(); model = bll.GetModel(BlogId); CreateddlCategory(); foreach (ListItem item in ddlCategory.Items) { if (DataConvert.GetInt32(item.Value) == model.BlogCategoryId) { item.Selected = true; break; } } txtTitle.Text = model.Title; txtTag.Text = model.Tag; fckContent.Value = model.Content; txtHits.Text = DataConvert.GetString(model.Hits); if (model.IsDisplay) { rdbDisplay0.Checked = true; } else { rdbDisplay1.Checked = true; } lblCreatedTime.Text = DataConvert.GetLongDateString(model.CreatedTime); lblCreatedByName.Text = model.CreatedByName; lblUpdatedTime.Text = DataConvert.GetLongDateString(model.UpdatedTime); lblUpdatedByName.Text = model.UpdatedByName; btnAdd.ButtonType = Johnny.Controls.Web.Button.Button.EnumButtonType.Save; //btnAdd.Text = CONST_BUTTONTEXT_SAVE; } else { CreateddlCategory(); rdbDisplay0.Checked = true; txtHits.Text = "0"; } } }
protected void Page_Load(object sender, EventArgs e) { //blog Johnny.CMS.BLL.SeH.Blog bll = new Johnny.CMS.BLL.SeH.Blog(); IList<Johnny.CMS.OM.SeH.Blog> list = bll.GetList(); StringBuilder sb = new StringBuilder(); foreach (Johnny.CMS.OM.SeH.Blog blog in list) { sb.Append(string.Format("<li><a href=\"blogdetail.aspx?blogid={0}\">{1}({2})</a></li>", blog.BlogId, blog.Title, DataConvert.GetShortDateString(blog.UpdatedTime))); } lblBlogList.Text = sb.ToString(); //website sb.Length = 0; Johnny.CMS.BLL.SeH.Website bllWebsite = new Johnny.CMS.BLL.SeH.Website(); IList<Johnny.CMS.OM.SeH.Website> listWebsite = bllWebsite.GetList(35); int ix = 0; for (ix = 0; ix < listWebsite.Count; ix++) { if (ix % 12 == 0) sb.Append("<ul>"); sb.Append(string.Format("<li><a href=\"{0}\" target=\"_blank\" title=\"{1}\">{2}</a></li>", listWebsite[ix].URL, listWebsite[ix].Description, listWebsite[ix].WebsiteName)); if (ix == listWebsite.Count - 1) sb.Append("<li><b><a href=\"websites.aspx\">更多 <img class=\"arrowimage\" src=\"images/arrow.png\" /></a></b></li>"); if (ix != 0 && (ix == listWebsite.Count - 1 || ix % 11 == 0)) sb.Append("</ul>"); } lblWebsites.Text = sb.ToString(); //software sb.Length = 0; Johnny.CMS.BLL.SeH.Software bllSoftware = new Johnny.CMS.BLL.SeH.Software(); IList<Johnny.CMS.OM.SeH.Software> listSoftware = bllSoftware.GetList(2); for (ix = 0; ix < listSoftware.Count; ix++) { sb.Append("<div class=\"home-block-inner\">"); sb.Append(string.Format(" <a href=\"softwaredetail.aspx?softwareid={0}\"><img class=\"shot\" src=\"{1}\" /></a>", listSoftware[ix].SoftwareId, listSoftware[ix].Image)); sb.Append(string.Format(" <h3><a href=\"softwaredetail.aspx?softwareid={0}\">{1}</a><span style=\"padding-left:10px\"><img style=\"position:relative;top:-7px;left:4px\" src=\"images/new.gif\"></span></h3>", listSoftware[ix].SoftwareId, listSoftware[ix].SoftwareName)); sb.Append(string.Format(" <p style=\"margin:0 0 8px 0\">{0}</p>", listSoftware[ix].ShortDescription)); sb.Append(" <ul>"); sb.Append(string.Format(" <li><span>{0}</span></li>", listSoftware[ix].Feature1)); sb.Append(string.Format(" <li><span>{0}</span></li>", listSoftware[ix].Feature2)); sb.Append(string.Format(" <li><span>{0}</span></li>", listSoftware[ix].Feature3)); sb.Append(string.Format(" <li><span>{0}</span></li>", listSoftware[ix].Feature4)); sb.Append(" </ul>"); sb.Append(string.Format(" <a href=\"softwaredetail.aspx?softwareid={0}\"><img class=\"learn-more\" src=\"images/learn-more.png\" /></a>", listSoftware[ix].SoftwareId)); sb.Append(" <div style=\"clear:both\"></div>"); sb.Append("</div>"); if (ix == 0) { lblSoftware1.Text = sb.ToString(); sb.Length = 0; } else lblSoftware2.Text = sb.ToString(); } }
protected void btnAdd_Click(object sender, System.EventArgs e) { //validation if (!CheckInputEmptyAndLength(txtTitle, "E00901", "E00902", false)) return; if (!CheckInputEmptyAndLength(txtHits, "E00901", "E00902", false)) return; Johnny.CMS.BLL.SeH.Blog bll = new Johnny.CMS.BLL.SeH.Blog(); Johnny.CMS.OM.SeH.Blog model = new Johnny.CMS.OM.SeH.Blog(); if (Request.QueryString["action"] == "modify") { //update model.BlogId = Convert.ToInt32(Request.QueryString["id"]); model.BlogCategoryId = DataConvert.GetInt32(ddlCategory.SelectedValue); model.Title = txtTitle.Text; model.Tag = txtTag.Text; model.Content = fckContent.Value; model.Hits = DataConvert.GetInt32(txtHits.Text); model.IsDisplay = rdbDisplay0.Checked; model.UpdatedTime = System.DateTime.Now; model.UpdatedById = DataConvert.GetInt32(Session["UserId"]); model.UpdatedByName = DataConvert.GetString(Session["UserName"]); bll.Update(model); SetMessage(GetMessage("C00003")); } else { //insert model.BlogCategoryId = DataConvert.GetInt32(ddlCategory.SelectedValue); model.Title = txtTitle.Text; model.Tag = txtTag.Text; model.Content = StringHelper.htmlInputText(fckContent.Value); model.Hits = DataConvert.GetInt32(txtHits.Text); model.IsDisplay = rdbDisplay0.Checked; model.CreatedTime = System.DateTime.Now; model.CreatedById = DataConvert.GetInt32(Session["UserId"]); model.CreatedByName = DataConvert.GetString(Session["UserName"]); model.UpdatedTime = System.DateTime.Now; model.UpdatedById = DataConvert.GetInt32(Session["UserId"]); model.UpdatedByName = DataConvert.GetString(Session["UserName"]); if (bll.Add(model) > 0) { SetMessage(GetMessage("C00001")); ddlCategory.SelectedIndex = 0; txtTitle.Text = ""; txtTag.Text = ""; fckContent.Value = ""; txtHits.Text = "0"; rdbDisplay0.Checked = true; lblCreatedTime.Text = ""; lblCreatedByName.Text = ""; lblUpdatedTime.Text = ""; lblUpdatedByName.Text = ""; } else SetMessage(GetMessage("C00002")); } }
protected override void Page_Load(object sender, EventArgs e) { base.Page_Load(sender, e); if (!this.IsPostBack) { litPageTitle.Text = GetLabelText("Blog_Title"); litCategory.Text = GetLabelText("Blog_BlogCategoryId"); ddlCategory.ToolTip = GetLabelText("Blog_BlogCategoryId"); litTitle.Text = GetLabelText("Blog_Title"); txtTitle.ToolTip = GetLabelText("Blog_Title"); litTag.Text = GetLabelText("Blog_Tag"); txtTag.ToolTip = GetLabelText("Blog_Tag"); litContent.Text = GetLabelText("Blog_Content"); litHits.Text = GetLabelText("Blog_Hits"); txtHits.ToolTip = GetLabelText("Blog_Hits"); litIsDisplay.Text = GetLabelText("Blog_IsDisplay"); rdbDisplay0.Text = GetLabelText("Common_Yes"); rdbDisplay1.Text = GetLabelText("Common_No"); litRdbDisplayTip.Text = GetLabelText("Blog_IsDisplay"); litCreatedTime.Text = GetLabelText("Common_CreatedTime"); litCreatedByName.Text = GetLabelText("Common_CreatedByName"); litUpdatedTime.Text = GetLabelText("Common_UpdatedTime"); litUpdatedByName.Text = GetLabelText("Common_UpdatedByName"); if (Request.QueryString["action"] == "modify") { //get id int BlogId = Convert.ToInt32(Request.QueryString["id"]); Johnny.CMS.BLL.SeH.Blog bll = new Johnny.CMS.BLL.SeH.Blog(); Johnny.CMS.OM.SeH.Blog model = new Johnny.CMS.OM.SeH.Blog(); model = bll.GetModel(BlogId); CreateddlCategory(); foreach (ListItem item in ddlCategory.Items) { if (DataConvert.GetInt32(item.Value) == model.BlogCategoryId) { item.Selected = true; break; } } txtTitle.Text = model.Title; txtTag.Text = model.Tag; fckContent.Value = model.Content; txtHits.Text = DataConvert.GetString(model.Hits); if (model.IsDisplay) rdbDisplay0.Checked = true; else rdbDisplay1.Checked = true; lblCreatedTime.Text = DataConvert.GetLongDateString(model.CreatedTime); lblCreatedByName.Text = model.CreatedByName; lblUpdatedTime.Text = DataConvert.GetLongDateString(model.UpdatedTime); lblUpdatedByName.Text = model.UpdatedByName; btnAdd.ButtonType = Johnny.Controls.Web.Button.Button.EnumButtonType.Save; //btnAdd.Text = CONST_BUTTONTEXT_SAVE; } else { CreateddlCategory(); rdbDisplay0.Checked = true; txtHits.Text = "0"; } } }
protected void Page_Load(object sender, EventArgs e) { //blog Johnny.CMS.BLL.SeH.Blog bll = new Johnny.CMS.BLL.SeH.Blog(); IList <Johnny.CMS.OM.SeH.Blog> list = bll.GetList(); StringBuilder sb = new StringBuilder(); foreach (Johnny.CMS.OM.SeH.Blog blog in list) { sb.Append(string.Format("<li><a href=\"blogdetail.aspx?blogid={0}\">{1}({2})</a></li>", blog.BlogId, blog.Title, DataConvert.GetShortDateString(blog.UpdatedTime))); } lblBlogList.Text = sb.ToString(); //website sb.Length = 0; Johnny.CMS.BLL.SeH.Website bllWebsite = new Johnny.CMS.BLL.SeH.Website(); IList <Johnny.CMS.OM.SeH.Website> listWebsite = bllWebsite.GetList(35); int ix = 0; for (ix = 0; ix < listWebsite.Count; ix++) { if (ix % 12 == 0) { sb.Append("<ul>"); } sb.Append(string.Format("<li><a href=\"{0}\" target=\"_blank\" title=\"{1}\">{2}</a></li>", listWebsite[ix].URL, listWebsite[ix].Description, listWebsite[ix].WebsiteName)); if (ix == listWebsite.Count - 1) { sb.Append("<li><b><a href=\"websites.aspx\">更多 <img class=\"arrowimage\" src=\"images/arrow.png\" /></a></b></li>"); } if (ix != 0 && (ix == listWebsite.Count - 1 || ix % 11 == 0)) { sb.Append("</ul>"); } } lblWebsites.Text = sb.ToString(); //software sb.Length = 0; Johnny.CMS.BLL.SeH.Software bllSoftware = new Johnny.CMS.BLL.SeH.Software(); IList <Johnny.CMS.OM.SeH.Software> listSoftware = bllSoftware.GetList(2); for (ix = 0; ix < listSoftware.Count; ix++) { sb.Append("<div class=\"home-block-inner\">"); sb.Append(string.Format(" <a href=\"softwaredetail.aspx?softwareid={0}\"><img class=\"shot\" src=\"{1}\" /></a>", listSoftware[ix].SoftwareId, listSoftware[ix].Image)); sb.Append(string.Format(" <h3><a href=\"softwaredetail.aspx?softwareid={0}\">{1}</a><span style=\"padding-left:10px\"><img style=\"position:relative;top:-7px;left:4px\" src=\"images/new.gif\"></span></h3>", listSoftware[ix].SoftwareId, listSoftware[ix].SoftwareName)); sb.Append(string.Format(" <p style=\"margin:0 0 8px 0\">{0}</p>", listSoftware[ix].ShortDescription)); sb.Append(" <ul>"); sb.Append(string.Format(" <li><span>{0}</span></li>", listSoftware[ix].Feature1)); sb.Append(string.Format(" <li><span>{0}</span></li>", listSoftware[ix].Feature2)); sb.Append(string.Format(" <li><span>{0}</span></li>", listSoftware[ix].Feature3)); sb.Append(string.Format(" <li><span>{0}</span></li>", listSoftware[ix].Feature4)); sb.Append(" </ul>"); sb.Append(string.Format(" <a href=\"softwaredetail.aspx?softwareid={0}\"><img class=\"learn-more\" src=\"images/learn-more.png\" /></a>", listSoftware[ix].SoftwareId)); sb.Append(" <div style=\"clear:both\"></div>"); sb.Append("</div>"); if (ix == 0) { lblSoftware1.Text = sb.ToString(); sb.Length = 0; } else { lblSoftware2.Text = sb.ToString(); } } }