-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClientwrite.aspx.cs
More file actions
91 lines (71 loc) · 2.54 KB
/
Clientwrite.aspx.cs
File metadata and controls
91 lines (71 loc) · 2.54 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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class ClientWrite : System.Web.UI.Page
{
int no;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (Session["email"] == null) Response.Redirect("login.aspx");
if ((new MemberDao()).GetUgradeOfGradeid(Session["email"].ToString()) < (new MemberDao().GetUgradeOfGradename("고객"))) Response.Redirect("Clientlist.aspx");
//txtId.Text = Session["email"].ToString();
switch (int.Parse(Request["md"]))
{
case 0:
case 2:
txtId.Text = Session["email"].ToString();
break;
case 1:
ProjectCDo bDo = (new ProjectCDao()).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)
{
string fname = "";
if (FileUpload1.HasFile) fname = this.GetFileName(FileUpload1.FileName);
ProjectCDo mDo = new ProjectCDo(txtTitle.Text, txtContents.Text, txtId.Text, Session["email"].ToString(), fname);
switch (int.Parse(Request["md"]))
{
case 0:
no = (new ProjectCDao()).NewBoardArticle(mDo);
break;
case 1:
no = int.Parse(Request["no"]);
(new ProjectCDao()).UpdateArticle(mDo, no);
break;
}
if (fname != "")
{
string uFname = "cnotice_" + no.ToString() + fname.Substring(fname.IndexOf("."));
FileUpload1.SaveAs(Server.MapPath(@"Cnotice\" + uFname));
}
Response.Redirect("Clientlist.aspx");
}
protected void btnList_Click(object sender, EventArgs e)
{
Response.Redirect("Clientlist.aspx");
}
protected void txtContents_TextChanged(object sender, EventArgs e)
{
}
}