Esempio n. 1
0
        /// <summary>
        /// 载入数据
        /// </summary>
        private void LoadData()
        {
            string     strIsAll     = "0";
            EntityData entityNotice = RemindDAO.GetNoticeByCode(strNoticeCode);

            if (entityNotice.HasRecord())
            {
                if (entityNotice.GetInt("status").ToString() != "0")
                {
                    if (entityNotice.GetInt("Type") == 99)
                    {
                        trNotice.Visible = false;
                    }
                    this.lblNoticeClass.Text  = Server.HtmlEncode(entityNotice.GetString("NoticeClass"));//新加通知类型(测试正确删除此注释)
                    this.lblTitle.Text        = Server.HtmlEncode(entityNotice.GetString("Title"));
                    this.lbSubmitname.Text    = RmsPM.BLL.SystemRule.GetUserName(entityNotice.GetString("SubmitPerson").ToString()).ToString();
                    this.lblSubmitDate.Text   = entityNotice.GetDateTimeOnlyDate("SubmitDate");
                    this.divContent.InnerHtml = entityNotice.GetString("Content").Replace("\n", "<br>").Replace("\r", "&nbsp;");
                    strIsAll = entityNotice.GetString("IsAll");
                    //待修改
                    this.lbLastUpdate.Text = RmsPM.BLL.SystemRule.GetUserName(entityNotice.GetString("UserCode").ToString()).ToString() + " 于 " + entityNotice.GetDateTimeOnlyDate("UpdateDate") + "修改";
                }
                else
                {
                    Response.Write(JavaScript.ScriptStart);
                    Response.Write("window.alert('通知已删除');");
                    Response.Write("window.close();");
                    Response.Write(JavaScript.ScriptEnd);
                }
            }
            if (strIsAll == "0")
            {
                string strUsers        = "";
                string strUserNames    = "";
                string strStations     = "";
                string strStationNames = "";
                BLL.ResourceRule.GetAccessRange(this.strNoticeCode, "0801", "080104", ref strUsers, ref strUserNames, ref strStations, ref strStationNames);
                this.lblUser.Text = strUserNames + "," + strStationNames;
                this.lblUser.Text = BLL.StringRule.CutRepeat(this.lblUser.Text);
            }
            else
            {
                this.lblUser.Text = "全体人员";
            }

            //记录该用户已经读了该信息
            User       u         = (User)Session["User"];
            string     strSelect = "select * from UserLookedNotice where noticecode='" + strNoticeCode + "' and usercode='" + u.UserCode + "'";
            string     strInsert = "insert into UserLookedNotice (noticecode,usercode) values ('" + strNoticeCode + "','" + u.UserCode + "')";
            string     strDelete = "Delete from UserLookedNotice where  noticecode='" + strNoticeCode + "' and usercode='" + u.UserCode + "'";
            QueryAgent qa        = new QueryAgent();
            DataSet    ds        = qa.ExecSqlForDataSet(strSelect);

            if (ds.Tables[0].Rows.Count <= 0)
            {
                qa.ExecuteSql(strInsert);
            }
            qa.Dispose();
            entityNotice.Dispose();
        }
Esempio n. 2
0
    public void LoadDate()
    {
        string     strIsAll     = "0";
        int        strType      = 0;
        EntityData entityNotice = RemindDAO.GetNoticeByCode(strNoticeCode);

        if (entityNotice.HasRecord())
        {
            if (entityNotice.GetInt("status").ToString() != "0")
            {
                strType = entityNotice.GetInt("Type");
                if (strType == 99)
                {
                    this.trNotice.Visible = false;
                }
                this.DDLNoticeClass.Value = Server.HtmlEncode(entityNotice.GetString("NoticeClass"));
                this.txtTitle.Value       = Server.HtmlEncode(entityNotice.GetString("Title"));
                this.lbSubmitname.Text    = RmsPM.BLL.SystemRule.GetUserName(entityNotice.GetString("SubmitPerson").ToString()).ToString();
                this.lblSubmitDate.Text   = entityNotice.GetDateTimeOnlyDate("SubmitDate");
                this.taContent.Value      = StringRule.FormartOutput(entityNotice.GetString("Content"));
                strIsAll = entityNotice.GetString("IsAll");
                this.lbLastUpdate.Text = RmsPM.BLL.SystemRule.GetUserName(entityNotice.GetString("UserCode").ToString()).ToString() + " 于 " + entityNotice.GetDateTimeOnlyDate("UpdateDate") + "修改";
            }
            else
            {
                Response.Write(JavaScript.ScriptStart);
                Response.Write("window.alert('通知已删除');");
                Response.Write("window.close();");
                Response.Write(JavaScript.ScriptEnd);
            }
        }
        if (strIsAll == "0") //部分人员
        {
            string strUsers        = "";
            string strUserNames    = "";
            string strStations     = "";
            string strStationNames = "";
            RmsPM.BLL.ResourceRule.GetAccessRange(this.strNoticeCode, "0801", "080104", ref strUsers, ref strUserNames, ref strStations, ref strStationNames);
            this.txtUsers.Value        = RmsPM.BLL.StringRule.CutRepeat(strUsers);
            this.SelectName.InnerText  = RmsPM.BLL.StringRule.CutRepeat(strUserNames);
            this.txtStations.Value     = RmsPM.BLL.StringRule.CutRepeat(strStations);
            this.SelectName.InnerText += "," + RmsPM.BLL.StringRule.CutRepeat(strStationNames);
        }
        else
        {
            this.txtUsers.Value       = this.GetAllUser();
            this.SelectName.InnerText = "全体人员";
        }

        entityNotice.Dispose();


        // this.lblTitle.Text = "修改通知";
        //EntityData entityNotice = RemindDAO.GetNoticeByCode(this.strNoticeCode);
        //this.txtTitle.Value = System.Web.HttpUtility.HtmlEncode(entityNotice.GetString("Title"));
        //this.taContent.Value = StringRule.FormartOutput(entityNotice.GetString("Content"));
        //this.LoadUser(entityNotice.GetString("IsAll"));
    }
Esempio n. 3
0
        public static string GetNoticeName(string Code)
        {
            EntityData noticeByCode = RemindDAO.GetNoticeByCode(Code);

            if (!noticeByCode.HasRecord())
            {
                return("");
            }
            return(noticeByCode.GetString("Title"));
        }
Esempio n. 4
0
        protected void btDelete_ServerClick(object sender, System.EventArgs e)
        {
            //删除通知
            EntityData entityNotice = RemindDAO.GetNoticeByCode(this.strNoticeCode);
            DataRow    dr;

            if (entityNotice.HasRecord())
            {
                dr = entityNotice.CurrentRow;
                // dr["NoticeCode"] = this.strNoticeCode;
                //dr["Title"] = this.lblTitle.Text.Trim();
                //dr["EnableDate"] = this.dtbShowDate.Value;
                //dr["SubmitPerson"] = base.user.UserCode;
                // dr["SubmitDate"] = DateTime.Now.ToShortDateString();
                //dr["Content"] = this.lblContent.Text;

                // 保存资源,保存权限
                //string strUser = this.lblUser.Text.Trim();
                //string strStation = this.lb.Value.Trim();
                // 没有选择人员则向全体发布
                //if (strUser.Trim() == "全体人员")
                //{
                //    //strUser = this.GetAllUser();
                //    dr["IsAll"] = "1";
                //}
                //else
                //{
                //    dr["IsAll"] = "0";
                //}
                dr["status"] = "0";
                //ArrayList arOperator = new ArrayList();
                //this.SaveRS(arOperator, RmsPM.BLL.StringRule.CutRepeat(strUser), RmsPM.BLL.StringRule.CutRepeat(strStation), "080104"); // 一般通知查看权限
                //this.SaveRS(arOperator, base.user.UserCode, "", "080102,080103,080104"); // 修改和删除
                //if (arOperator.Count > 0)
                //    RmsPM.BLL.ResourceRule.SetResourceAccessRange(this.strNoticeCode, "0801", "", arOperator, false);
            }

            RemindDAO.UpdateNotice(entityNotice);
            entityNotice.Dispose();
            Response.Write(JavaScript.ScriptStart);
            Response.Write("window.opener.refresh();");
            Response.Write("window.close();");
            Response.Write(JavaScript.ScriptEnd);
        }
Esempio n. 5
0
        private void LoadData()
        {
            //对通知标题的个性化判断
            if (this.up_sPMNameLower != "tianyangoa")
            {
                this.trNotice.Visible = false;
            }
            else
            {
                if (Request["DocType"].ToString() == "99")
                {
                    this.trNotice.Visible = false;
                }
                else
                {
                    this.trNotice.Visible = true;
                }
                PageFacade.LoadDictionarySelect(this.DDLNoticeClass, "通知类型", "");//通知类别改成通知类型
            }

            switch (strAction.ToUpper())
            {
            case "INSERT":
                this.lblTitle.Text = "新增公告";
                this.htType.Value  = Request["DocType"].ToString();
                break;

            case "MODIFY":
                //标题
                this.lblTitle.Text = "修改公告";
                EntityData entityNotice = RemindDAO.GetNoticeByCode(this.strNoticeCode);
                this.DDLNoticeClass.Value = System.Web.HttpUtility.HtmlEncode(entityNotice.GetString("NoticeClass"));    //测试新增代码
                this.txtTitle.Value       = System.Web.HttpUtility.HtmlEncode(entityNotice.GetString("Title"));
                this.taContent.Value      = StringRule.FormartOutput(entityNotice.GetString("Content"));
                //this.htType.Value = entityNotice.GetString("Type");
                this.LoadUser(entityNotice.GetString("IsAll"));
                break;
            }
        }
Esempio n. 6
0
        public static string GetFieldName(string Code, string FieldName)
        {
            string text2;

            try
            {
                string text = "";
                if (Code == "")
                {
                    return(text);
                }
                EntityData noticeByCode = RemindDAO.GetNoticeByCode(Code);
                if (noticeByCode.HasRecord() && noticeByCode.CurrentTable.Columns.Contains(FieldName))
                {
                    if (noticeByCode.CurrentTable.Columns[FieldName].DataType == Type.GetType("System.Int32"))
                    {
                        return(noticeByCode.GetIntString(FieldName));
                    }
                    if (noticeByCode.CurrentTable.Columns[FieldName].DataType == Type.GetType("System.Decimal"))
                    {
                        return(noticeByCode.GetDecimalString(FieldName));
                    }
                    if (noticeByCode.CurrentTable.Columns[FieldName].DataType == Type.GetType("System.DateTime"))
                    {
                        return(noticeByCode.GetDateTimeOnlyDate(FieldName));
                    }
                    if (noticeByCode.CurrentTable.Columns[FieldName].DataType == Type.GetType("System.String"))
                    {
                        return(noticeByCode.GetString(FieldName));
                    }
                }
                text2 = text;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(text2);
        }
Esempio n. 7
0
        private void InitPage()
        {
            strNoticeCode = Request.QueryString["Code"] + "";
            string strAction = Request.QueryString["Action"] + "";
            User   myUser    = new User(user.UserCode);

            //if(!myUser.HasResourceRight(this.strNoticeCode,"080102"))
            //Server.Transfer("../Remind/NoticeInfo.aspx?&Code="+this.strNoticeCode);

            //this.btDelete.Visible = myUser.HasOperationRight("080103");// 080103为通知删除权限
            try
            {
                //QueryAgent qa = new QueryAgent();
                //DAL.QueryStrategy.RoleOperation sb = new RmsPM.DAL.QueryStrategy.RoleOperation();
                //sb.AddStrategy(new Strategy(RoleOperationName.UserCode, user.UserCode));
                ////sb.AddStrategy(new Strategy( RoleOperationName.UserCode,"080102"));
                //string sql = sb.BuildMainQueryString();
                //DataSet Ds = qa.ExecSqlForDataSet(sql);
                //string str_Edit = "";
                //string str_Delete = "";
                //for (int i = 0; i < Ds.Tables[0].Rows.Count; i++)
                //{
                //    if (Ds.Tables[0].Rows[i][1].ToString() == "080102")
                //    {
                //        str_Edit = Ds.Tables[0].Rows[i][1].ToString();
                //    }
                //    if (Ds.Tables[0].Rows[i][1].ToString() == "080103")
                //    {
                //        str_Delete = Ds.Tables[0].Rows[i][1].ToString();
                //    }

                //}

                ////判断是否拥有修改权限
                //if (str_Edit == "" && !myUser.HasResourceRight(this.strNoticeCode, "080102"))
                //{
                //    this.SaveToolsButton.Visible = false;
                //}
                //else
                //{
                //    this.SaveToolsButton.Visible = true;
                //}

                //if (str_Delete == "" && !myUser.HasResourceRight(this.strNoticeCode, "080103"))
                //{

                //    this.btDelete.Visible = false;
                //}
                //else
                //{
                //    this.btDelete.Visible = true;
                //}



                //发件人、修改、删除、监控
                bool       isSender       = false;
                bool       canModify      = false;
                bool       canDelete      = false;
                bool       isMonitor      = false;
                EntityData entityNotice   = RemindDAO.GetNoticeByCode(strNoticeCode);
                string     l_submitPerson = entityNotice.GetString("SubmitPerson").ToString();
                if (l_submitPerson == user.UserCode)
                {
                    isSender = true;
                }
                if (user.HasRight("080102"))
                {
                    canModify = true;
                }
                if (user.HasRight("080103"))
                {
                    canDelete = true;
                }
                if (user.HasRight("080105"))
                {
                    isMonitor = true;
                }
                if (isSender && canModify)
                {
                    this.SaveToolsButton.Visible = true;
                }
                else
                {
                    this.SaveToolsButton.Visible = false;
                }
                if (isMonitor || (isSender && canDelete))
                {
                    this.btDelete.Visible = true;
                }
                else
                {
                    this.btDelete.Visible = false;
                }
            }
            catch (Exception dd)
            {
                string h = dd.Message.ToString();
                string f = h;
            }
            // 载入附件
            this.myAttachMentList.AttachMentType = "NoticeAttachMent";
            this.myAttachMentList.MasterCode     = strNoticeCode;

            FeedBack1.FeedBackType = "Notice";
            FeedBack1.MasterCode   = this.strNoticeCode;
        }
Esempio n. 8
0
    protected void btDelete_ServerClick(object sender, EventArgs e)
    {
        //删除通知 改变通知状态

        EntityData entityNotice = RemindDAO.GetNoticeByCode(this.strNoticeCode);
        DataRow    dr;

        if (entityNotice.HasRecord())
        {
            dr = entityNotice.CurrentRow;
            //dr["NoticeCode"] = this.strNoticeCode;
            //dr["Title"] = this.txtTitle.Value.Trim();
            ////dr["EnableDate"] = this.dtbShowDate.Value;
            //dr["SubmitPerson"] = base.user.UserCode;
            //dr["SubmitDate"] = DateTime.Now.ToShortDateString();
            //dr["Content"] = this.taContent.Value;

            //// 保存资源,保存权限
            //string strUser = this.txtUsers.Value.Trim();
            //string strStation = this.txtStations.Value.Trim();
            //// 没有选择人员则向全体发布
            //if (strUser.Length < 1 && strStation.Length < 1)
            //{
            //    //strUser = this.GetAllUser();
            //    dr["IsAll"] = "1";
            //}
            //else
            //{
            //    dr["IsAll"] = "0";
            //}
            dr["status"] = "0";
            ArrayList arOperator = new ArrayList();
            //this.SaveRS(arOperator, RmsPM.BLL.StringRule.CutRepeat(strUser), RmsPM.BLL.StringRule.CutRepeat(strStation), "080104"); // 一般通知查看权限
            //this.SaveRS(arOperator, base.user.UserCode, "", "080102,080103,080104"); // 修改和删除

            //if (arOperator.Count > 0)
            //    RmsPM.BLL.ResourceRule.SetResourceAccessRange(this.strNoticeCode, "0801", "", arOperator, false);
        }

        RemindDAO.UpdateNotice(entityNotice);
        entityNotice.Dispose();
        Response.Write(JavaScript.ScriptStart);
        Response.Write("window.opener.refresh();");
        Response.Write("window.close();");
        Response.Write(JavaScript.ScriptEnd);
        //try
        //{
        //    // 删除附件
        //    this.myAttachMentAdd.DelAttachMentByMasterCode(this.strNoticeCode);
        //    // 删除分发范围
        //    EntityData entityUser = RemindDAO.GetNoticeUserByNoticeCode(this.strNoticeCode);
        //    if (entityUser.HasRecord())
        //    {
        //        RemindDAO.DeleteNoticeUser(entityUser);
        //    }
        //    entityUser.Dispose();

        //    // 是否添加入删除资源和权限的操作


        //    EntityData entityNotice = RemindDAO.GetNoticeByCode(strNoticeCode);
        //    RemindDAO.DeleteNotice(entityNotice);

        //    Response.Write(JavaScript.ScriptStart);
        //    Response.Write("window.opener.refresh();");
        //    Response.Write("window.close();");
        //    Response.Write(JavaScript.ScriptEnd);
        //}
        //catch (Exception ex)
        //{
        //    ApplicationLog.WriteLog(this.ToString(), ex, "删除失败");
        //}
    }
Esempio n. 9
0
    //更新数据
    private bool UpdataData()
    {
        //保存通知
        EntityData entityNotice = RemindDAO.GetNoticeByCode(this.strNoticeCode);
        DataRow    dr;

        if (entityNotice.HasRecord())
        {
            dr = entityNotice.CurrentRow;

            if (this.txtTitle.Value.Trim() == "")
            {
                return(false);
            }
            if (this.taContent.Value.Trim() == string.Empty)
            {
                return(false);
            }
            dr["NoticeCode"] = this.strNoticeCode;
            //新加通知类型(测试正确后删除此注释)
            if (this.up_sPMNameLower == "tianyangoa")
            {
                dr["NoticeClass"] = this.DDLNoticeClass.Value.Trim();
                dr["Title"]       = this.txtTitle.Value.Trim();

                if (entityNotice.GetInt("Type") != 99)
                {
                    if (this.DDLNoticeClass.Value.Trim() == "")
                    {
                        return(false);
                    }
                }
            }
            dr["Title"]      = this.txtTitle.Value.Trim();
            dr["UpdateDate"] = DateTime.Now;
            dr["UserCode"]   = this.user.UserCode;
            //dr["EnableDate"] = this.dtbShowDate.Value;
//            dr["SubmitPerson"] = base.user.UserCode;
//            dr["SubmitDate"] = DateTime.Now.ToShortDateString();
            dr["Content"] = this.taContent.Value.ToString();



            // 保存资源,保存权限
            string strUser    = this.txtUsers.Value.Trim();
            string strStation = this.txtStations.Value.Trim();
            // 没有选择人员则向全体发布
            if (strUser.Length < 1 && strStation.Length < 1)
            {
                strUser     = this.GetAllUser();
                dr["IsAll"] = "1";
            }
            else
            {
                dr["IsAll"] = "0";
            }
            dr["status"] = "1";
            ArrayList arOperator = new ArrayList();
            this.SaveRS(arOperator, RmsPM.BLL.StringRule.CutRepeat(strUser), RmsPM.BLL.StringRule.CutRepeat(strStation), "080104"); // 一般通知查看权限
            this.SaveRS(arOperator, base.user.UserCode, "", "080102,080103,080104");                                                // 修改和删除

            if (arOperator.Count > 0)
            {
                RmsPM.BLL.ResourceRule.SetResourceAccessRange(this.strNoticeCode, "0801", "", arOperator, false);
            }
        }

        RemindDAO.UpdateNotice(entityNotice);
        entityNotice.Dispose();

        // 保存附件
        this.myAttachMentAdd.SaveAttachMent(this.strNoticeCode);


        //修改保存后这条信息又成为新信息,就是没有读过的信息

        User       u         = (User)Session["User"];
        string     strDelete = "Delete from UserLookedNotice where  noticecode='" + this.strNoticeCode + "' and usercode='" + u.UserCode + "'";
        QueryAgent qa        = new QueryAgent();

        qa.ExecuteSql(strDelete);
        qa.Dispose();
        return(true);
    }
Esempio n. 10
0
        //更新数据
        private bool UpdataData()
        {
            //保存通知
            EntityData entityNotice = RemindDAO.GetNoticeByCode(this.strNoticeCode);
            DataRow    dr;

            if (entityNotice.HasRecord())
            {
                dr = entityNotice.CurrentRow;
                dr["NoticeCode"]  = this.strNoticeCode;
                dr["NoticeClass"] = this.DDLNoticeClass.Value.Trim();//新加通知类型(测试正确后删除此注释)
                dr["Title"]       = this.txtTitle.Value.Trim();
                //dr["EnableDate"] = this.dtbShowDate.Value;
                dr["SubmitPerson"] = base.user.UserCode;
                dr["SubmitDate"]   = DateTime.Now.ToShortDateString();
                dr["Content"]      = this.taContent.Value;

                // 保存资源,保存权限
                string strUser    = this.txtUsers.Value.Trim();
                string strStation = this.txtStations.Value.Trim();
                // 没有选择人员则向全体发布
                if (strUser.Length < 1 && strStation.Length < 1)
                {
                    strUser     = this.GetAllUser();
                    dr["IsAll"] = "1";
                }
                else
                {
                    dr["IsAll"] = "0";
                }
                ArrayList arOperator = new ArrayList();
                this.SaveRS(arOperator, BLL.StringRule.CutRepeat(strUser), BLL.StringRule.CutRepeat(strStation), "080104"); // 一般通知查看权限
                this.SaveRS(arOperator, base.user.UserCode, "", "080102,080103,080104");                                    // 修改和删除
                if (arOperator.Count > 0)
                {
                    BLL.ResourceRule.SetResourceAccessRange(this.strNoticeCode, "0801", "", arOperator, false);
                }
            }

//			// 待保存新选择的用户范围//如果未选择通知用户,面向全体用户发布
//			string strUser = this.txtUsers.Value;
//			if(strUser.Length>0)
//				this.SaveUser(strUser);
//			// 保存分发岗位
//			string strDept = this.txtDepts.Value;
//			if(strDept.Length>0)
//				this.SaveDept(strDept);
//			// 保存资源,保存权限
//			string strUser = this.txtUsers.Value.Trim();
//			string strStation = this.txtStations.Value.Trim();
//			this.SaveRS(strUser,strStation,"080104");


            RemindDAO.UpdateNotice(entityNotice);
            entityNotice.Dispose();

            // 保存附件
            this.myAttachMentAdd.SaveAttachMent(this.strNoticeCode);

            return(true);
        }