-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHDealReview.ashx
49 lines (40 loc) · 1.39 KB
/
HDealReview.ashx
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
<%@ WebHandler Language="C#" Class="HDealReview" %>
using System;
using System.Web;
using BLL;
public class HDealReview : IHttpHandler {
public void ProcessRequest (HttpContext context)
{
context.Response.ContentType = "text/plain";
try
{
int lMsgId=-1;
string leaveMsgId = "";
string articleId = context.Request.Form["artId"];
DateTime reviewDate = DateTime.Now;
try
{
leaveMsgId = context.Session["leaveMsgId"].ToString();
lMsgId=int.Parse(leaveMsgId);
}
catch { }
string fileName = context.Request.Form["fileName"];
string reviewContent = context.Request.Form["revContent"];
string reviewFileName = @"\" + reviewDate.ToString("yyyy-MM-dd.HH-mm-ss");
string dirPath = BLL.BLArticle.artPath + fileName + reviewFileName;
System.IO.File.WriteAllBytes(dirPath , System.Text.Encoding.Default.GetBytes(reviewContent));
BLL.BLReview bll = new BLReview();
if (!bll.Insert(int.Parse(articleId), lMsgId, reviewDate, dirPath))
context.Response.Write("2");
context.Response.Write("1");
}
catch
{
}
}
public bool IsReusable {
get {
return false;
}
}
}