-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfrmForum.aspx.cs
91 lines (76 loc) · 3.03 KB
/
frmForum.aspx.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using IEF_Visualization.cls;
namespace IEF_Visualization
{
public partial class frmForum : System.Web.UI.Page
{
clsDataHandling objDataHandling = new clsDataHandling();
protected void Page_Load(object sender, EventArgs e)
{
string user_name = Session["USER_NAME"] as string;
//string user_name = "stefan21";
//objUserManager.user_name = user_name;
if (user_name == null || user_name == "")
{
Response.Redirect("frmHome.aspx", false);
}
else
{
lblUser.Text = Session["USER_FULL_NAME"] as string;
//lbl_hi_user.Text = user_name;
}
if (!IsPostBack)
{
objDataHandling.showFeedbackGrid(grdFeedback);
}
}
protected void btnAddFeedBack_Click(object sender, EventArgs e)
{
string feedback = Convert.ToString(txtFeedback.Text);
string user_name = Session["USER_NAME"] as string;
objDataHandling.SaveFeedback(user_name,feedback);
string script = "alert('" + "Feedback submitted Successfully" + "');";
ScriptManager.RegisterStartupScript(this, typeof(Page), "UserSecurity", script, true);
Response.Redirect(Request.RawUrl);
objDataHandling.showFeedbackGrid(grdFeedback);
}
protected void grdFeedback_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
GridViewRow row = grdFeedback.Rows[e.RowIndex];
string id = Convert.ToString(row.Cells[0].Text);
string un = Convert.ToString(row.Cells[1].Text);
objDataHandling.DeleteFeedback(id, un);
objDataHandling.showFeedbackGrid(grdFeedback);
}
protected void grdFeedback_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
GridViewRow row = grdFeedback.Rows[e.RowIndex];
string id = Convert.ToString(row.Cells[0].Text);
string un = Convert.ToString(row.Cells[1].Text);
string fd = ((TextBox)(row.Cells[2].Controls[0])).Text;
objDataHandling.UpdateFeedback(id, un, fd);
grdFeedback.EditIndex = -1;
objDataHandling.showFeedbackGrid(grdFeedback);
}
protected void grdFeedback_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
{
grdFeedback.EditIndex = -1;
objDataHandling.showFeedbackGrid(grdFeedback);
}
protected void grdFeedback_RowEditing(object sender, GridViewEditEventArgs e)
{
grdFeedback.EditIndex = e.NewEditIndex;
objDataHandling.showFeedbackGrid(grdFeedback);
}
protected void btnLoggOut_Click(object sender, EventArgs e)
{
Session.RemoveAll();
Response.Redirect("frmHome.aspx", false);
}
}
}