-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCommunitywrite.aspx.cs
More file actions
78 lines (62 loc) · 1.97 KB
/
Communitywrite.aspx.cs
File metadata and controls
78 lines (62 loc) · 1.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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class bbswrite : System.Web.UI.Page
{
int no;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (Session["email"] == null) Response.Redirect("Communitylist.aspx");
switch (int.Parse(Request["md"]))
{
case 0:
case 2:
txtId.Text = Session["email"].ToString();
break;
case 1:
BbsDo bDo = (new BbsDao()).GetBoardDetails(int.Parse(Request["no"]));
if (Session["email"].ToString() != bDo.Author)
return;
txtId.Text = bDo.Author;
txtTitle.Text = bDo.Title;
txtContents.Text = bDo.Contents;
break;
}
}
Response.Write(txtContents.Text.Replace("\r\n", "<br>"));
}
private string GetFileName(string path)
{
return path.Substring(path.LastIndexOf(@"\") + 1);
}
protected void txtId_TextChanged(object sender, EventArgs e)
{
}
protected void btnWirte_Click(object sender, EventArgs e)
{
BbsDo mDo = new BbsDo(txtTitle.Text, txtContents.Text, txtId.Text, Session["email"].ToString());
switch (int.Parse(Request["md"]))
{
case 0:
no = (new BbsDao()).NewBoardArticle(mDo);
break;
case 1:
no = int.Parse(Request["no"]);
(new BbsDao()).UpdateBoard(mDo, no);
break;
}
Response.Redirect("Communitylist.aspx");
}
protected void btnList_Click(object sender, EventArgs e)
{
Response.Redirect("Communitylist.aspx");
}
protected void txtContents_TextChanged(object sender, EventArgs e)
{
}
}