private void bindComments() { var result = WebboardController.getComment(null, topic_id); rptComments.DataSource = result.OrderBy(d => d.create_date); rptComments.DataBind(); }
protected void rptComments_ItemCommand(object source, RepeaterCommandEventArgs e) { try { string comment_id = (string)e.CommandArgument; switch (e.CommandName) { case "EDIT": RedirectTo("~/Backend/Webboard/CommentEdit.aspx" + "?comment_id=" + comment_id); break; case "DEL": WebboardController.DelComment(comment_id, true); break; default: break; } bindTopicDetail(); bindComments(); } catch (Exception exc) { } }
private void setComment() { var result = WebboardController.getComment(comment_id, null); var info = result[0]; if (info == null) { ShowMessage(Page, "ไม่พบความเห็นนี้"); return; } info.description = txtDescription.Text; info.lastupdate_by = (SessionApp.user_info == null) ? "No Login" : SessionApp.user_info.user_name; info.lastupdate_date = DateTime.Now; var resulttopic = WebboardController.setComment(info); if (result != null) { bindComment(); ShowMessage(Page, "แก้ไขสำเร็จ"); } else { ShowMessage(Page, "แก้ไขผิดพลาด"); } }
private void setTopic() { var result = WebboardController.getTopic(topic_id); var current = result[0]; if (current == null) { ShowMessage(Page, "ไม่พบกระทู้นี้"); return; } var info = new TopicInfo(); info.topic_id = topic_id; info.title = txtTitle.Text; info.description = txtDescription.Text; info.read_count = current.read_count; info.is_top = rdoYes.Checked ? true : false; info.lastupdate_by = (SessionApp.user_info == null) ? "No Login" : SessionApp.user_info.user_name; info.lastupdate_date = DateTime.Now; var resulttopic = WebboardController.setToppic(info); if (result != null) { bindTopicDetail(); bindComments(); ShowMessage(Page, "แก้ไขสำเร็จ"); } else { ShowMessage(Page, "แก้ไขผิดพลาด"); } }
private void serchTopic() { var result = WebboardController.SearchTopic(txtTitle.Text); rptTopics.DataSource = result; rptTopics.DataBind(); }
private void bindtopicList() { var result = WebboardController.getTopic(null); rptTopics.DataSource = result; rptTopics.DataBind(); }
private void bindTopic2() { var result = WebboardController.getTopic(null); rptTopics2.DataSource = result.OrderByDescending(d => d.lastupdate_date); rptTopics2.DataBind(); }
private void bindComment() { var result = WebboardController.getComment(comment_id, null); var current = result[0]; if (current == null) { ShowMessage(Page, "ไม่พบความเห็นนี้"); return; } txtDescription.Text = current.description; }
private void bindTopicDetail() { var result = WebboardController.getTopic(topic_id); if (result.Count > 0) { var current = result[0]; if (current != null) { txtTitle.Text = current.title; txtDescription.Text = current.description; rdoYes.Checked = current.is_top; } } }
private void bindTopicDetail() { var result = WebboardController.getTopic(topic_id); if (result.Count > 0) { var current = result[0]; if (current != null) { lblTitle.InnerText = current.title; lblDes.InnerHtml = current.description; lblCreateBy.InnerText = current.create_by; lblTime.InnerText = current.create_date.ToString("dd MMM yyyy - HH:mm:ss"); navSup.InnerText = current.title; navSup.HRef = HttpContext.Current.Request.Url.PathAndQuery; } } }
private void addComment() { CommentInfo info = new CommentInfo(); info.topic_id = topic_id; info.description = txtDescription.Text; info.create_by = (SessionApp.user_info == null) ? "No Login" : SessionApp.user_info.user_name; var result = WebboardController.addComment(info); if (result == null) { ShowMessage(Page, "เพิ่มไม่สำเร็จ"); } else { ShowMessage(Page, "เพิ่มความเห็นสำเร็จ"); bindComments(); } }
private void addTopic() { TopicInfo top = new TopicInfo(); top.title = txtTitle.Text; top.description = txtDescription.Text; top.create_by = (SessionApp.user_info == null) ? "ไม่เป็นสามาชิก" : SessionApp.user_info.user_name; var result = WebboardController.addTopic(top); if (result == null) { ShowMessage(Page, "เพิ่มผิดพลาด"); } else { RedirectTo("~/Webboard/TopicDetail?topic_id=" + result.topic_id); } }
protected void rptTopics_ItemCommand(object source, RepeaterCommandEventArgs e) { try { string topic_id = (string)e.CommandArgument; switch (e.CommandName) { case "EDIT": RedirectTo("~/Backend/Webboard/TopicEdit.aspx" + "?topic_id=" + topic_id); break; case "DEL": WebboardController.DelTopic(topic_id, true); break; default: break; } bindtopicList(); } catch (Exception exc) { } }