You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
66 lines
1.6 KiB
66 lines
1.6 KiB
2 months ago
|
using MESClassLibrary.BLL.User;
|
||
|
using System;
|
||
|
using System.Collections.Generic;
|
||
|
using System.Linq;
|
||
|
using System.Web;
|
||
|
|
||
|
namespace MESWebSite.HttpHandlers
|
||
|
{
|
||
|
/// <summary>
|
||
|
/// IndexHandler 的摘要说明
|
||
|
/// </summary>
|
||
|
public class IndexHandler : IHttpHandler
|
||
|
{
|
||
|
|
||
|
HttpRequest Request = null;
|
||
|
HttpResponse Response = null;
|
||
|
|
||
|
public void ProcessRequest(HttpContext context)
|
||
|
{
|
||
|
context.Response.ContentType = "text/plain";
|
||
|
Request = context.Request;
|
||
|
Response = context.Response;
|
||
|
|
||
|
string method = Request.Params["method"];
|
||
|
switch (method)
|
||
|
{
|
||
|
|
||
|
|
||
|
case "SaveInfo":
|
||
|
SaveInfo();
|
||
|
break;
|
||
|
default:
|
||
|
break;
|
||
|
|
||
|
}
|
||
|
|
||
|
}
|
||
|
public bool IsReusable
|
||
|
{
|
||
|
get
|
||
|
{
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
void SaveInfo()
|
||
|
{
|
||
|
string userid = Request.Params["userid"];
|
||
|
string old_password = Request.Params["old_password"];
|
||
|
string password_1 = Request.Params["password_1"];
|
||
|
string password_2 = Request.Params["password_2"];
|
||
|
|
||
|
|
||
|
if (password_1 == password_2)
|
||
|
{
|
||
|
UserBLL bll = new UserBLL();
|
||
|
Response.Write(bll.UpdateUserPassword(old_password, password_1, userid) == true ? "true" : "false");
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
Response.Write("false");
|
||
|
}
|
||
|
Response.End();
|
||
|
}
|
||
|
|
||
|
}
|
||
|
}
|