-
Notifications
You must be signed in to change notification settings - Fork 1
/
ManageComment.ascx.cs
68 lines (59 loc) · 2.54 KB
/
ManageComment.ascx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
using System;
using DotNetNuke.Services.Exceptions;
using DotNetNuke.Services.Localization;
using DotNetNuke.UI.Utilities;
using Globals=DotNetNuke.Common.Globals;
namespace Engage.Dnn.Locator
{
using System.Globalization;
public partial class ManageComment : ModuleBase
{
protected void Page_Load(object sender, EventArgs e)
{
try
{
if (!Page.IsPostBack)
{
int commentId = Convert.ToInt32(Request.QueryString["cid"], CultureInfo.InvariantCulture);
Comment comment = Comment.GetComment(commentId);
lblCommentId.Text = comment.CommentId.ToString(CultureInfo.InvariantCulture);
lblLocationTitle.Text = comment.LocationName;
txtComment.Text = comment.Text;
txtSubmittedBy.Text = comment.SubmittedBy;
if (comment.Approved)
{
rbApproved.Checked = true;
}
else
{
rbWaitingForApproval.Checked = true;
}
ClientAPI.AddButtonConfirm(btnDelete, Localization.GetString("confirmDelete", LocalResourceFile));
}
}
catch (Exception exc) //Module failed to load
{
Exceptions.ProcessModuleLoadException(this, exc);
}
}
protected void btnCancel_Click(object sender, EventArgs e)
{
Response.Redirect(Globals.NavigateURL(TabId, "Import", "mid=" + ModuleId + "&tmid=" + TabModuleId));
}
protected void btnSaveComment_Click(object sender, EventArgs e)
{
Comment comment = new Comment();
comment.CommentId = Convert.ToInt32(lblCommentId.Text, CultureInfo.InvariantCulture);
comment.Text = txtComment.Text;
comment.SubmittedBy = txtSubmittedBy.Text;
comment.Approved = rbApproved.Checked;
comment.SaveComment();
Response.Redirect(Globals.NavigateURL(TabId, "Import", "mid=" + ModuleId + "&tmid=" + TabModuleId));
}
protected void btnDelete_Click(object sender, EventArgs e)
{
Comment.DeleteComment(Convert.ToInt32(lblCommentId.Text, CultureInfo.InvariantCulture));
Response.Redirect(Globals.NavigateURL(TabId, "Import", "mid=" + ModuleId + "&tmid=" + TabModuleId));
}
}
}