CeramicProject/newyt/Module_data/OtherIncome_browse.aspx.cs

160 lines
6.0 KiB
C#
Raw Normal View History

2024-05-18 15:28:29 +08:00
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 OtherIncome_browse : System.Web.UI.Page
{
Maticsoft.BLL.nr_z_qtsr qtsrbll = new Maticsoft.BLL.nr_z_qtsr();
Maticsoft.Model.nr_z_qtsr qtsrmodel = new Maticsoft.Model.nr_z_qtsr();
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_qtsr 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");
srzhonglei.Text = dt.Rows[0]["srzl"].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();
khbh.Text = dt.Rows[0]["khbh"].ToString();
khmc.Text = dt.Rows[0]["khmc"].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;
}
}
#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");
}
2024-05-21 15:05:24 +08:00
if (DBHlper.GetPermission(juese, "其它收入", "nr_z_qtsr", "查看全部") == false && DBHlper.GetPermission(juese, "其它收入", "nr_z_qtsr", "查看个人") == false)
2024-05-18 15:28:29 +08:00
{
Response.Redirect("../Common/nopower.htm");
}
2024-05-21 15:05:24 +08:00
if (DBHlper.GetPermission(juese, "其它收入", "nr_z_qtsr", "编辑个人") && jsr.Text == user.zhanghao)
2024-05-18 15:28:29 +08:00
{
btn_bj.Visible = true;
}
2024-05-21 15:05:24 +08:00
if (DBHlper.GetPermission(juese, "其它收入", "nr_z_qtsr", "编辑全部"))
2024-05-18 15:28:29 +08:00
{
btn_bj.Visible = true;
}
2024-05-21 15:05:24 +08:00
if (DBHlper.GetPermission(juese, "其它收入", "nr_z_qtsr", "删除个人") && jsr.Text == user.zhanghao)
2024-05-18 15:28:29 +08:00
{
shanchu.Visible = true;
}
2024-05-21 15:05:24 +08:00
if (DBHlper.GetPermission(juese, "其它收入", "nr_z_qtsr", "删除全部"))
2024-05-18 15:28:29 +08:00
{
shanchu.Visible = true;
}
2024-05-21 15:05:24 +08:00
if (DBHlper.GetPermission(juese, "其它收入", "nr_z_qtsr", "审核"))
2024-05-18 15:28:29 +08:00
{
btn_tongguo.Visible = true;
btn_butongguo.Visible = true;
}
2024-05-21 15:05:24 +08:00
if (DBHlper.GetPermission(juese, "其它收入", "nr_z_qtsr", "添加"))
2024-05-18 15:28:29 +08:00
{
bt_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.riqi = DateTime.Now;
rizhimodel.jilu = rizhimodel.yonghuming+"删除了其它收入;编号为:"+bh.Text;
rizhibll.Add(rizhimodel);
Response.Redirect("OtherIncome_list.aspx");
}
}
//审核通过
protected void btntongguo_Click(object sender, EventArgs e)
{
DBHlper.excutecmd("update nr_z_qtsr set zt='通过' where id=" + id.Value);
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("OtherIncome_browse.aspx?uid=" + id.Value);
}
//审核不通过
protected void btn_butong_Click(object sender, EventArgs e)
{
DBHlper.excutecmd("update nr_z_qtsr set zt='不过' where id=" + id.Value);
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("OtherIncome_browse.aspx?uid=" + id.Value);
}
protected void bt_tj_Click(object sender, EventArgs e)
{
Response.Redirect("OtherIncome_Form.aspx?uid=" + id.Value);
}
protected void bt_add_Click(object sender, EventArgs e)
{
Response.Redirect("OtherIncome_Form.aspx");
}
}