65 lines
1.7 KiB
C#
65 lines
1.7 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using System.Web.Services;
|
|
using System.Web.UI;
|
|
using System.Web.UI.WebControls;
|
|
|
|
public partial class SystemManage_signation : System.Web.UI.Page
|
|
{
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!Page.IsPostBack)
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
public string getSignation()
|
|
{
|
|
ZWL.BLL.ERPUser bll = new ZWL.BLL.ERPUser();
|
|
//string path = bll.GetSignation(ZWL.Common.PublicMethod.GetSessionValue("UserID"));
|
|
string path = bll.GetSignation("32");
|
|
return path;
|
|
}
|
|
|
|
[WebMethod]
|
|
public static string setSignation(string qianming)
|
|
{
|
|
if (qianming.Length > 0)
|
|
{
|
|
string str = Guid.NewGuid().ToString();
|
|
//string path = Server.MapPath("/qm/" + str + ".jpg");
|
|
string path = "";
|
|
sctx(qianming, path);
|
|
//bool flag = new ZWL.BLL.ERPUser().SetSignation(ZWL.Common.PublicMethod.GetSessionValue("UserID"), "/qm/" + str + ".jpg");
|
|
bool flag = new ZWL.BLL.ERPUser().SetSignation("32", "/qm/" + str + ".jpg");
|
|
if (flag)
|
|
{
|
|
return "修改成功!";
|
|
}
|
|
else
|
|
{
|
|
return "修改失败!";
|
|
}
|
|
}
|
|
else
|
|
{
|
|
return "无内容!";
|
|
}
|
|
}
|
|
|
|
public static void sctx(string base64, string file)
|
|
{
|
|
MemoryStream stream = new MemoryStream(Convert.FromBase64String(base64));
|
|
FileStream stream2 = new FileStream(file, FileMode.OpenOrCreate);
|
|
stream.WriteTo(stream2);
|
|
stream.Close();
|
|
stream2.Close();
|
|
stream = null;
|
|
stream2 = null;
|
|
}
|
|
} |