-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFreeshow.aspx.cs
More file actions
100 lines (86 loc) · 2.97 KB
/
Freeshow.aspx.cs
File metadata and controls
100 lines (86 loc) · 2.97 KB
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
92
93
94
95
96
97
98
99
100
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
public partial class Freeshow : System.Web.UI.Page
{
static int no;
static ProjectFDo mDo;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
no = int.Parse(Request["no"].ToString());
mDo = (new ProjectFDao()).GetBoardDetails(no);
lblName.Text = mDo.Name;
lblContents.Text = mDo.Contents;
if (mDo.Filename.Length > 0)
{
lblFname.Text = mDo.Filename;
hyperDownload.Visible = true;
Session["path"] = "Fnotice\\fnotice_" + no.ToString() + mDo.Filename.Substring(mDo.Filename.IndexOf("."));
Session["fname"] = mDo.Filename;
}
lblHits.Text = mDo.Hits.ToString();
lblTitle.Text = mDo.Title;
lblUploadDate.Text = mDo.Uploadtime;
}
}
protected void btnList_Click(object sender, EventArgs e)
{
Response.Redirect("Freelist.aspx");
}
protected void btnModify_Click(object sender, EventArgs e)
{
Response.Redirect("Freewrite.aspx?md=1&no=" + no);
}
protected void btnDelete_Click(object sender, EventArgs e)
{
if (Session["email"] == null)
{
lblMessage.Text = "본인이 작성한 글만 삭제할 수 있습니다.";
return;
}
if ((Session["email"].ToString() == mDo.Author) || ((new MemberDao()).CheckAuth(Session["email"].ToString(), (new MemberDao()).GetUgradeOfGradename("프리랜서"))))
{
if (Session["path"] != null)
{
string path = Request.PhysicalApplicationPath + "\\" + Session["path"].ToString();
if (File.Exists(path)) File.Delete(path);
Session["path"] = null;
Session["fname"] = null;
}
(new ProjectFDao()).RemoveArticle(no);
Response.Redirect("Freelist.aspx");
}
else
{
lblMessage.Text = "본인이 작성한 글만 삭제할 수 있습니다.";
}
}
private void DisplyReply(int iPage)
{
grvClientProReply.DataSource = mDo.FreeProReply;
grvClientProReply.PageIndex = iPage;
grvClientProReply.DataBind();
}
private void DisplayReply()
{
grvClientProReply.DataSource = (new ProjectFDao()).GetFreeLancerProReplyList(no);
grvClientProReply.PageIndex = 0;
grvClientProReply.DataBind();
}
protected void grvFreeLancerProReply_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
DisplyReply(e.NewPageIndex);
}
protected void btnOk_Click(object sender, EventArgs e)
{
(new ProjectFDao()).InsertFreeLancerProReply(no, Session["email"].ToString(), txtReply.Text);
txtReply.Text = "";
DisplayReply();
}
}