Esempio n. 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            ZWL.Common.PublicMethod.CheckSession();

            ZWL.BLL.ERPGongGao MyModel = new ZWL.BLL.ERPGongGao();
            MyModel.GetModel(int.Parse(Request.QueryString["ID"].ToString()));
            if (MyModel != null)
            {
                this.TextBox1.Text   = MyModel.TitleStr;
                this.TxtContent.Text = MyModel.ContentStr;
                ZWL.Common.PublicMethod.SetSessionValue("WenJianList", MyModel.FuJian);
                this.TextBox2.Text = MyModel.UserBuMen.ToString();
                this.txt_nt.Text   = MyModel.NoticeType;
            }

            ZWL.Common.PublicMethod.BindDDL(this.CheckBoxList1, ZWL.Common.PublicMethod.GetSessionValue("WenJianList"));



            //不是单位通知,那么不显示收阅部门信息
            if (Request.QueryString["Type"].ToString() != "单位")
            {
                this.Label1.Visible   = false;
                this.TextBox2.Visible = false;
                this.IMG1.Visible     = false;
            }
        }
    }
Esempio n. 2
0
    protected void btn_Sub_Click(object sender, EventArgs e)
    {
        ZWL.BLL.ERPGongGao MyModel = new ZWL.BLL.ERPGongGao();
        MyModel.GetModel(int.Parse(Request.QueryString["ID"].ToString()));
        if (MyModel.ZT == "已发送")
        {
            Response.Write("<script>alert('修改失败,已发送状态的公告无法进行修改')</script>");
            return;
        }
        ZWL.BLL.ERPGongGao Model = new ZWL.BLL.ERPGongGao();
        Model.TitleStr   = this.TextBox1.Text;
        Model.NoticeType = this.DropDownList1.SelectedValue;
        Model.ZT         = this.ZT.SelectedValue;
        Model.FuJian     = ZWL.Common.PublicMethod.GetSessionValue("WenJianList");
        Model.TypeStr    = this.TextBox3.Text;
        Model.ContentStr = this.TxtContent.Text;
        Model.ID         = int.Parse(Request.QueryString["ID"].ToString());
        Model.UserBuMen  = this.Send_Person.Value;
        Model.Update();


        //写系统日志
        ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi();
        MyRiZhi.UserName    = ZWL.Common.PublicMethod.GetSessionValue("UserName");
        MyRiZhi.DoSomething = "用户修改通知公告信息(" + this.TextBox1.Text + ")";
        MyRiZhi.IpStr       = System.Web.HttpContext.Current.Request.UserHostAddress.ToString();
        MyRiZhi.Add();

        Response.Write("<script>alert('通知公告信息修改成功!');window.location.href='GongGao.aspx'</script>");
    }
Esempio n. 3
0
    string UserName = ""; //用户名

    #endregion Fields

    #region Methods

    protected void btn_Sub_Click(object sender, EventArgs e)
    {
        ZWL.BLL.ERPGongGao MyModel = new ZWL.BLL.ERPGongGao();
        MyModel.GetModel(int.Parse(Request.QueryString["ID"].ToString()));
        if(MyModel.ZT == "已发送") {
            Response.Write("<script>alert('修改失败,已发送状态的公告无法进行修改')</script>");
            return;
        }
        ZWL.BLL.ERPGongGao Model = new ZWL.BLL.ERPGongGao();
        Model.TitleStr = this.TextBox1.Text;
        Model.NoticeType = this.DropDownList1.SelectedValue;
        Model.ZT = this.ZT.SelectedValue;
        Model.FuJian = ZWL.Common.PublicMethod.GetSessionValue("WenJianList");
        Model.TypeStr = this.TextBox3.Text;
        Model.ContentStr = this.TxtContent.Text;
        Model.ID = int.Parse(Request.QueryString["ID"].ToString());
        Model.UserBuMen = this.Send_Person.Value;
        Model.Update();

        //写系统日志
        ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi();
        MyRiZhi.UserName = ZWL.Common.PublicMethod.GetSessionValue("UserName");
        MyRiZhi.DoSomething = "用户修改通知公告信息(" + this.TextBox1.Text + ")";
        MyRiZhi.IpStr = System.Web.HttpContext.Current.Request.UserHostAddress.ToString();
        MyRiZhi.Add();

        Response.Write("<script>alert('通知公告信息修改成功!');window.location.href='GongGao.aspx'</script>");
    }
Esempio n. 4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            ZWL.Common.PublicMethod.CheckSession();

            ZWL.BLL.ERPGongGao MyModel = new ZWL.BLL.ERPGongGao();
            MyModel.GetModel(int.Parse(Request.QueryString["ID"].ToString()));
            this.Label1.Text = MyModel.TitleStr;
            this.Label2.Text = ZWL.Common.PublicMethod.GetWenJian(MyModel.FuJian, "../UploadFile/");
            this.Label4.Text = MyModel.ContentStr;
            this.Label5.Text = MyModel.TimeStr;
            this.Label3.Text = ZWL.DBUtility.DbHelperSQL.GetSHSL("select TrueName from ERPUser where UserName ='******'");
            string UserNames = "'" + MyModel.UserBuMen.Replace(",", "','") + "'";

            DataTable dt       = ZWL.DBUtility.DbHelperSQL.GetDataTable("select TrueName from ERPUser where UserName in (" + UserNames + ")");
            string    TrueName = "";
            foreach (DataRow R in dt.Rows)
            {
                TrueName += TrueName == "" ?  R["TrueName"].ToString() : "," + R["TrueName"].ToString();
            }
            this.Label6.Text = TrueName;

            this.Label7.Text = MyModel.Num.ToString();
            this.Label8.Text = MyModel.NoticeType.ToString();
            this.Label9.Text = MyModel.TypeStr.ToString();
            ZWL.DBUtility.DbHelperSQL.ExecuteSQL("update ERPGongGao set num= num+1 where ID=" + Request.QueryString["ID"].ToString());
            DataEntityDataContext context = new DataEntityDataContext();
            ERPGongGaoYD          model   = context.ERPGongGaoYD.SingleOrDefault(p => p.FID == int.Parse(Request.QueryString["ID"].ToString()) && p.XM == ZWL.Common.PublicMethod.GetSessionValue("UserName"));
            if (model != null)
            {
                model.SFYY = "是";
                model.YDSJ = DateTime.Now;
                context.SubmitChanges();
            }


            //var T = context.ERPGongGaoYD.Where(p => p.FID == int.Parse(Request.QueryString["ID"].ToString()));
            DataTable Gdt = ZWL.DBUtility.DbHelperSQL.GetDataTable("SELECT G.[ID],G.[FID],G.[SSBM] ,G.[XM] ,G.[SFYY] ,G.[YDSJ],G.[BZ1],G.[BZ2],U.[TrueName] " +
                                                                   "FROM [ERPGongGaoYD] as G left join [ERPUser] as U on G.XM=U.UserName " +
                                                                   "where G.[FID]='" + Request.QueryString["ID"].ToString() + "'");
            foreach (DataRow R in Gdt.Rows)
            {
                if (string.IsNullOrEmpty(R["TrueName"].ToString()))
                {
                    R["TrueName"] = R["XM"];
                }
            }
            this.GVData.DataSource = Gdt;
            GVData.DataBind();
            ReturnInput.Value = Request.UrlReferrer.ToString() == null ? "../GongGao/GongGao.aspx" : Request.UrlReferrer.ToString();
        }
    }
Esempio n. 5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            ZWL.Common.PublicMethod.CheckSession();

            ZWL.BLL.ERPGongGao MyModel = new ZWL.BLL.ERPGongGao();
            MyModel.GetModel(int.Parse(Request.QueryString["ID"].ToString()));
            this.Label1.Text = MyModel.TitleStr;
            this.Label2.Text = ZWL.Common.PublicMethod.GetWenJian(MyModel.FuJian, "../UploadFile/");
            this.Label4.Text = MyModel.ContentStr;
            this.Label5.Text = MyModel.TimeStr;
            this.Label3.Text = ZWL.DBUtility.DbHelperSQL.GetSHSL("select TrueName from ERPUser where UserName ='******'");
            string UserNames = "'"+MyModel.UserBuMen.Replace(",","','")+"'";

            DataTable dt = ZWL.DBUtility.DbHelperSQL.GetDataTable("select TrueName from ERPUser where UserName in (" + UserNames + ")");
            string TrueName = "";
            foreach(DataRow R in dt.Rows)
            {
                TrueName += TrueName == "" ?  R["TrueName"].ToString() : "," + R["TrueName"].ToString();
            }
            this.Label6.Text = TrueName;

            this.Label7.Text = MyModel.Num.ToString();
            this.Label8.Text = MyModel.NoticeType.ToString();
            this.Label9.Text = MyModel.TypeStr.ToString();
            ZWL.DBUtility.DbHelperSQL.ExecuteSQL("update ERPGongGao set num= num+1 where ID=" + Request.QueryString["ID"].ToString());
            DataEntityDataContext context = new DataEntityDataContext();
            ERPGongGaoYD model = context.ERPGongGaoYD.SingleOrDefault(p => p.FID == int.Parse(Request.QueryString["ID"].ToString()) && p.XM == ZWL.Common.PublicMethod.GetSessionValue("UserName"));
            if(model!=null)
            {
                model.SFYY = "是";
                model.YDSJ = DateTime.Now;
                context.SubmitChanges();
            }

            //var T = context.ERPGongGaoYD.Where(p => p.FID == int.Parse(Request.QueryString["ID"].ToString()));
            DataTable Gdt = ZWL.DBUtility.DbHelperSQL.GetDataTable("SELECT G.[ID],G.[FID],G.[SSBM] ,G.[XM] ,G.[SFYY] ,G.[YDSJ],G.[BZ1],G.[BZ2],U.[TrueName] "+
                                                                   "FROM [ERPGongGaoYD] as G left join [ERPUser] as U on G.XM=U.UserName "+
                                                                   "where G.[FID]='"+Request.QueryString["ID"].ToString()+"'");
            foreach(DataRow R in Gdt.Rows){
                if(string.IsNullOrEmpty(R["TrueName"].ToString())) {
                    R["TrueName"] = R["XM"];
                }
            }
            this.GVData.DataSource = Gdt;
            GVData.DataBind();
            ReturnInput.Value = Request.UrlReferrer.ToString() == null ? "../GongGao/GongGao.aspx" : Request.UrlReferrer.ToString();
        }
    }
Esempio n. 6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            ZWL.Common.PublicMethod.CheckSession();

            ZWL.BLL.ERPGongGao MyModel = new ZWL.BLL.ERPGongGao();
            MyModel.GetModel(int.Parse(Request.QueryString["ID"].ToString()));
            this.TextBox1.Text   = MyModel.TitleStr;
            this.TxtContent.Text = MyModel.ContentStr;
            ZWL.Common.PublicMethod.SetSessionValue("WenJianList", MyModel.FuJian);
            ZWL.Common.PublicMethod.BindDDL(this.CheckBoxList1, ZWL.Common.PublicMethod.GetSessionValue("WenJianList"));
        }
    }
Esempio n. 7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            ZWL.Common.PublicMethod.CheckSession();

            ZWL.BLL.ERPGongGao MyModel = new ZWL.BLL.ERPGongGao();
            MyModel.GetModel(int.Parse(Request.QueryString["ID"].ToString()));
            this.TextBox1.Text = MyModel.TitleStr;
            this.TxtContent.Text = MyModel.ContentStr;
            ZWL.Common.PublicMethod.SetSessionValue("WenJianList", MyModel.FuJian);
            ZWL.Common.PublicMethod.BindDDL(this.CheckBoxList1, ZWL.Common.PublicMethod.GetSessionValue("WenJianList"));
        }
    }
Esempio n. 8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            ZWL.Common.PublicMethod.CheckSession();

            ZWL.BLL.ERPGongGao MyModel = new ZWL.BLL.ERPGongGao();
            MyModel.GetModel(int.Parse(Request.QueryString["ID"].ToString()));
            this.Label1.Text = MyModel.TitleStr;
            this.Label2.Text = ZWL.Common.PublicMethod.GetWenJian(MyModel.FuJian, "../UploadFile/");
            this.Label4.Text = MyModel.ContentStr;
            this.Label5.Text = MyModel.TimeStr;
            this.Label3.Text = MyModel.UserName;
        }
    }
Esempio n. 9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            ZWL.Common.PublicMethod.CheckSession();

            ZWL.BLL.ERPGongGao MyModel = new ZWL.BLL.ERPGongGao();
            MyModel.GetModel(int.Parse(Request.QueryString["ID"].ToString()));
            this.Label1.Text = MyModel.TitleStr;
            this.Label2.Text = ZWL.Common.PublicMethod.GetWenJian(MyModel.FuJian, "../UploadFile/");
            this.Label4.Text = MyModel.ContentStr;
            this.Label5.Text = MyModel.TimeStr;
            this.Label3.Text = MyModel.UserName;
        }
    }
Esempio n. 10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            ZWL.Common.PublicMethod.CheckSession();

            ZWL.BLL.ERPGongGao MyModel = new ZWL.BLL.ERPGongGao();
            MyModel.GetModel(int.Parse(Request.QueryString["ID"].ToString()));
            this.Label1.Text = MyModel.TitleStr;
            this.Label2.Text = ZWL.Common.PublicMethod.GetWenJian(MyModel.FuJian, "../UploadFile/");
            this.Label4.Text = MyModel.ContentStr;
            this.Label5.Text = MyModel.TimeStr;
            this.Label3.Text = MyModel.UserName;
            this.Label6.Text = MyModel.UserBuMen.ToString();
            this.Label7.Text = MyModel.Num.ToString();

            ZWL.DBUtility.DbHelperSQL.ExecuteSQL("update ERPGongGao set num= num+1 where ID=" + Request.QueryString["ID"].ToString());

        }
    }
Esempio n. 11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            ZWL.Common.PublicMethod.CheckSession();

            ZWL.BLL.ERPGongGao MyModel = new ZWL.BLL.ERPGongGao();
            MyModel.GetModel(int.Parse(Request.QueryString["ID"].ToString()));
            this.Label1.Text = MyModel.TitleStr;
            this.Label2.Text = ZWL.Common.PublicMethod.GetWenJian(MyModel.FuJian, "../UploadFile/");
            this.Label4.Text = MyModel.ContentStr;
            this.Label5.Text = MyModel.TimeStr;
            this.Label3.Text = MyModel.UserName;
            this.Label6.Text = MyModel.UserBuMen.ToString();
            this.Label7.Text = MyModel.Num.ToString();


            ZWL.DBUtility.DbHelperSQL.ExecuteSQL("update ERPGongGao set num= num+1 where ID=" + Request.QueryString["ID"].ToString());
        }
    }
Esempio n. 12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            ZWL.Common.PublicMethod.CheckSession();

            ZWL.BLL.ERPGongGao MyModel = new ZWL.BLL.ERPGongGao();
            MyModel.GetModel(int.Parse(Request.QueryString["ID"].ToString()));
            this.TextBox1.Text   = MyModel.TitleStr;
            this.TxtContent.Text = MyModel.ContentStr;
            ZWL.Common.PublicMethod.SetSessionValue("WenJianList", MyModel.FuJian);
            ZWL.Common.PublicMethod.BindDDL(this.CheckBoxList1, ZWL.Common.PublicMethod.GetSessionValue("WenJianList"));
            DataEntityDataContext context = new DataEntityDataContext();
            var T = context.ERPCommon.Where(p => p.Code == "TZWJLX").OrderBy(p => p.CSort);

            foreach (var item in T)
            {
                this.DropDownList1.Items.Add(new ListItem(item.CName, item.CName));
            }
            Status = MyModel.ZT;
            this.ZT.SelectedValue = MyModel.ZT;
            Persons = MyModel.UserBuMen.ToString();
            this.Send_Person.Value  = Persons;
            this.TextBox3.Text      = MyModel.TypeStr;
            this.DropDownList1.Text = MyModel.NoticeType;
            ReturnInput.Value       = Request.UrlReferrer.ToString() == null ? "../GongGao/GongGao.aspx" : Request.UrlReferrer.ToString();

            #region  //树状图
            UserName = ZWL.Common.PublicMethod.GetSessionValue("UserName");
            string Condition = "";
            if (UserName != "")
            {
                Condition = " where [UserName]='" + UserName + "'";
            }
            string    Departments = "";
            DataTable Udt         = ZWL.DBUtility.DbHelperSQL.GetDataTable("select [Department] from [ERPUser] " + Condition);
            if (Udt.Rows.Count != 0)
            {
                Departments = Udt.Rows[0][0].ToString();
            }
            else
            {
                Departments = "";
            }
            Departments = "'" + Departments.Replace(",", "','") + "'";//拼装IDS,用于SQL语句
            //获取角色的部门
            DataTable BMdt = ZWL.DBUtility.DbHelperSQL.GetDataTable("select [ID],[DirID] from ERPBuMen where [BuMenName] in (" + Departments + ")");

            //foreach(DataRow BMR in BMdt.Rows) {
            //    QIDS += QIDS == "" ? BMR[0].ToString() : "," + BMR[0].ToString(); //获取用户拥有的权限
            //    DataTable Ddt = ZWL.DBUtility.DbHelperSQL.GetDataTable("select [ID] from ERPBuMen where [DirID] in (" + BMR[0].ToString() + ") or  [ID] in (" + BMR[0].ToString() + ") order by [DirID]");
            //    //判断是否有存在下级ID,若存在,则保存在IDS
            //    if(Ddt.Rows.Count > 0) { //若数量大于0.则存在上级菜单
            //        foreach(DataRow DR in Ddt.Rows) {
            //            IDS += IDS == "" ? DR[0].ToString() : "," + DR[0].ToString();
            //        }
            //    }
            //}
            string dirid = "0";
            dirid = ZWL.DBUtility.DbHelperSQL.GetSHSL("select top 1 DirID from ERPBuMen where ID='" + ZWL.Common.PublicMethod.GetSessionValue("DepartmentID") + "'");
            BindTree(this.ListTreeView.Nodes, Convert.ToInt32(dirid));
            this.ListTreeView.Attributes.Add("onclick", "CheckEvent(event)");

            #endregion
        }
    }
Esempio n. 13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            ZWL.Common.PublicMethod.CheckSession();

            ZWL.BLL.ERPGongGao MyModel = new ZWL.BLL.ERPGongGao();
            MyModel.GetModel(int.Parse(Request.QueryString["ID"].ToString()));
            this.TextBox1.Text = MyModel.TitleStr;
            this.TxtContent.Text = MyModel.ContentStr;
            ZWL.Common.PublicMethod.SetSessionValue("WenJianList", MyModel.FuJian);
            ZWL.Common.PublicMethod.BindDDL(this.CheckBoxList1, ZWL.Common.PublicMethod.GetSessionValue("WenJianList"));
            DataEntityDataContext context = new DataEntityDataContext();
            var T = context.ERPCommon.Where(p => p.Code == "TZWJLX").OrderBy(p => p.CSort);

            foreach (var item in T)
            {
                this.DropDownList1.Items.Add(new ListItem(item.CName, item.CName));
            }
            Status = MyModel.ZT;
            this.ZT.SelectedValue = MyModel.ZT;
            Persons = MyModel.UserBuMen.ToString();
            this.Send_Person.Value = Persons;
            this.TextBox3.Text = MyModel.TypeStr;
            this.DropDownList1.Text = MyModel.NoticeType;
            ReturnInput.Value = Request.UrlReferrer.ToString() == null ? "../GongGao/GongGao.aspx" : Request.UrlReferrer.ToString();

            #region  //树状图
            UserName = ZWL.Common.PublicMethod.GetSessionValue("UserName");
            string Condition = "";
            if(UserName != "") {
                Condition = " where [UserName]='" + UserName + "'";
            }
            string Departments = "";
            DataTable Udt = ZWL.DBUtility.DbHelperSQL.GetDataTable("select [Department] from [ERPUser] " + Condition);
            if(Udt.Rows.Count != 0) {
                Departments = Udt.Rows[0][0].ToString();
            }
            else {
                Departments = "";
            }
            Departments = "'" + Departments.Replace(",", "','") + "'";//拼装IDS,用于SQL语句
            //获取角色的部门
            DataTable BMdt = ZWL.DBUtility.DbHelperSQL.GetDataTable("select [ID],[DirID] from ERPBuMen where [BuMenName] in (" + Departments + ")");

            //foreach(DataRow BMR in BMdt.Rows) {
            //    QIDS += QIDS == "" ? BMR[0].ToString() : "," + BMR[0].ToString(); //获取用户拥有的权限
            //    DataTable Ddt = ZWL.DBUtility.DbHelperSQL.GetDataTable("select [ID] from ERPBuMen where [DirID] in (" + BMR[0].ToString() + ") or  [ID] in (" + BMR[0].ToString() + ") order by [DirID]");
            //    //判断是否有存在下级ID,若存在,则保存在IDS
            //    if(Ddt.Rows.Count > 0) { //若数量大于0.则存在上级菜单
            //        foreach(DataRow DR in Ddt.Rows) {
            //            IDS += IDS == "" ? DR[0].ToString() : "," + DR[0].ToString();
            //        }
            //    }
            //}
            string dirid = "0";
            dirid = ZWL.DBUtility.DbHelperSQL.GetSHSL("select top 1 DirID from ERPBuMen where ID='" + ZWL.Common.PublicMethod.GetSessionValue("DepartmentID") + "'");
            BindTree(this.ListTreeView.Nodes, Convert.ToInt32(dirid));
            this.ListTreeView.Attributes.Add("onclick", "CheckEvent(event)");

            #endregion
        }
    }