163 lines
6.2 KiB
C#
163 lines
6.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;
|
|
|
|
public partial class OtherExpenses_browse : System.Web.UI.Page
|
|
{
|
|
Maticsoft.BLL.nr_z_qtzc qtsrbll = new Maticsoft.BLL.nr_z_qtzc();
|
|
Maticsoft.Model.nr_z_qtzc qtsrmodel = new Maticsoft.Model.nr_z_qtzc();
|
|
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)
|
|
{
|
|
DataTable dt = DBHlper.Execute("select * from view_nr_z_qtzc where id=" + did).Tables[0];
|
|
bh.Text = dt.Rows[0]["bh"].ToString();
|
|
riqi.Text = DateTime.Parse(dt.Rows[0]["riqi"].ToString()).ToString("yyyy-MM-dd");
|
|
zczhonglei.Text = dt.Rows[0]["zczl"].ToString();
|
|
jine.Text = dt.Rows[0]["je"].ToString();
|
|
jsr.Text = dt.Rows[0]["jsr"].ToString();
|
|
sx.Text = dt.Rows[0]["sx"].ToString();
|
|
beizhu.Text = dt.Rows[0]["bz"].ToString();
|
|
shzt.Text = dt.Rows[0]["zt"].ToString();
|
|
ddbh.Text = dt.Rows[0]["ddbh"].ToString();
|
|
if (shzt.Text == "通过")
|
|
{
|
|
btn_tongguo.Enabled = false;
|
|
btn_tongguo.BackColor = System.Drawing.Color.Gray;
|
|
shanchu.Enabled = false;
|
|
shanchu.BackColor = System.Drawing.Color.Gray;
|
|
btn_bj.Enabled = false;
|
|
btn_bj.BackColor = System.Drawing.Color.Gray;
|
|
}
|
|
if (shzt.Text == "不过")
|
|
{
|
|
btn_butongguo.Enabled = false;
|
|
btn_butongguo.BackColor = System.Drawing.Color.Gray;
|
|
shanchu.Enabled = false;
|
|
shanchu.BackColor = System.Drawing.Color.Gray;
|
|
}
|
|
Maticsoft.Model.nr_z_yhzh user = (Maticsoft.Model.nr_z_yhzh)(Session["user"]);
|
|
rizhimodel.leixing = "其它支出";
|
|
rizhimodel.yonghuming = user.zhanghao;
|
|
}
|
|
#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_qtzc", "查看全部") == false && DBHlper.GetPermission(juese, "其它支出", "nr_z_qtzc", "查看个人") == false)
|
|
{
|
|
Response.Redirect("../Common/nopower.htm");
|
|
}
|
|
|
|
if (DBHlper.GetPermission(juese, "其它支出", "nr_z_qtzc", "编辑个人") && jsr.Text == user.zhanghao)
|
|
{
|
|
btn_bj.Visible = true;
|
|
|
|
}
|
|
if (DBHlper.GetPermission(juese, "其它支出", "nr_z_qtzc", "编辑全部"))
|
|
{
|
|
btn_bj.Visible = true;
|
|
|
|
}
|
|
if (DBHlper.GetPermission(juese, "其它支出", "nr_z_qtzc", "删除个人") && jsr.Text == user.zhanghao)
|
|
{
|
|
shanchu.Visible = true;
|
|
}
|
|
if (DBHlper.GetPermission(juese, "其它支出", "nr_z_qtzc", "删除全部"))
|
|
{
|
|
shanchu.Visible = true;
|
|
}
|
|
if (DBHlper.GetPermission(juese, "其它支出", "nr_z_qtzc", "审核"))
|
|
{
|
|
btn_tongguo.Visible = true;
|
|
btn_butongguo.Visible = true;
|
|
}
|
|
if (DBHlper.GetPermission(juese, "其它支出", "nr_z_qtzc", "添加"))
|
|
{
|
|
btn_add.Visible = true;
|
|
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
//删除
|
|
protected void btn_delete(object o, EventArgs e)
|
|
{
|
|
int qtskid = Convert.ToInt32(id.Value);
|
|
if (qtsrbll.Delete(qtskid))
|
|
{
|
|
Maticsoft.Model.nr_z_yhzh user = (Maticsoft.Model.nr_z_yhzh)(Session["user"]);
|
|
rizhimodel.leixing = "其它支出";
|
|
rizhimodel.yonghuming = user.zhanghao;
|
|
rizhimodel.leixing = "其它支出";
|
|
rizhimodel.yonghuming = user.zhanghao;
|
|
rizhimodel.riqi = DateTime.Now;
|
|
rizhimodel.jilu = rizhimodel.yonghuming + "删除了其它;支出编号为:" + bh.Text;
|
|
rizhibll.Add(rizhimodel);
|
|
Response.Redirect("OtherExpenses_list.aspx");
|
|
}
|
|
}
|
|
//审核通过
|
|
protected void btntongguo_Click(object sender, EventArgs e)
|
|
{
|
|
Maticsoft.Model.nr_z_yhzh user = (Maticsoft.Model.nr_z_yhzh)(Session["user"]);
|
|
rizhimodel.leixing = "其它支出";
|
|
rizhimodel.yonghuming = user.zhanghao;
|
|
DBHlper.excutecmd("update nr_z_qtzc set zt='通过' where id=" + id.Value);
|
|
rizhimodel.riqi = DateTime.Now;
|
|
rizhimodel.jilu = rizhimodel.yonghuming + "审核通过了其它支出;编号为:" + bh.Text;
|
|
rizhibll.Add(rizhimodel);
|
|
Response.Redirect("OtherExpenses_browse.aspx?uid=" + id.Value);
|
|
}
|
|
//审核不通过
|
|
protected void btn_butong_Click(object sender, EventArgs e)
|
|
{
|
|
Maticsoft.Model.nr_z_yhzh user = (Maticsoft.Model.nr_z_yhzh)(Session["user"]);
|
|
rizhimodel.leixing = "其它支出";
|
|
rizhimodel.yonghuming = user.zhanghao;
|
|
DBHlper.excutecmd("update nr_z_qtzc set zt='不过' where id=" + id.Value);
|
|
rizhimodel.riqi = DateTime.Now;
|
|
rizhimodel.jilu = rizhimodel.yonghuming + "审核不过了其它支出;编号为:" + bh.Text;
|
|
rizhibll.Add(rizhimodel);
|
|
Response.Redirect("OtherExpenses_browse.aspx?uid=" + id.Value);
|
|
}
|
|
protected void bt_tj_Click(object sender, EventArgs e)
|
|
{
|
|
Response.Redirect("OtherExpenses_Form.aspx?uid=" + id.Value);
|
|
}
|
|
protected void btn_add_Click(object sender, EventArgs e)
|
|
{
|
|
Response.Redirect("OtherExpenses_Form.aspx");
|
|
}
|
|
} |