85 lines
3.2 KiB
C#
85 lines
3.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using System.Web.UI;
|
|
using System.Web.UI.WebControls;
|
|
using System.Data;
|
|
using System.Data.SqlClient;
|
|
using Ajax;
|
|
|
|
public partial class UserAccount : CommonPage
|
|
{
|
|
//创建一个共用的角色bll
|
|
Maticsoft.BLL.nr_z_yhjs juesebll = new Maticsoft.BLL.nr_z_yhjs();
|
|
//创建一个操作记录模板
|
|
Maticsoft.Model.nr_sys_rizhi rizhi = new Maticsoft.Model.nr_sys_rizhi();
|
|
//创建一个操作记录bll
|
|
Maticsoft.BLL.nr_sys_rizhi rizhibll = new Maticsoft.BLL.nr_sys_rizhi();
|
|
Maticsoft.Model.nr_z_yhjs jsmd = new Maticsoft.Model.nr_z_yhjs();
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
Utility.RegisterTypeForAjax(typeof(UserAccount));
|
|
if (!IsPostBack)
|
|
{
|
|
if (Session["user"] == null)
|
|
{
|
|
Response.Redirect("../index.aspx");
|
|
}
|
|
//获取角色权限
|
|
Maticsoft.Model.nr_z_yhzh user = (Maticsoft.Model.nr_z_yhzh)(Session["user"]);
|
|
getbd();
|
|
pdquanxian(user.juese);
|
|
}
|
|
}
|
|
|
|
private void getbd()
|
|
{
|
|
DataSet rzds = DBHlper.Execute("select * from dbo.nr_z_yhjs");
|
|
if (rzds != null)
|
|
{
|
|
juese.DataSource = rzds.Tables[0].DefaultView;
|
|
juese.DataValueField = "mingcheng";
|
|
juese.DataTextField = "mingcheng";
|
|
juese.DataBind();
|
|
juese.Items.Insert(0, new ListItem("全部", ""));
|
|
}
|
|
}
|
|
#region 敏感权限查看
|
|
void pdquanxian(int juese)
|
|
{
|
|
Maticsoft.Model.nr_z_yhzh user = (Maticsoft.Model.nr_z_yhzh)(Session["user"]);
|
|
if (DBHlper.getzt(user.id) != 1)
|
|
{
|
|
Response.Redirect("../index.aspx");
|
|
}
|
|
if (DBHlper.GetPermission(juese, "系统用户", "nr_z_yhzh", "查看全部") == false)
|
|
{
|
|
Response.Redirect("../Common/nopower.htm");
|
|
}
|
|
if (DBHlper.GetPermission(juese, "系统用户", "nr_z_yhzh", "添加"))
|
|
{
|
|
bt_add.Visible = true;
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
protected void cxrz_Click(object sender, EventArgs e)
|
|
{
|
|
string rzjgst = "<table class='bule' style='margin-top:0px;width:1000px;margin-left:0px;'> ";
|
|
DataSet rizhids = DBHlper.Execute(" select* from view_nr_z_yhzh where " + cxlx.SelectedValue + " like '%" + yhmc.Text + "%' and isqiyong like'%" + zhzt.SelectedValue + "%'and juese like'%" + juese.Text + "%'");
|
|
if (rizhids != null && rizhids.Tables[0].Rows.Count > 0)
|
|
{
|
|
foreach (DataRow r in rizhids.Tables[0].Rows)
|
|
{
|
|
rzjgst += "<tr><td style='width:200px'><span>" + r["zhanghao"] + "</span></td><td style='width:200px'><span>" + r["juese"] + "</span></td><td style='width:200px'><span>" + r["isqiyong"] + "</span></td><td>      <a href='UserAccount_Form.aspx?uid=" + r["id"] + "' id='chongzhi' class='button'>点击设置</a> </td></tr>";
|
|
}
|
|
}
|
|
else
|
|
{
|
|
rzjgst += "<tr><td colspan='4'><span>没有找到相关的操作日志</span></td></tr>";
|
|
}
|
|
rzjgst += "</table>";
|
|
div_main.InnerHtml = rzjgst;
|
|
}
|
|
} |