示例#1
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);
        }
示例#2
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);
    }
示例#3
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, "删除失败");
        //}
    }
示例#4
0
文件: Notify.aspx.cs 项目: ishui/rms2
        //更新数据
        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);
        }