45 lines
1.1 KiB
C#
45 lines
1.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using System.Web.Services;
|
|
|
|
/// <summary>
|
|
///getuser 的摘要说明
|
|
/// </summary>
|
|
[WebService(Namespace = "http://tempuri.org/")]
|
|
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
|
|
//若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消对下行的注释。
|
|
// [System.Web.Script.Services.ScriptService]
|
|
public class getuser : System.Web.Services.WebService
|
|
{
|
|
|
|
public getuser()
|
|
{
|
|
|
|
//如果使用设计的组件,请取消注释以下行
|
|
//InitializeComponent();
|
|
}
|
|
|
|
[WebMethod(EnableSession = true)]
|
|
public bool IsAdmin()
|
|
{
|
|
bool permission = false;
|
|
if (HttpContext.Current.Session != null)
|
|
{
|
|
Maticsoft.Model.nr_z_yhzh user = (Maticsoft.Model.nr_z_yhzh)(HttpContext.Current.Session["user"]);
|
|
if (user.zhanghao == "admin" && user.id == 1)
|
|
{
|
|
permission = true;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
permission = false;
|
|
}
|
|
|
|
return permission;
|
|
}
|
|
|
|
}
|