102 lines
3.4 KiB
C#
102 lines
3.4 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;
|
|
|
|
public partial class Mould_browse : System.Web.UI.Page
|
|
{
|
|
Maticsoft.BLL.nr_z_mjda mjdabll = new Maticsoft.BLL.nr_z_mjda();
|
|
Maticsoft.Model.nr_z_mjda mjdamodel = new Maticsoft.Model.nr_z_mjda();
|
|
Maticsoft.BLL.nr_sys_rizhi rizhibll = new Maticsoft.BLL.nr_sys_rizhi();
|
|
Maticsoft.Model.nr_sys_rizhi rizhimodel = new Maticsoft.Model.nr_sys_rizhi();
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!IsPostBack)
|
|
{
|
|
if (Session["user"] == null)
|
|
{
|
|
Response.Redirect("../index.aspx");
|
|
}
|
|
Maticsoft.Model.nr_z_yhzh user = (Maticsoft.Model.nr_z_yhzh)(Session["user"]);
|
|
if (Request.QueryString["uid"] != null && Request.QueryString["uid"].ToString().Length > 0)
|
|
{
|
|
string uid = Request.QueryString["uid"].ToString();
|
|
id.Value = uid;
|
|
}
|
|
initdata(id.Value);
|
|
pdquanxian(user.juese);
|
|
}
|
|
}
|
|
#region 修改时获取真正数据值
|
|
private void initdata(string did)
|
|
{
|
|
int idz = Convert.ToInt32(did);
|
|
mjdamodel = mjdabll.GetModel(idz);
|
|
if (mjdamodel != null)
|
|
{
|
|
bh.Text = mjdamodel.mjdm.ToString();
|
|
mingcheng.Text = mjdamodel.mjmc.ToString();
|
|
mjlx.Text = mjdamodel.mjzl.ToString();
|
|
pianshu.Text = mjdamodel.ps.ToString();
|
|
sycs.Text = mjdamodel.sycs.ToString();
|
|
chicun.Text = mjdamodel.mjcc.ToString();
|
|
zhongliang.Text = mjdamodel.zhongliang.ToString();
|
|
jjdw.Text = mjdamodel.jjdw.ToString();
|
|
riqi.Text = mjdamodel.riqi.ToString("yyyy-MM-dd");
|
|
beizhu.Text = mjdamodel.beizhu.ToString();
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
|
|
#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_mjda", "查看全部") == false)
|
|
{
|
|
Response.Redirect("../Common/nopower.htm");
|
|
}
|
|
|
|
if (DBHlper.GetPermission(juese, "模具档案", "nr_z_mjda", "编辑全部"))
|
|
{
|
|
bt_tj.Visible = true;
|
|
|
|
}
|
|
if (DBHlper.GetPermission(juese, "模具档案", "nr_z_mjda", "删除全部"))
|
|
{
|
|
bt_shanchu.Visible = true;
|
|
shanchu.Visible = true;
|
|
}
|
|
|
|
if (DBHlper.GetPermission(juese, "模具档案", "nr_z_mjda", "添加"))
|
|
{
|
|
bt_add.Visible = true;
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
//删除
|
|
protected void Shanchu_Click(object o, EventArgs e)
|
|
{
|
|
int qtskid = Convert.ToInt32(id.Value);
|
|
if (mjdabll.Delete(qtskid))
|
|
{
|
|
Maticsoft.Model.nr_z_yhzh user = (Maticsoft.Model.nr_z_yhzh)(Session["user"]);
|
|
rizhimodel.leixing = "模具档案";
|
|
rizhimodel.yonghuming = user.zhanghao;
|
|
rizhimodel.riqi = DateTime.Now;
|
|
rizhimodel.jilu = rizhimodel.yonghuming+"删除了模具档案;编号为:"+bh.Text;
|
|
rizhibll.Add(rizhimodel);
|
|
Response.Redirect("Mould_list.aspx");
|
|
}
|
|
}
|
|
} |