private FrmAttachmentDBs LoadAttach(BP.Sys.FrmAttachment athDesc)
        {
            BP.Sys.FrmAttachmentDBs dbs = new BP.Sys.FrmAttachmentDBs();
            if (athDesc.HisCtrlWay == AthCtrlWay.PWorkID)
            {
                string pWorkID = BP.DA.DBAccess.RunSQLReturnValInt("SELECT PWorkID FROM WF_GenerWorkFlow WHERE WorkID=" + this.PKVal, 0).ToString();
                if (pWorkID == null || pWorkID == "0")
                {
                    pWorkID = this.PKVal;
                }

                if (athDesc.AthUploadWay == AthUploadWay.Inherit)
                {
                    /* 继承模式 */
                    BP.En.QueryObject qo = new BP.En.QueryObject(dbs);
                    qo.AddWhere(FrmAttachmentDBAttr.RefPKVal, pWorkID);
                    qo.addOr();
                    qo.AddWhere(FrmAttachmentDBAttr.RefPKVal, int.Parse(this.PKVal));
                    qo.addOrderBy("Idx");
                    qo.DoQuery();
                }

                if (athDesc.AthUploadWay == AthUploadWay.Interwork)
                {
                    /*共享模式*/
                    //dbs.Retrieve(FrmAttachmentDBAttr.RefPKVal, pWorkID);

                    BP.En.QueryObject qo = new BP.En.QueryObject(dbs);
                    qo.AddWhere(FrmAttachmentDBAttr.RefPKVal, pWorkID);

                    qo.addOrderBy("Idx");
                    qo.DoQuery();
                }
            }
            else
            {
                int num = dbs.Retrieve(FrmAttachmentDBAttr.FK_FrmAttachment, this.FK_FrmAttachment,
                                       FrmAttachmentDBAttr.RefPKVal, this.PKVal, "Idx");
                if (num == 0 && this.IsCC == "1")
                {
                    CCList cc  = new CCList();
                    int    nnn = cc.Retrieve(CCListAttr.FK_Node, this.FK_Node, CCListAttr.WorkID, this.WorkID, CCListAttr.CCTo, WebUser.No);
                    if (cc.NDFrom != 0)
                    {
                        this._fk_node = cc.NDFrom;

                        dbs.Retrieve(FrmAttachmentDBAttr.FK_FrmAttachment, this.FK_FrmAttachmentExt,
                                     FrmAttachmentDBAttr.FK_MapData, "ND" + cc.NDFrom, FrmAttachmentDBAttr.RefPKVal, this.WorkID.ToString());

                        //重新设置文件描述。
                        athDesc.Retrieve(FrmAttachmentAttr.FK_MapData, this.FK_MapData, FrmAttachmentAttr.NoOfObj, "DocMultiAth");
                    }
                }
            }

            return(dbs);
        }
Example #2
0
        /// <summary>
        /// Sends an email to the addresses supplied in the TO, CC and BCC lists
        /// </summary>
        /// <returns>true if the message was sent successfully</returns>
        public bool SendEmail()
        {
            // Setup Email Client here
            if ((TOList.Count > 0) || (CCList.Count > 0) || (BCList.Count > 0))
            {
                message.Subject = this.subject;
                message.Body    = this.body;
                message.From    = new MailAddress("*****@*****.**");

                // Add addresses
                TOList.ForEach(x => message.To.Add(x));
                CCList.ForEach(x => message.CC.Add(x));
                BCList.ForEach(x => message.Bcc.Add(x));

                // Try sending the actual mail....
                try
                {
                    /*
                     *
                     #region Debug info
                     * WriteAddressToDebug();
                     #endregion
                     #if DEBUG
                     *  Trace.WriteLine("Debug on. Not sending emails");
                     #else
                     *  Trace.WriteLine("Debug off. SENDING EMAILS!!!!!");
                     *  smtp.Send(message);
                     #endif         */

                    Trace.WriteLine("Debug off. SENDING EMAILS!!!!!");
                    message.IsBodyHtml = true;


                    if (Convert.ToBoolean(WebConfigurationManager.AppSettings["RolledOut"]))
                    {
                        smtp.Send(message);
                    }
                    return(true);
                }
                catch (Exception ex)
                {
                    Trace.WriteLine(ex.ToString());
                    throw;
                    //TODO: Need to check if the sending fails here. HAd a case where the email address doesn't exist, but C# throws an exception an exception on that case. We need to log it and re-throwing is not required.
                }
            }
            return(false);
        }
Example #3
0
        /// <summary>
        /// 测试抄送
        /// </summary>
        public void TestCC()
        {
            string sUser = "******";

            BP.WF.Dev2Interface.Port_Login(sUser);

            //创建.
            workID = BP.WF.Dev2Interface.Node_CreateBlankWork(fl.No, null, null, WebUser.No, null, 0, null);

            //执行发送.
            BP.WF.Dev2Interface.Node_SendWork(fl.No, workID);

            //执行移交.
            BP.WF.Dev2Interface.Node_CC(fl.No, workID, "zhoushengyu", "移交测试");

            //让 zhoushengyu 登陆.
            BP.WF.Dev2Interface.Port_Login("zhoushengyu");


            #region 检查预期结果.
            sql = "SELECT FK_Emp FROM WF_EmpWorks WHERE WorkID=" + workID;
            dt  = DBAccess.RunSQLReturnTable(sql);
            if (dt.Rows.Count == 0)
            {
                throw new Exception("@移交后待办丢失。");
            }

            if (dt.Rows.Count != 1)
            {
                throw new Exception("@应该只有一个人处于待办状态。");
            }

            if (dt.Rows[0][0].ToString() != "zhoupeng")
            {
                throw new Exception("@应该是:zhoupeng 现在是:" + dt.Rows[0][0].ToString());
            }

            CCList list = new CCList();
            int    num  = list.Retrieve(CCListAttr.Rec, sUser, CCListAttr.WorkID, workID);
            if (num <= 0)
            {
                throw new Exception("@没有写入抄送数据在 WF_CCList 表中,查询的数量是:" + num);
            }
            #endregion 检查预期结果
        }
Example #4
0
 /// <summary>
 /// Add the given email address to 'CC' address list
 /// </summary>
 /// <param name="ccAddress">The email address to add</param>
 public void AddCcAddress(string ccAddress)
 {
     if (!string.IsNullOrEmpty(ccAddress))
     {
         if (string.IsNullOrEmpty(this.CCList))
         {
             this.CCList = ccAddress;
         }
         else if (CCList.EndsWith(","))
         {
             this.CCList = this.CCList + ccAddress;
         }
         else
         {
             this.CCList = this.CCList + "," + ccAddress;
         }
     }
 }
Example #5
0
        private void WriteAddressToDebug()
        {
            Trace.WriteLine("Sending email(s) to:");

            Trace.WriteLine("TO:");
            Trace.WriteLine(String.Format("  -- has {0} addresses", TOList.Count.ToString()));
            TOList.ForEach(x => Trace.WriteLine(string.Format("    -- {0} ", x.ToString())));

            Trace.WriteLine("CC:");
            Trace.WriteLine(String.Format("  -- has {0} addresses", CCList.Count.ToString()));
            CCList.ForEach(x => Trace.WriteLine(string.Format("    -- {0}", x.ToString())));

            Trace.WriteLine("Bcc:");
            Trace.WriteLine(String.Format("  -- has {0} addresses", BCList.Count.ToString()));
            BCList.ForEach(x => Trace.WriteLine(string.Format("    -- {0}", x.ToString())));

            Trace.WriteLine("... ... ...");
            Trace.WriteLine(message.ToString());
            Trace.WriteLine("... ... ...");
        }
Example #6
0
        public void BindTrack()
        {
            this.Page.Title = "感谢您使用ccflow";
            if (this.DoType == "View")
            {
                this.BindTrack_ViewWork();
                return;
            }

            if (this.DoType == "ViewSpecialWork")
            {
                this.BindTrack_ViewSpecialWork();
                return;
            }

            this.AddTable();
            this.AddTR();
            this.AddTDTitle("IDX");
            this.AddTDTitle("日期时间");
            this.AddTDTitle("从节点");
            this.AddTDTitle("人员");
            this.AddTDTitle("到节点");
            this.AddTDTitle("人员");
            this.AddTDTitle("活动");
            this.AddTDTitle("信息");
            this.AddTDTitle("表单");
            this.AddTDTitle("执行人");
            this.AddTREnd();

            string sqlOfWhere2 = "";
            string sqlOfWhere1 = "";

            string dbStr = BP.SystemConfig.AppCenterDBVarStr;
            Paras  prs   = new Paras();

            if (this.FID == 0)
            {
                sqlOfWhere1 = " WHERE (FID=" + dbStr + "WorkID11 OR WorkID=" + dbStr + "WorkID12 )  ";
                prs.Add("WorkID11", this.WorkID);
                prs.Add("WorkID12", this.WorkID);
            }
            else
            {
                sqlOfWhere1 = " WHERE (FID=" + dbStr + "FID11 OR WorkID=" + dbStr + "FID12 ) ";
                prs.Add("FID11", this.FID);
                prs.Add("FID12", this.FID);
            }

            string sql = "";

            sql     = "SELECT MyPK,ActionType,ActionTypeText,FID,WorkID,NDFrom,NDFromT,NDTo,NDToT,EmpFrom,EmpFromT,EmpTo,EmpToT,RDT,WorkTimeSpan,Msg,NodeData,Exer FROM ND" + int.Parse(this.FK_Flow) + "Track " + sqlOfWhere1;
            prs.SQL = sql;

            DataTable dt = DBAccess.RunSQLReturnTable(prs);
            DataView  dv = dt.DefaultView;

            dv.Sort = "RDT";

            // dv.RowFilter

            int idx = 1;

            foreach (DataRowView dr in dv)
            {
                this.AddTR();
                this.AddTDIdx(idx++);
                DateTime dtt = DataType.ParseSysDateTime2DateTime(dr[TrackAttr.RDT].ToString());
                this.AddTD(dtt.ToString("MM月dd日HH:mm"));

                this.AddTD(dr[TrackAttr.NDFromT].ToString());
                this.AddTD(dr[TrackAttr.EmpFromT].ToString());
                this.AddTD(dr[TrackAttr.NDToT].ToString());
                this.AddTD(dr[TrackAttr.EmpToT].ToString());

                ActionType at = (ActionType)int.Parse(dr[TrackAttr.ActionType].ToString());

                this.AddTD("<img src='./../../Img/Action/" + at.ToString() + ".png' class='ActionType' border=0/>" + BP.WF.Track.GetActionTypeT(at));

                this.AddTD(DataType.ParseText2Html(dr[TrackAttr.Msg].ToString()));

                //this.AddTD(item.NDToT);
                //this.AddTD(item.EmpToT);
                //this.AddTD(item.HisActionTypeT);
                //this.AddTDDoc(item.MsgHtml);

                this.AddTD("<a href=\"javascript:WinOpen('" + this.Request.ApplicationPath + "WF/WFRpt.aspx?WorkID=" + dr[TrackAttr.WorkID].ToString() + "&FK_Flow=" + this.FK_Flow + "&DoType=View&MyPK=" + dr[TrackAttr.MyPK].ToString() + "','" + dr[TrackAttr.MyPK].ToString() + "');\">表单</a>");
                this.AddTD(dr[TrackAttr.Exer].ToString());
                this.AddTREnd();
            }
            this.AddTableEnd();

            if (this.CCID != null)
            {
                CCList cl = new CCList();
                cl.MyPK = this.CCID;
                cl.RetrieveFromDBSources();
                this.AddFieldSet(cl.Title);
                this.Add("抄送人:" + cl.Rec + ", 抄送日期:" + cl.RDT);
                this.AddHR();
                this.Add(cl.DocHtml);
                this.AddFieldSetEnd();

                if (cl.HisSta == CCSta.UnRead)
                {
                    cl.HisSta = CCSta.Read;
                    cl.Update();
                }
            }
        }
 public static void Recycle(CCList <TValue> dic)
 {
     PoolCCList <TValue> .pool.Recycle(dic);
 }
        public static void Recycle(ref CCList <TValue> dic)
        {
            PoolCCList <TValue> .pool.Recycle(dic);

            dic = null;
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.DoType == "View")
            {
                this.BindTrack_ViewWork();
                return;
            }

            if (this.DoType == "ViewSpecialWork")
            {
                this.BindTrack_ViewSpecialWork();
                return;
            }


            //this.AddTable("class='Table' cellpadding='0' cellspacing='0' border='0' style='width: 100%'");
            //this.AddTR();
            //this.AddTDGroupTitle("style='text-align:center'", "序");
            //this.AddTDGroupTitle("操作时间");
            //this.AddTDGroupTitle("表单"); //moved by liuxc,2014-12-18,应zhangqingpeng要求将此列提前
            //this.AddTDGroupTitle("从节点");
            //this.AddTDGroupTitle("人员");
            //this.AddTDGroupTitle("到节点");
            //this.AddTDGroupTitle("人员");
            //this.AddTDGroupTitle("到达时间");
            //this.AddTDGroupTitle("用时");
            //this.AddTDGroupTitle("活动");
            //this.AddTDGroupTitle("信息");
            //this.AddTDGroupTitle("执行人");
            //this.AddTREnd();

            //获取track.
            DataTable dt = BP.WF.Dev2Interface.DB_GenerTrack(this.FK_Flow, this.WorkID, this.FID).Tables["Track"];
            DataView  dv = dt.DefaultView;

            dv.Sort = "RDT";

            GenerWorkFlow gwf = new GenerWorkFlow();

            gwf.WorkID = this.WorkID;
            gwf.RetrieveFromDBSources();

            string currNodeID = "0";

            if (gwf.WFState != WFState.Complete)
            {
                currNodeID = gwf.FK_Node.ToString(); //获得当前运行到的节点如果流程完成则为O.
            }
            int    idx      = 1;
            string checkStr = "";

            #region    qin   改成时间轴的显示方式 15/7/15   如果不需要这种显示方式
            string str = "";//拼接字符串
            str += "<div class='content'>";
            str += "<div class='wrapper'>";
            str += "<div class='main'>";

            str += "<h1 class='title'>";
            str += "ccflow流程日志</h1>";
            str += "<div class='year'>";
            str += "<h2>";
            str += "<a href='#'>到达时间<i></i></a></h2>";

            str += "<div class='list'>";
            str += "<ul>";
            #endregion qin   改成时间轴的显示方式 15/7/15

            #region 开始循环添加数据
            foreach (DataRowView dr in dv)
            {
                ActionType at = (ActionType)int.Parse(dr[TrackAttr.ActionType].ToString());
                // 记录审核节点。
                if (at == ActionType.WorkCheck)
                {
                    checkStr = dr[TrackAttr.NDFrom].ToString(); //记录当前的审核节点id.
                }
                //审核信息过滤,
                if (at == ActionType.WorkCheck)
                {
                    if (currNodeID == checkStr)
                    {
                        continue;
                    }
                    //如果当前节点与审核信息节点一致,就说明当前人员的审核意见已经保存,但是工作还没有发送,就不让他显示。
                }

                if (at == ActionType.Forward)
                {
                    if (checkStr == dr[TrackAttr.NDFrom].ToString())
                    {
                        continue;
                    }
                }
                str += "<li  class='cls highlight' style=\"background: url('../../Img/Action/" + at.ToString() + ".png') no-repeat 235px 31px\">";
                //this.AddTR();
                //this.AddTDIdx(idx);

                DateTime dtt = DataType.ParseSysDateTime2DateTime(dr[TrackAttr.RDT].ToString());


                // this.AddTD(dtt.ToString("yy年MM月dd日HH:mm"));</br>
                str += "<p class='date'>" + dtt.ToString("yy年MM月dd日") + "  " + BP.DA.DataType.GetWeek((int)dtt.DayOfWeek);
                str += "</br>" + dtt.ToString("hh时mm分");
                str += "</br>" + BP.WF.Glo.GenerUserImgHtml(dr[TrackAttr.EmpFrom].ToString(), dr[TrackAttr.EmpFromT].ToString()) + "</p>";
                str += "<p class='intro'>" + dr[TrackAttr.NDFromT].ToString() + "</p>";
                str += "<div class='more'>";

                if (at == ActionType.Forward || at == ActionType.ForwardAskfor || at == ActionType.WorkCheck || at == ActionType.Order ||
                    at == ActionType.FlowOver || //added by liuxc,2014-12-3,正常结束结点也显示表单
                    at == ActionType.Skip)       //added by liuxc,2015-7-13,自动跳转的也显示表单
                {
                    //this.AddTD("<a class='easyui-linkbutton' data-options=\"iconCls:'icon-sheet'\" href=\"javascript:WinOpen('" + BP.WF.Glo.CCFlowAppPath + "WF/WFRpt.aspx?WorkID=" + dr[TrackAttr.WorkID].ToString() + "&FK_Flow=" + this.FK_Flow + "&FK_Node=" + dr[TrackAttr.NDFrom].ToString() + "&DoType=View&MyPK=" + dr[TrackAttr.MyPK].ToString() + "','" + dr[TrackAttr.MyPK].ToString() + "');\">表单</a>");
                    str += "<p>" + "<a class='easyui-linkbutton' data-options=\"iconCls:'icon-sheet'\" href=\"javascript:WinOpen('" + BP.WF.Glo.CCFlowAppPath + "WF/WFRpt.aspx?WorkID=" + dr[TrackAttr.WorkID].ToString() + "&FK_Flow=" + this.FK_Flow + "&FK_Node=" + dr[TrackAttr.NDFrom].ToString() + "&DoType=View&MyPK=" + dr[TrackAttr.MyPK].ToString() + "','" + dr[TrackAttr.MyPK].ToString() + "');\">表单</a>" + "</p>";
                }
                else
                {
                    // this.AddTD("");
                    //  str += "<p>" + "<a class='easyui-linkbutton' data-options=\"iconCls:'icon-sheet'\" >表单</a>" + "</p>";
                }
                //this.AddTD(dr[TrackAttr.NDFromT].ToString());
                //this.AddTD(BP.WF.Glo.GenerUserImgSmallerHtml(dr[TrackAttr.EmpFrom].ToString(), dr[TrackAttr.EmpFromT].ToString()));
                //this.AddTD("<img src='../../Img/Action/" + at.ToString() + ".png' class='ActionType' border=0/>" + BP.WF.Track.GetActionTypeT(at));

                if (at == ActionType.FlowOver ||
                    at == ActionType.CC ||
                    at == ActionType.UnSend)
                {
                    str += "<p></p>";
                    str += "<p></p>";
                }
                else
                {
                    str += "<p>到达节点:" + dr[TrackAttr.NDToT].ToString() + "</p>";
                }

                //增加两列,到达时间、用时 added by liuxc,2014-12-4
                if (idx > 1)
                {
                    var toTime = Convert.ToDateTime(dv[idx - 1 - 1][TrackAttr.RDT].ToString());
                    str += "<p>到达时间:" + toTime.ToString("yy年MM月dd日HH:mm") + " 用时:" + DataType.GetSpanTime(toTime, dtt) + "</p>";
                }

                // 删除信息.
                string tag = dr[TrackAttr.Tag].ToString();
                if (tag != null)
                {
                    tag = tag.Replace("~", "'");
                }

                string msg = DataType.ParseText2Html(dr[TrackAttr.Msg].ToString());
                switch (at)
                {
                case ActionType.CallChildenFlow:     //被调用父流程吊起。
                    if (string.IsNullOrEmpty(tag) == false)
                    {
                        AtPara        ap    = new AtPara(tag);
                        GenerWorkFlow mygwf = new GenerWorkFlow();
                        mygwf.WorkID = ap.GetValInt64ByKey("PWorkID");
                        if (mygwf.RetrieveFromDBSources() == 1)
                        {
                            msg = "<p>操作员:{" + dr[TrackAttr.EmpFromT].ToString() + "}在当前节点上,被父流程{" + mygwf.FlowName + "},<a target=b" + ap.GetValStrByKey("PWorkID") + " href='Track.aspx?WorkID=" + ap.GetValStrByKey("PWorkID") + "&FK_Flow=" + ap.GetValStrByKey("PFlowNo") + "' >" + msg + "</a></p>";
                        }
                        else
                        {
                            msg = "<p>操作员:{" + dr[TrackAttr.EmpFromT].ToString() + "}在当前节点上,被父流程调用{" + mygwf.FlowName + "},但是该流程被删除了.</p>" + tag;
                        }

                        msg = "<a target=b" + ap.GetValStrByKey("PWorkID") + " href='Track.aspx?WorkID=" + ap.GetValStrByKey("PWorkID") + "&FK_Flow=" + ap.GetValStrByKey("PFlowNo") + "' >" + msg + "</a>";
                    }
                    break;

                case ActionType.StartChildenFlow:     //吊起子流程。
                    if (string.IsNullOrEmpty(tag) == false)
                    {
                        if (tag.Contains("Sub"))
                        {
                            tag = tag.Replace("Sub", "C");
                        }

                        AtPara        ap    = new AtPara(tag);
                        GenerWorkFlow mygwf = new GenerWorkFlow();
                        mygwf.WorkID = ap.GetValInt64ByKey("CWorkID");
                        if (mygwf.RetrieveFromDBSources() == 1)
                        {
                            msg  = "<p>操作员:{" + dr[TrackAttr.EmpFromT].ToString() + "}在当前节点上调用了子流程{" + mygwf.FlowName + "}, <a target=b" + ap.GetValStrByKey("CWorkID") + " href='Track.aspx?WorkID=" + ap.GetValStrByKey("CWorkID") + "&FK_Flow=" + ap.GetValStrByKey("CFlowNo") + "' >" + msg + "</a></p>";
                            msg += "<p>当前子流程状态:{" + mygwf.WFStateText + "},运转到:{" + mygwf.NodeName + "},最后处理人{" + mygwf.TodoEmps + "},最后处理时间{" + mygwf.RDT + "}。</p>";
                        }
                        else
                        {
                            msg = "<p>操作员:{" + dr[TrackAttr.EmpFromT].ToString() + "}在当前节点上调用了子流程{" + mygwf.FlowName + "},但是该流程被删除了.</p>" + tag;
                        }
                    }
                    break;

                default:
                    break;
                }

                msg = msg.Replace("\"", "");

                str += "<p>" + msg + "</p>";
                str += "</div>";
                str += "</li>";
                idx++;
            } //结束循环.
            //this.AddTableEnd();
            #endregion

            if (this.CCID != null)
            {
                CCList cl = new CCList();
                cl.MyPK = this.CCID;
                cl.RetrieveFromDBSources();
                // this.AddFieldSet(cl.Title);
                // this.Add("抄送人:" + cl.Rec + ", 抄送日期:" + cl.RDT);
                // this.AddHR();
                // this.Add(cl.DocHtml);
                // this.AddFieldSetEnd();
                str += "<li  class='cls highlight' style=\"background: url('./Img/Action/circle.png') no-repeat 235px 31px\">";
                str += "<p class='date'>&nbsp;</p>";
                str += "<p class='intro'>" + cl.Title + "</p>";
                str += "<p class='version'>&nbsp;</p>";
                str += "<div class='more'>";
                str += "<p>抄送人:" + cl.Rec + "</p>";
                str += "<p>抄送日期:" + cl.RDT + "</p>";
                str += "</div>";
                str += "</li>";
                if (cl.HisSta == CCSta.UnRead)
                {
                    cl.HisSta = CCSta.Read;
                    cl.Update();
                }
            }

            str += "</ul>";
            str += "</div>";
            str += "</div>";
            str += "</div>";
            str += "</div>";
            str += "</div>";
            //this.Clear();
            HiddenField1.Value = str.ToString();
        }
Example #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            MapData       md      = new MapData(this.FK_MapData);
            FrmAttachment athDesc = new FrmAttachment();
            int           i       = athDesc.Retrieve(FrmAttachmentAttr.FK_MapData,
                                                     this.FK_MapData, FrmAttachmentAttr.NoOfObj, "DocMainAth");

            if (i == 0)
            {
                /*如果没有数据.*/
                /*如果没有查询到它,就有可能是公文多附件被删除了.*/
                athDesc.NoOfObj    = "DocMainAth";
                athDesc.Exts       = "doc,docx,xls,xlsx";
                athDesc.MyPK       = athDesc.FK_MapData + "_" + athDesc.NoOfObj;
                athDesc.FK_MapData = this.FK_MapData;


                //存储路径.
                string path = Server.MapPath("/DataUser/UploadFile/");
                path          += "\\F" + this.FK_Flow + "MainAth";
                athDesc.SaveTo = path;

                //位置.
                athDesc.X = (float)94.09;
                athDesc.Y = (float)140.18;
                athDesc.W = (float)626.36;
                athDesc.H = (float)150;

                //多附件.
                athDesc.UploadType = AttachmentUploadType.Single;
                athDesc.Name       = "公文正文(系统自动增加)";
                athDesc.SetValByKey("AtPara",
                                    "@IsWoEnablePageset=1@IsWoEnablePrint=1@IsWoEnableViewModel=1@IsWoEnableReadonly=0@IsWoEnableSave=1@IsWoEnableWF=1@IsWoEnableProperty=1@IsWoEnableRevise=1@IsWoEnableIntoKeepMarkModel=1@FastKeyIsEnable=0@IsWoEnableViewKeepMark=1@FastKeyGenerRole=@IsWoEnableTemplete=1");
                athDesc.Insert();

                //有可能在其其它的节点上没有这个附件,所以也要循环增加上它.
                BP.WF.Nodes nds = new Nodes(this.FK_Flow);
                foreach (Node nd in nds)
                {
                    athDesc.FK_MapData = "ND" + nd.NodeID;
                    athDesc.MyPK       = athDesc.FK_MapData + "_" + athDesc.NoOfObj;
                    if (athDesc.IsExits == true)
                    {
                        continue;
                    }
                    athDesc.Insert();
                }

                //重新查询一次,把默认值加上.
                athDesc.RetrieveFromDBSources();
            }

            FrmAttachmentDBs athDBs = null;

            athDBs = new FrmAttachmentDBs(this.FK_MapData, this.WorkID.ToString());

            FrmAttachmentDB athDB = null;

            if (athDBs.Count == 0 && this.IsCC == "1")
            {
                /*如果是抄送过来的, 有可能是抄送到的节点不是发送到的节点,导致附件数据没有copy。
                 * 也就是说,发给b节点,但是抄送到c节点上去了,导致c节点上的人看不到附件数据。*/

                CCList cc  = new CCList();
                int    nnn = cc.Retrieve(CCListAttr.FK_Node, this.FK_Node, CCListAttr.WorkID, this.WorkID, CCListAttr.CCTo, WebUser.No);
                this._fk_node = cc.NDFrom;
                if (cc.NDFrom != 0)
                {
                    athDBs.Retrieve(FrmAttachmentDBAttr.FK_MapData, "ND" + cc.NDFrom, FrmAttachmentDBAttr.RefPKVal, this.WorkID.ToString());

                    string ndFromMapdata = athDesc.MyPK.Replace(athDesc.FK_MapData, "ND" + cc.NDFrom);
                    athDB = athDBs.GetEntityByKey(FrmAttachmentDBAttr.FK_FrmAttachment, ndFromMapdata) as FrmAttachmentDB;
                    //重新设置文件描述。
                    athDesc.Retrieve(FrmAttachmentAttr.FK_MapData, this.FK_MapData, FrmAttachmentAttr.NoOfObj, "DocMainAth");
                }
            }
            else
            {
                /* 单个文件 */
                athDB = athDBs.GetEntityByKey(FrmAttachmentDBAttr.FK_FrmAttachment, athDesc.MyPK) as FrmAttachmentDB;
            }


            Label lab = new Label();

            lab.ID = "Lab" + athDesc.MyPK;
            this.Pub1.Add(lab);
            if (athDB != null)
            {
                if (athDB.FileExts == "ceb")
                {
                    athDB.FileExts = "pdf";
                }
                if (athDesc.IsWoEnableWF)
                {
                    lab.Text = "<a  href=\"javascript:OpenOfiice('" + athDB.FK_FrmAttachment + "','" + this.WorkID + "','" + athDB.MyPK + "','" + this.FK_MapData + "','" + athDesc.NoOfObj + "','" + this.FK_Node + "')\"><img src='" + BP.WF.Glo.CCFlowAppPath + "WF/Img/FileType/" + athDB.FileExts + ".gif' border=0/>" + athDB.FileName + "</a>";
                }
                else
                {
                    lab.Text = "<img src='" + BP.WF.Glo.CCFlowAppPath + "WF/Img/FileType/" + athDB.FileExts + ".gif' border=0/>" + athDB.FileName;
                }
            }

            #region 处理权限问题.
            // 处理权限问题, 有可能当前节点是可以上传或者删除,但是当前节点上不能让此人执行工作。
            bool isDel    = athDesc.IsDeleteInt == 0 ? false : true;
            bool isUpdate = athDesc.IsUpload;
            if (isDel == true || isUpdate == true)
            {
                if (this.WorkID != 0 &&
                    string.IsNullOrEmpty(this.FK_Flow) == false)
                {
                    isDel = BP.WF.Dev2Interface.Flow_IsCanDoCurrentWork(this.FK_Flow, this.FK_Node, this.WorkID, WebUser.No);
                    if (isDel == false)
                    {
                        isUpdate = false;
                    }
                }
            }
            #endregion 处理权限问题.

            Button mybtn = new Button();
            mybtn.CssClass = "Btn";

            if (athDesc.IsUpload && isUpdate == true)
            {
                FileUpload fu = new FileUpload();
                fu.ID                     = athDesc.MyPK;
                Btn_Upload.ID             = "Btn_Upload_" + athDesc.MyPK + "_" + this.WorkID;
                fu.Attributes["Width"]    = athDesc.W.ToString();
                fu.Attributes["onchange"] = "UploadChange('" + mybtn.ID + "');";
                this.Pub1.Add(fu);
            }

            if (athDesc.IsDownload)
            {
                mybtn          = new Button();
                mybtn.Text     = "下载";
                mybtn.CssClass = "Btn";

                mybtn.ID       = "Btn_Download_" + athDesc.MyPK + "_" + this.WorkID;
                mybtn.Click   += new EventHandler(btnUpload_Click);
                mybtn.CssClass = "bg";
                if (athDB == null)
                {
                    mybtn.Visible = false;
                }
                else
                {
                    mybtn.Visible = true;
                }
                this.Pub1.Add(mybtn);
            }

            if (this.IsReadonly == false)
            {
                if (athDesc.IsDeleteInt != 0 && isDel == true)
                {
                    bool isDeleteBtn = true;
                    if (athDesc.IsDeleteInt == 2)
                    {
                        if (!athDB.Rec.Equals(WebUser.No))
                        {
                            isDeleteBtn = false;
                        }
                    }
                    if (isDeleteBtn)
                    {
                        mybtn          = new Button();
                        mybtn.CssClass = "Btn";
                        mybtn.Text     = "删除";
                        mybtn.Attributes["onclick"] = " return confirm('您确定要执行删除吗?');";
                        mybtn.ID       = "Btn_Delete_" + athDesc.MyPK + "_" + this.WorkID;
                        mybtn.Click   += new EventHandler(btnUpload_Click);
                        mybtn.CssClass = "bg";
                        if (athDB == null)
                        {
                            mybtn.Visible = false;
                        }
                        else
                        {
                            mybtn.Visible = true;
                        }
                        this.Pub1.Add(mybtn);
                    }
                }

                if (athDesc.IsWoEnableWF)
                {
                    mybtn          = new Button();
                    mybtn.CssClass = "Btn";
                    mybtn.Text     = "打开";
                    mybtn.ID       = "Btn_Open_" + athDesc.MyPK + "_" + this.WorkID;
                    mybtn.Click   += new EventHandler(btnUpload_Click);
                    mybtn.CssClass = "bg";
                    if (athDB == null)
                    {
                        mybtn.Visible = false;
                    }
                    else
                    {
                        mybtn.Visible = true;
                    }
                    this.Pub1.Add(mybtn);
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.DoType == "View")
            {
                this.BindTrack_ViewWork();
                return;
            }

            if (this.DoType == "ViewSpecialWork")
            {
                this.BindTrack_ViewSpecialWork();
                return;
            }

            this.AddTable("class='Table' cellpadding='0' cellspacing='0' border='0' style='width: 100%'");
            this.AddTR();
            this.AddTDGroupTitle("style='text-align:center'", "序");
            this.AddTDGroupTitle("操作时间");
            this.AddTDGroupTitle("表单"); //moved by liuxc,2014-12-18,应zhangqingpeng要求将此列提前
            this.AddTDGroupTitle("从节点");
            this.AddTDGroupTitle("人员");
            this.AddTDGroupTitle("到节点");
            this.AddTDGroupTitle("人员");
            this.AddTDGroupTitle("到达时间");
            this.AddTDGroupTitle("用时");
            this.AddTDGroupTitle("活动");
            this.AddTDGroupTitle("信息");
            this.AddTDGroupTitle("执行人");
            this.AddTREnd();

            //获取track.
            DataTable dt = BP.WF.Dev2Interface.DB_GenerTrack(this.FK_Flow, this.WorkID, this.FID).Tables["Track"];
            DataView  dv = dt.DefaultView;

            dv.Sort = "RDT";

            GenerWorkFlow gwf = new GenerWorkFlow();

            gwf.WorkID = this.WorkID;
            gwf.RetrieveFromDBSources();

            string currNodeID = "0";

            if (gwf.WFState != WFState.Complete)
            {
                currNodeID = gwf.FK_Node.ToString(); //获得当前运行到的节点如果流程完成则为O.
            }
            int    idx      = 1;
            string checkStr = "";

            foreach (DataRowView dr in dv)
            {
                ActionType at = (ActionType)int.Parse(dr[TrackAttr.ActionType].ToString());
                // 记录审核节点。
                if (at == ActionType.WorkCheck)
                {
                    checkStr = dr[TrackAttr.NDFrom].ToString(); //记录当前的审核节点id.
                }
                //审核信息过滤,
                if (at == ActionType.WorkCheck)
                {
                    if (currNodeID == checkStr)
                    {
                        continue;
                    }
                    //如果当前节点与审核信息节点一致,就说明当前人员的审核意见已经保存,但是工作还没有发送,就不让他显示。
                }

                if (at == ActionType.Forward)
                {
                    if (checkStr == dr[TrackAttr.NDFrom].ToString())
                    {
                        continue;
                    }
                }

                this.AddTR();
                this.AddTDIdx(idx);
                DateTime dtt = DataType.ParseSysDateTime2DateTime(dr[TrackAttr.RDT].ToString());
                this.AddTD(dtt.ToString("yy年MM月dd日HH:mm"));

                if (at == ActionType.Forward ||
                    at == ActionType.ForwardAskfor ||
                    at == ActionType.WorkCheck ||
                    at == ActionType.Order ||
                    at == ActionType.FlowOver || //added by liuxc,2014-12-3,正常结束结点也显示表单
                    at == ActionType.Skip)       //added by liuxc,2015-7-13,自动跳转的也显示表单
                {
                    this.AddTD("<a class='easyui-linkbutton' data-options=\"iconCls:'icon-sheet'\" href=\"javascript:WinOpen('" + BP.WF.Glo.CCFlowAppPath + "WF/WFRpt.aspx?WorkID=" + dr[TrackAttr.WorkID].ToString() + "&FK_Flow=" + this.FK_Flow + "&FK_Node=" + dr[TrackAttr.NDFrom].ToString() + "&DoType=View&MyPK=" + dr[TrackAttr.MyPK].ToString() + "','" + dr[TrackAttr.MyPK].ToString() + "');\">表单</a>");
                }
                else
                {
                    this.AddTD("");
                }

                this.AddTD(dr[TrackAttr.NDFromT].ToString());
                this.AddTD(BP.WF.Glo.GenerUserImgSmallerHtml(dr[TrackAttr.EmpFrom].ToString(), dr[TrackAttr.EmpFromT].ToString()));

                if (at == ActionType.FlowOver ||
                    at == ActionType.CC ||
                    at == ActionType.UnSend)
                {
                    this.AddTD();
                    this.AddTD();
                }
                else
                {
                    this.AddTD(dr[TrackAttr.NDToT].ToString());
                    this.AddTD(dr[TrackAttr.EmpToT].ToString());
                }

                //增加两列,到达时间、用时 added by liuxc,2014-12-4
                if (idx > 1)
                {
                    var toTime = Convert.ToDateTime(dv[idx - 1 - 1][TrackAttr.RDT].ToString());
                    this.AddTD(toTime.ToString("yy年MM月dd日HH:mm"));
                    this.AddTD(DataType.GetSpanTime(toTime, dtt));
                }
                else
                {
                    this.AddTD();
                    this.AddTD();
                }

                this.AddTD("<img src='../../Img/Action/" + at.ToString() + ".png' class='ActionType' border=0/>" + BP.WF.Track.GetActionTypeT(at));

                // 删除信息.
                string tag = dr[TrackAttr.Tag].ToString();
                if (tag != null)
                {
                    tag = tag.Replace("~", "'");
                }

                string msg = dr[TrackAttr.Msg].ToString();
                switch (at)
                {
                case ActionType.CallChildenFlow:     //被调用父流程吊起。
                    if (string.IsNullOrEmpty(tag) == false)
                    {
                        AtPara ap = new AtPara(tag);
                        this.AddTD("class=TD", "<a target=b" + ap.GetValStrByKey("PWorkID") + " href='Track.aspx?WorkID=" + ap.GetValStrByKey("PWorkID") + "&FK_Flow=" + ap.GetValStrByKey("PFlowNo") + "' >" + msg + "</a>");
                    }
                    else
                    {
                        this.AddTD("class=TD", msg);
                    }
                    break;

                case ActionType.StartChildenFlow:     //吊起子流程。
                    if (string.IsNullOrEmpty(tag) == false)
                    {
                        AtPara ap = new AtPara(tag);
                        this.AddTD("class=TD", "<a target=b" + ap.GetValStrByKey("CWorkID") + " href='Track.aspx?WorkID=" + ap.GetValStrByKey("CWorkID") + "&FK_Flow=" + ap.GetValStrByKey("CFlowNo") + "' >" + msg + "</a>");
                    }
                    else
                    {
                        this.AddTD("class=TD", msg);
                    }
                    break;

                default:
                    this.AddTD(DataType.ParseText2Html(msg));
                    break;
                }

                this.AddTD(dr[TrackAttr.Exer].ToString());
                this.AddTREnd();
                idx++;
            }
            this.AddTableEnd();

            if (this.CCID != null)
            {
                CCList cl = new CCList();
                cl.MyPK = this.CCID;
                cl.RetrieveFromDBSources();
                this.AddFieldSet(cl.Title);
                this.Add("抄送人:" + cl.Rec + ", 抄送日期:" + cl.RDT);
                this.AddHR();
                this.Add(cl.DocHtml);
                this.AddFieldSetEnd();

                if (cl.HisSta == CCSta.UnRead)
                {
                    cl.HisSta = CCSta.Read;
                    cl.Update();
                }
            }
        }
Example #12
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            Response.AddHeader("P3P", "CP=CAO PSA OUR");
            Response.AddHeader("Cache-Control", "no-store");
            Response.AddHeader("Expires", "0");
            Response.AddHeader("Pragma", "no-cache");
            string url = this.Request.RawUrl;

            if (url.Contains("DTT=") == false)
            {
                //this.Response.Redirect(url + "&DTT=" + DateTime.Now.ToString("mmDDhhmmss"), true);
                //return;
            }

            try
            {
                switch (this.ActionType)
                {
                case "Focus":     //把任务放入任务池.
                    BP.WF.Dev2Interface.Flow_Focus(Int64.Parse(this.Request.QueryString["WorkID"]));
                    this.WinClose("ss");
                    break;

                case "PutOne":     //把任务放入任务池.
                    Int64 workid42 = Int64.Parse(this.Request.QueryString["WorkID"]);
                    BP.WF.Dev2Interface.Node_TaskPoolPutOne(workid42);
                    this.WinClose("ss");
                    break;

                case "DoAppTask":     // 申请任务.
                    Int64 workid2 = Int64.Parse(this.Request.QueryString["WorkID"]);
                    BP.WF.Dev2Interface.Node_TaskPoolTakebackOne(workid2);
                    this.WinClose("ss");
                    return;

                case "DoOpenCC":
                    string fk_flow1 = this.Request.QueryString["FK_Flow"];
                    string fk_node1 = this.Request.QueryString["FK_Node"];
                    string workid1  = this.Request.QueryString["WorkID"];
                    string fid1     = this.Request.QueryString["FID"];
                    string Sta      = this.Request.QueryString["Sta"];
                    if (Sta == "0")
                    {
                        BP.WF.Template.CCList cc1 = new BP.WF.Template.CCList();
                        cc1.MyPK = this.Request.QueryString["MyPK"];
                        cc1.Retrieve();
                        cc1.HisSta = CCSta.Read;
                        cc1.Update();
                    }
                    this.Response.Redirect("./WorkOpt/OneWork/Track.aspx?FK_Flow=" + fk_flow1 + "&FK_Node=" + fk_node1 + "&WorkID=" + workid1 + "&FID=" + fid1, false);
                    return;

                case "DelCC":     //删除抄送.
                    CCList cc = new CCList();
                    cc.MyPK = this.MyPK;
                    cc.Retrieve();
                    cc.HisSta = CCSta.Del;
                    cc.Update();
                    this.WinClose();
                    break;

                case "DelSubFlow":     //删除进程。
                    try
                    {
                        BP.WF.Dev2Interface.Flow_DeleteSubThread(this.FK_Flow, this.WorkID, "手工删除");
                        this.WinClose();
                    }
                    catch (Exception ex)
                    {
                        this.WinCloseWithMsg(ex.Message);
                    }
                    break;

                case "DownBill":
                    Bill b = new Bill(this.MyPK);
                    b.DoOpen();
                    break;

                case "DelDtl":
                    GEDtls dtls = new GEDtls(this.EnsName);
                    GEDtl  dtl  = (GEDtl)dtls.GetNewEntity;
                    dtl.OID = this.RefOID;
                    if (dtl.RetrieveFromDBSources() == 0)
                    {
                        this.WinClose();
                        break;
                    }
                    FrmEvents fes = new FrmEvents(this.EnsName);     //获得事件.

                    // 处理删除前事件.
                    try
                    {
                        fes.DoEventNode(BP.WF.XML.EventListDtlList.DtlItemDelBefore, dtl);
                    }
                    catch (Exception ex)
                    {
                        this.WinCloseWithMsg(ex.Message);
                        break;
                    }
                    dtl.Delete();

                    // 处理删除后事件.
                    try
                    {
                        fes.DoEventNode(BP.WF.XML.EventListDtlList.DtlItemDelAfter, dtl);
                    }
                    catch (Exception ex)
                    {
                        this.WinCloseWithMsg(ex.Message);
                        break;
                    }
                    this.WinClose();
                    break;

                case "EmpDoUp":
                    BP.WF.Port.WFEmp ep = new BP.WF.Port.WFEmp(this.RefNo);
                    ep.DoUp();

                    BP.WF.Port.WFEmps emps111 = new BP.WF.Port.WFEmps();
                    //  emps111.RemoveCash();
                    emps111.RetrieveAll();
                    this.WinClose();
                    break;

                case "EmpDoDown":
                    BP.WF.Port.WFEmp ep1 = new BP.WF.Port.WFEmp(this.RefNo);
                    ep1.DoDown();

                    BP.WF.Port.WFEmps emps11441 = new BP.WF.Port.WFEmps();
                    //  emps11441.RemoveCash();
                    emps11441.RetrieveAll();
                    this.WinClose();
                    break;

                case "Track":     //通过一个串来打开一个工作.
                    string   mySid  = this.Request.QueryString["SID"];
                    string[] mystrs = mySid.Split('_');

                    Int64  myWorkID = int.Parse(mystrs[1]);
                    string fk_emp   = mystrs[0];
                    int    fk_node  = int.Parse(mystrs[2]);
                    Node   mynd     = new Node();
                    mynd.NodeID = fk_node;
                    mynd.RetrieveFromDBSources();

                    string fk_flow = mynd.FK_Flow;
                    string myurl   = "./WorkOpt/OneWork/Track.aspx?FK_Node=" + mynd.NodeID + "&WorkID=" + myWorkID + "&FK_Flow=" + fk_flow;
                    Web.WebUser.SignInOfGener(new BP.Port.Emp(fk_emp), true);
                    this.Response.Write("<script> window.location.href='" + myurl + "'</script> *^_^*  <br><br>正在进入系统请稍后,如果长时间没有反应,请<a href='" + myurl + "'>点这里进入。</a>");
                    return;

                case "OF":     //通过一个串来打开一个工作.
                    string          sid  = this.Request.QueryString["SID"];
                    string[]        strs = sid.Split('_');
                    GenerWorkerList wl   = new GenerWorkerList();
                    int             i    = wl.Retrieve(GenerWorkerListAttr.FK_Emp, strs[0],
                                                       GenerWorkerListAttr.WorkID, strs[1],
                                                       GenerWorkerListAttr.FK_Node, strs[2]);
                    if (i == 0)
                    {
                        this.Response.Write("<h2>提示</h2>此工作已经被别人处理或者此流程已删除。");
                        return;
                    }

                    BP.Port.Emp empOF = new BP.Port.Emp(wl.FK_Emp);
                    Web.WebUser.SignInOfGener(empOF, true);
                    string u = "MyFlow.aspx?FK_Flow=" + wl.FK_Flow + "&WorkID=" + wl.WorkID + "&FK_Node=" + wl.FK_Node + "&FID=" + wl.FID;
                    this.Response.Write("<script> window.location.href='" + u + "'</script> *^_^*  <br><br>正在进入系统请稍后,如果长时间没有反应,请<a href='" + u + "'>点这里进入。</a>");
                    return;

                case "ExitAuth":
                    BP.Port.Emp emp = new BP.Port.Emp(this.FK_Emp);
                    //首先退出,再进行登录
                    BP.Web.WebUser.Exit();
                    BP.Web.WebUser.SignInOfGenerLang(emp, WebUser.SysLang);
                    this.WinClose();
                    return;

                case "LogAs":
                    BP.WF.Port.WFEmp wfemp = new BP.WF.Port.WFEmp(this.FK_Emp);
                    if (wfemp.AuthorIsOK == false)
                    {
                        this.WinCloseWithMsg("授权失败");
                        return;
                    }
                    BP.Port.Emp emp1 = new BP.Port.Emp(this.FK_Emp);
                    BP.Web.WebUser.SignInOfGener(emp1, WebUser.SysLang, WebUser.No, true, false);
                    this.WinClose();
                    return;

                case "TakeBack":     // 取消授权。
                    BP.WF.Port.WFEmp myau = new BP.WF.Port.WFEmp(WebUser.No);
                    BP.DA.Log.DefaultLogWriteLineInfo("取消授权:" + WebUser.No + "取消了对(" + myau.Author + ")的授权。");
                    myau.Author    = "";
                    myau.AuthorWay = 0;
                    myau.Update();
                    this.WinClose();
                    return;

                case "AutoTo":     // 执行授权。
                    BP.WF.Port.WFEmp au = new BP.WF.Port.WFEmp();
                    au.No = WebUser.No;
                    au.RetrieveFromDBSources();
                    au.AuthorDate = BP.DA.DataType.CurrentData;
                    au.Author     = this.FK_Emp;
                    au.AuthorWay  = 1;
                    au.Save();
                    BP.DA.Log.DefaultLogWriteLineInfo("执行授权:" + WebUser.No + "执行了对(" + au.Author + ")的授权。");
                    this.WinClose();
                    return;

                case "UnSend":     //执行撤消发送。
                    this.Response.Redirect("./WorkOpt/UnSend.aspx?WorkID=" + this.WorkID + "&FK_Flow=" + this.FK_Flow, false);
                    return;

                case "SetBillState":
                    break;

                case "WorkRpt":
                    Bill bk1 = new Bill(this.Request.QueryString["OID"]);
                    Node nd  = new Node(bk1.FK_Node);
                    this.Response.Redirect("WFRpt.aspx?WorkID=" + bk1.WorkID + "&FID=" + bk1.FID + "&FK_Flow=" + nd.FK_Flow + "&NodeId=" + bk1.FK_Node, false);
                    //this.WinOpen();
                    //this.WinClose();
                    break;

                case "PrintBill":
                    //Bill bk2 = new Bill(this.Request.QueryString["OID"]);
                    //Node nd2 = new Node(bk2.FK_Node);
                    //this.Response.Redirect("NodeRefFunc.aspx?NodeId=" + bk2.FK_Node + "&FlowNo=" + nd2.FK_Flow + "&NodeRefFuncOID=" + bk2.FK_NodeRefFunc + "&WorkFlowID=" + bk2.WorkID);
                    ////this.WinClose();
                    break;

                //删除流程中第一个节点的数据,包括待办工作
                case "DeleteFlow":
                    string fk_flowDel = this.Request.QueryString["FK_Flow"];
                    Int64  workid     = Int64.Parse(this.Request.QueryString["WorkID"]);
                    //调用DoDeleteWorkFlowByReal方法
                    WorkFlow wf = new WorkFlow(new Flow(fk_flowDel), workid);
                    wf.DoDeleteWorkFlowByReal(true);
                    //  Glo.ToMsg("流程删除成功");
                    BP.WF.Glo.ToMsg("流程删除成功");



                    //this.ToWFMsgPage("流程删除成功");
                    break;

                default:
                    throw new Exception("ActionType error" + this.ActionType);
                }
            }
            catch (Exception ex)
            {
                this.ToErrorPage("执行其间如下异常:<BR>" + ex.Message);
            }
        }
Example #13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Response.ContentEncoding = System.Text.UTF8Encoding.UTF8;
            this.Request.ContentEncoding  = System.Text.UTF8Encoding.UTF8;

            #region 功能执行.
            if (this.DoType == "Del")
            {
                FrmAttachmentDB delDB = new FrmAttachmentDB();
                delDB.MyPK = this.DelPKVal == null ? this.MyPK : this.DelPKVal;

                delDB.DirectDelete();
            }
            if (this.DoType == "Down")
            {
                FrmAttachmentDB downDB = new FrmAttachmentDB();

                downDB.MyPK = this.DelPKVal == null ? this.MyPK : this.DelPKVal;
                downDB.Retrieve();

                string downpath = GetRealPath(downDB.FileFullName);
                BP.Sys.PubClass.DownloadFile(downpath, downDB.FileName);
                this.WinClose();
                return;
            }

            if (this.DoType == "WinOpen")
            {
                FrmAttachmentDB downDB = new FrmAttachmentDB();
                downDB.MyPK = this.MyPK;
                downDB.Retrieve();
                Response.ContentType = "Application/pdf";
                string downpath = GetRealPath(downDB.FileFullName);
                Response.WriteFile(downpath);
                Response.End();
                return;
            }
            #endregion 功能执行.

            #region 处理权限控制.
            BP.Sys.FrmAttachment athDesc = new BP.Sys.FrmAttachment();
            athDesc.MyPK = this.FK_FrmAttachment;
            if (this.FK_Node == null || this.FK_Flow == null)
            {
                athDesc.RetrieveFromDBSources();
            }
            else
            {
                #region 判断是否可以查询出来,如果查询不出来,就可能是公文流程。
                athDesc.MyPK = this.FK_FrmAttachment;
                if (athDesc.RetrieveFromDBSources() == 0 && string.IsNullOrEmpty(this.FK_Flow) == false)
                {
                    /*如果没有查询到它,就有可能是公文多附件被删除了.*/
                    athDesc.MyPK       = this.FK_FrmAttachment;
                    athDesc.NoOfObj    = "DocMultiAth";
                    athDesc.FK_MapData = this.FK_MapData;
                    athDesc.Exts       = "*.*";

                    //存储路径.
                    athDesc.SaveTo    = "/DataUser/UploadFile/";
                    athDesc.IsNote    = false; //不显示note字段.
                    athDesc.IsVisable = false; // 让其在form 上不可见.

                    //位置.
                    athDesc.X = (float)94.09;
                    athDesc.Y = (float)333.18;
                    athDesc.W = (float)626.36;
                    athDesc.H = (float)150;

                    //多附件.
                    athDesc.UploadType = AttachmentUploadType.Multi;
                    athDesc.Name       = "公文多附件(系统自动增加)";
                    athDesc.SetValByKey("AtPara",
                                        "@IsWoEnablePageset=1@IsWoEnablePrint=1@IsWoEnableViewModel=1@IsWoEnableReadonly=0@IsWoEnableSave=1@IsWoEnableWF=1@IsWoEnableProperty=1@IsWoEnableRevise=1@IsWoEnableIntoKeepMarkModel=1@FastKeyIsEnable=0@IsWoEnableViewKeepMark=1@FastKeyGenerRole=@IsWoEnableTemplete=1");
                    athDesc.Insert();

                    //有可能在其其它的节点上没有这个附件,所以也要循环增加上它.
                    BP.WF.Nodes nds = new BP.WF.Nodes(this.FK_Flow);
                    foreach (BP.WF.Node nd in nds)
                    {
                        athDesc.FK_MapData = "ND" + nd.NodeID;
                        athDesc.MyPK       = athDesc.FK_MapData + "_" + athDesc.NoOfObj;
                        if (athDesc.IsExits == true)
                        {
                            continue;
                        }

                        athDesc.Insert();
                    }

                    //重新查询一次,把默认值加上.
                    athDesc.RetrieveFromDBSources();
                }
                #endregion 判断是否可以查询出来,如果查询不出来,就可能是公文流程。

                #region 处理权限方案。
                /*首先判断是否具有权限方案*/
                string at = BP.Sys.SystemConfig.AppCenterDBVarStr;
                Paras  ps = new BP.DA.Paras();
                ps.SQL = "SELECT FrmSln FROM WF_FrmNode WHERE FK_Node=" + at + "FK_Node AND FK_Flow=" + at + "FK_Flow AND FK_Frm=" + at + "FK_Frm";
                ps.Add("FK_Node", this.FK_Node);
                ps.Add("FK_Flow", this.FK_Flow);
                ps.Add("FK_Frm", this.FK_MapData);
                DataTable dt = DBAccess.RunSQLReturnTable(ps);
                if (dt.Rows.Count == 0)
                {
                    athDesc.RetrieveFromDBSources();
                }
                else
                {
                    int sln = int.Parse(dt.Rows[0][0].ToString());
                    if (sln == 0)
                    {
                        athDesc.RetrieveFromDBSources();
                    }
                    else
                    {
                        int result = athDesc.Retrieve(FrmAttachmentAttr.FK_MapData, this.FK_MapData,
                                                      FrmAttachmentAttr.FK_Node, this.FK_Node, FrmAttachmentAttr.NoOfObj, this.Ath);

                        if (result == 0) /*如果没有定义,就获取默认的.*/
                        {
                            athDesc.RetrieveFromDBSources();
                        }
                        //  throw new Exception("@该流程表单在该节点("+this.FK_Node+")使用的是自定义的权限控制,但是没有定义该附件的权限。");
                    }
                }
                #endregion 处理权限方案。
            }

            BP.Sys.FrmAttachmentDBs dbs = new BP.Sys.FrmAttachmentDBs();
            if (athDesc.HisCtrlWay == AthCtrlWay.PWorkID)
            {
                string pWorkID = BP.DA.DBAccess.RunSQLReturnValInt("SELECT PWorkID FROM WF_GenerWorkFlow WHERE WorkID=" + this.PKVal, 0).ToString();
                if (pWorkID == null || pWorkID == "0")
                {
                    pWorkID = this.PKVal;
                }

                if (athDesc.AthUploadWay == AthUploadWay.Inherit)
                {
                    /* 继承模式 */
                    BP.En.QueryObject qo = new BP.En.QueryObject(dbs);
                    qo.AddWhere(FrmAttachmentDBAttr.RefPKVal, pWorkID);
                    qo.addOr();
                    qo.AddWhere(FrmAttachmentDBAttr.RefPKVal, int.Parse(this.PKVal));
                    qo.addOrderBy("RDT");
                    qo.DoQuery();
                }

                if (athDesc.AthUploadWay == AthUploadWay.Interwork)
                {
                    /*共享模式*/
                    dbs.Retrieve(FrmAttachmentDBAttr.RefPKVal, pWorkID);
                }
            }
            else
            {
                int num = dbs.Retrieve(FrmAttachmentDBAttr.FK_FrmAttachment, this.FK_FrmAttachment,
                                       FrmAttachmentDBAttr.RefPKVal, this.PKVal, "RDT");
                if (num == 0 && this.IsCC == "1")
                {
                    CCList cc  = new CCList();
                    int    nnn = cc.Retrieve(CCListAttr.FK_Node, this.FK_Node, CCListAttr.WorkID, this.WorkID, CCListAttr.CCTo, WebUser.No);
                    if (cc.NDFrom != 0)
                    {
                        this._fk_node = cc.NDFrom;

                        dbs.Retrieve(FrmAttachmentDBAttr.FK_FrmAttachment, this.FK_FrmAttachmentExt,
                                     FrmAttachmentDBAttr.FK_MapData, "ND" + cc.NDFrom, FrmAttachmentDBAttr.RefPKVal, this.WorkID.ToString());

                        //重新设置文件描述。
                        athDesc.Retrieve(FrmAttachmentAttr.FK_MapData, this.FK_MapData, FrmAttachmentAttr.NoOfObj, "DocMultiAth");
                    }
                }
            }

            #endregion 处理权限控制.

            #region 生成表头表体.
            this.Title = athDesc.Name;

            #region 如果图片显示.
            if (athDesc.FileShowWay == FileShowWay.Pict)
            {
                /* 如果是图片轮播,就在这里根据数据输出轮播的html代码.*/
                if (dbs.Count == 0 && athDesc.IsUpload == true)
                {
                    /*没有数据并且,可以上传,就转到上传的界面上去.*/
                    this.Response.Redirect("AttachmentUploadImg.aspx?1=1" + this.RequestParas, true);
                    return;
                }

                if (dbs.Count != 0)
                {
                    /*有数据,就输出.*/
                    this.Pub1.Add("<div class='slideBox' id='" + athDesc.MyPK + "' style='width:" + athDesc.W + "px;height:" + athDesc.H + "px; position:relative;  overflow:hidden;'>");
                    this.Pub1.Add("<ul class='items'> ");
                    foreach (FrmAttachmentDB db in dbs)
                    {
                        if (BP.DA.DataType.IsImgExt(db.FileExts) == false)
                        {
                            continue;
                        }
                        if (athDesc.IsDelete != false)
                        {
                            if (athDesc.IsDelete == true)
                            {
                                this.Pub1.Add("<li> <a  title='" + db.MyNote + "'><img src = '" + db.FileFullName + "' width=" + athDesc.W + " height=" + athDesc.H + "/></a> | <a href=\"javascript:Del('" + this.FK_FrmAttachment + "','" + this.PKVal + "','" + db.MyPK + "')\">删除</a></li>");
                            }
                            else if (athDesc.IsDeleteInt == 2)
                            {
                                if (db.Rec.Equals(WebUser.No))
                                {
                                    this.Pub1.Add("<li> <a  title='" + db.MyNote + "'><img src = '" + db.FileFullName + "' width=" + athDesc.W + " height=" + athDesc.H + "/></a> | <a href=\"javascript:Del('" + this.FK_FrmAttachment + "','" + this.PKVal + "','" + db.MyPK + "')\">删除</a></li>");
                                }
                            }
                            else
                            {
                                this.Pub1.Add("<li> <a  title='" + db.MyNote + "'><img src = '" + db.FileFullName + "' width=" + athDesc.W + " height=" + athDesc.H + "/></a> </li>");
                            }
                        }
                        else
                        {
                            this.Pub1.Add("<li> <a  title='" + db.MyNote + "'><img src = '" + db.FileFullName + "' width=" + athDesc.W + " height=" + athDesc.H + "/></a> </li>");
                        }
                    }
                    this.Pub1.Add("</ul>");
                    this.Pub1.Add("</div>");
                    this.Pub1.Add("<script>$(function(){$('#" + athDesc.MyPK + "').slideBox({duration : 0.3,easing : 'linear',delay : 5,hideClickBar : false,clickBarRadius : 10});})</script>");
                }

                if (athDesc.IsUpload == true)
                {
                    /*可以上传,就显示上传的按钮.. */
                    this.Pub1.Add("<a href='AttachmentUploadImg.aspx?1=1" + this.RequestParas + "' >上传</a>");
                }
                return;
            }
            #endregion 如果图片显示.


            float athWidth = athDesc.W - 20;
            // 执行装载模版.
            if (dbs.Count == 0 && athDesc.IsWoEnableTemplete == true)
            {
                /*如果数量为0,就检查一下是否有模版如果有就加载模版文件.*/
                string templetePath = BP.Sys.SystemConfig.PathOfDataUser + "AthTemplete\\" + athDesc.NoOfObj.Trim();
                if (Directory.Exists(templetePath) == false)
                {
                    Directory.CreateDirectory(templetePath);
                }

                /*有模版文件夹*/
                DirectoryInfo mydir = new DirectoryInfo(templetePath);
                FileInfo[]    fls   = mydir.GetFiles();
                if (fls.Length == 0)
                {
                    throw new Exception("@流程设计错误,该多附件启用了模版组件,模版目录:" + templetePath + "里没有模版文件.");
                }

                foreach (FileInfo fl in fls)
                {
                    if (System.IO.Directory.Exists(athDesc.SaveTo) == false)
                    {
                        System.IO.Directory.CreateDirectory(athDesc.SaveTo);
                    }

                    int    oid    = BP.DA.DBAccess.GenerOID();
                    string saveTo = athDesc.SaveTo + "\\" + oid + "." + fl.Name.Substring(fl.Name.LastIndexOf('.') + 1);
                    if (saveTo.Contains("@") == true || saveTo.Contains("*") == true)
                    {
                        /*如果有变量*/
                        saveTo = saveTo.Replace("*", "@");
                        if (saveTo.Contains("@") && this.FK_Node != null)
                        {
                            /*如果包含 @ */
                            BP.WF.Flow       flow = new BP.WF.Flow(this.FK_Flow);
                            BP.WF.Data.GERpt myen = flow.HisGERpt;
                            myen.OID = this.WorkID;
                            myen.RetrieveFromDBSources();
                            saveTo = BP.WF.Glo.DealExp(saveTo, myen, null);
                        }
                        if (saveTo.Contains("@") == true)
                        {
                            throw new Exception("@路径配置错误,变量没有被正确的替换下来." + saveTo);
                        }
                    }
                    fl.CopyTo(saveTo);

                    FileInfo        info     = new FileInfo(saveTo);
                    FrmAttachmentDB dbUpload = new FrmAttachmentDB();

                    dbUpload.CheckPhysicsTable();
                    dbUpload.MyPK             = athDesc.FK_MapData + oid.ToString();
                    dbUpload.NodeID           = FK_Node.ToString();
                    dbUpload.FK_FrmAttachment = this.FK_FrmAttachment;

                    if (athDesc.AthUploadWay == AthUploadWay.Inherit)
                    {
                        /*如果是继承,就让他保持本地的PK. */
                        dbUpload.RefPKVal = this.PKVal.ToString();
                    }

                    if (athDesc.AthUploadWay == AthUploadWay.Interwork)
                    {
                        /*如果是协同,就让他是PWorkID. */
                        string pWorkID = BP.DA.DBAccess.RunSQLReturnValInt("SELECT PWorkID FROM WF_GenerWorkFlow WHERE WorkID=" + this.PKVal, 0).ToString();
                        if (pWorkID == null || pWorkID == "0")
                        {
                            pWorkID = this.PKVal;
                        }
                        dbUpload.RefPKVal = pWorkID;
                    }

                    dbUpload.FK_MapData       = athDesc.FK_MapData;
                    dbUpload.FK_FrmAttachment = this.FK_FrmAttachment;

                    dbUpload.FileExts     = info.Extension;
                    dbUpload.FileFullName = saveTo;
                    dbUpload.FileName     = fl.Name;
                    dbUpload.FileSize     = (float)info.Length;

                    dbUpload.RDT     = DataType.CurrentDataTime;
                    dbUpload.Rec     = BP.Web.WebUser.No;
                    dbUpload.RecName = BP.Web.WebUser.Name;
                    //if (athDesc.IsNote)
                    //    dbUpload.MyNote = this.Pub1.GetTextBoxByID("TB_Note").Text;
                    //if (athDesc.Sort.Contains(","))
                    //    dbUpload.Sort = this.Pub1.GetDDLByID("ddl").SelectedItemStringVal;

                    dbUpload.Insert();

                    dbs.AddEntity(dbUpload);
                }
                //BP.Sys.FrmAttachmentDBs dbs = new BP.Sys.FrmAttachmentDBs();
            }

            #region 处理权限问题.
            // 处理权限问题, 有可能当前节点是可以上传或者删除,但是当前节点上不能让此人执行工作。
            bool isDel    = athDesc.IsDeleteInt == 0 ? false : true;
            bool isUpdate = athDesc.IsUpload;
            if (isDel == true || isUpdate == true)
            {
                if (this.WorkID != 0 &&
                    string.IsNullOrEmpty(this.FK_Flow) == false &&
                    this.FK_Node != 0)
                {
                    isDel = BP.WF.Dev2Interface.Flow_IsCanDoCurrentWork(this.FK_Flow, this.FK_Node, this.WorkID, WebUser.No);
                    if (isDel == false)
                    {
                        isUpdate = false;
                    }
                }
            }
            #endregion 处理权限问题.

            if (athDesc.FileShowWay == FileShowWay.Free)
            {
                this.Pub1.AddTable("border='0' cellspacing='0' cellpadding='0' style='width:" + athWidth + "px'");
                foreach (FrmAttachmentDB db in dbs)
                {
                    this.Pub1.AddTR();
                    if (CanEditor(db.FileExts))
                    {
                        if (athDesc.IsWoEnableWF)
                        {
                            this.Pub1.AddTD("<a href=\"javascript:OpenOfiice('" + this.FK_FrmAttachment + "','" +
                                            this.WorkID + "','" + db.MyPK + "','" + this.FK_MapData + "','" + this.Ath +
                                            "','" + this.FK_Node + "')\"><img src='../Img/FileType/" + db.FileExts + ".gif' border=0 onerror=\"src='../Img/FileType/Undefined.gif'\" />" + db.FileName + "</a>");
                        }
                        else
                        {
                            this.Pub1.AddTD("<a href=\"javascript:OpenView('" + this.PKVal + "','" + db.MyPK +
                                            "')\"><img src='../Img/FileType/" + db.FileExts + ".gif' border=0 onerror=\"src='../Img/FileType/Undefined.gif'\" />" + db.FileName + "</a>");
                        }
                    }
                    else if (DataType.IsImgExt(db.FileExts) || db.FileExts.ToUpper() == "PDF" || db.FileExts.ToUpper() == "CEB")
                    {
                        this.Pub1.AddTD("<a href=\"javascript:OpenView('" + this.PKVal + "','" + db.MyPK +
                                        "')\"><img src='../Img/FileType/" + db.FileExts + ".gif' border=0 onerror=\"src='../Img/FileType/Undefined.gif'\" />" + db.FileName + "</a>");
                    }
                    else
                    {
                        this.Pub1.AddTD("<a href='AttachmentUpload.aspx?DoType=Down&MyPK=" + db.MyPK +
                                        "' target=_blank ><img src='../Img/FileType/" + db.FileExts + ".gif' border=0 onerror=\"src='../Img/FileType/Undefined.gif'\" />" + db.FileName + "</a>");
                    }

                    if (athDesc.IsDownload)
                    {
                        this.Pub1.AddTD("<a href=\"javascript:Down('" + this.FK_FrmAttachment + "','" + this.PKVal + "','" + db.MyPK + "')\">下载</a>");
                    }
                    else
                    {
                        this.Pub1.AddTD("");
                    }

                    if (this.IsReadonly != "1")
                    {
                        if (athDesc.IsDelete != false)
                        {
                            if (athDesc.IsDelete == true)
                            {
                                this.Pub1.AddTD("style='border:0px'", "<a href=\"javascript:Del('" + this.FK_FrmAttachment + "','" + this.PKVal + "','" + db.MyPK + "')\">删除</a>");
                            }
                            else if (athDesc.IsDeleteInt == 2)
                            {
                                if (db.Rec.Equals(WebUser.No))
                                {
                                    this.Pub1.AddTD("style='border:0px'", "<a href=\"javascript:Del('" + this.FK_FrmAttachment + "','" + this.PKVal + "','" + db.MyPK + "')\">删除</a>");
                                }
                            }
                            else
                            {
                                this.Pub1.AddTD("");
                            }
                        }
                        else
                        {
                            this.Pub1.AddTD("");
                        }
                    }
                    else
                    {
                        this.Pub1.AddTD("");
                        this.Pub1.AddTD("");
                    }

                    this.Pub1.AddTREnd();
                }
                AddFileUpload(isUpdate, athDesc);
                this.Pub1.AddTableEnd();
                return;
            }

            this.Pub1.AddTable("border='0' cellspacing='0' cellpadding='0' style='width:" + athWidth + "px'");
            if (athDesc.IsShowTitle == true)
            {
                this.Pub1.AddTR("style='border:0px'");

                this.Pub1.AddTDTitleExt("序号");
                if (athDesc.Sort.Contains(","))
                {
                    this.Pub1.AddTD("style='background:#f4f4f4; font-size:12px; padding:3px;'", "类别");
                }
                this.Pub1.AddTDTitleExt("文件名");
                this.Pub1.AddTDTitleExt("大小KB");
                this.Pub1.AddTDTitleExt("上传时间");
                this.Pub1.AddTDTitleExt("上传人");
                this.Pub1.AddTDTitleExt("操作");
                this.Pub1.AddTREnd();
            }

            int           i       = 0;
            StringBuilder picHtml = new StringBuilder();
            foreach (FrmAttachmentDB db in dbs)
            {
                i++;
                this.Pub1.AddTR();
                this.Pub1.AddTDIdx(i);
                if (athDesc.Sort.Contains(","))
                {
                    this.Pub1.AddTD(db.Sort);
                }

                // this.Pub1.AddTDIdx(i++);
                if (athDesc.IsDownload)
                {
                    if (athDesc.IsWoEnableWF && CanEditor(db.FileExts))
                    {
                        this.Pub1.AddTD("<a href=\"javascript:OpenOfiice('" + this.FK_FrmAttachment + "','" + this.WorkID + "','" + db.MyPK + "','" + this.FK_MapData + "','" + this.Ath + "','" + this.FK_Node + "')\"><img src='../Img/FileType/" + db.FileExts + ".gif' border=0 onerror=\"src='../Img/FileType/Undefined.gif'\" />" + db.FileName + "</a>");
                    }
                    else if (db.FileExts.ToUpper() == "TXT" || db.FileExts.ToUpper() == "JPG" || db.FileExts.ToUpper() == "JPEG" || db.FileExts.ToUpper() == "GIF" || db.FileExts.ToUpper() == "PNG" || db.FileExts.ToUpper() == "BMP" || db.FileExts.ToUpper() == "PDF" || db.FileExts.ToUpper() == "CEB")
                    {
                        this.Pub1.AddTD("<a href=\"javascript:OpenView('" + this.PKVal + "','" + db.MyPK + "')\"><img src='../Img/FileType/" + db.FileExts + ".gif' border=0 onerror=\"src='../Img/FileType/Undefined.gif'\" />" + db.FileName + "</a>");
                    }
                    else
                    {
                        this.Pub1.AddTD("<a href='AttachmentUpload.aspx?DoType=Down&MyPK=" + db.MyPK + "' target=_blank ><img src='../Img/FileType/" + db.FileExts + ".gif' border=0 onerror=\"src='../Img/FileType/Undefined.gif'\" />" + db.FileName + "</a>");
                    }
                }
                else
                {
                    this.Pub1.AddTD("<img src='../Img/FileType/" + db.FileExts + ".gif' border=0 onerror=\"src='../Img/FileType/Undefined.gif'\" />" + db.FileName);
                }

                this.Pub1.AddTD(db.FileSize);
                this.Pub1.AddTD(db.RDT);
                this.Pub1.AddTD(db.RecName);

                //输出操作部分.
                this.Pub1.AddTDBegin();
                if (athDesc.IsDownload)
                {
                    this.Pub1.Add("<a href=\"javascript:Down('" + this.FK_FrmAttachment + "','" + this.PKVal + "','" + db.MyPK + "')\">下载</a>");
                }
                if (this.IsReadonly != "1")
                {
                    string op = null;
                    if (isDel == true)
                    {
                        if (athDesc.IsDelete == true)
                        {
                            op = "&nbsp;&nbsp;&nbsp;<a href=\"javascript:Del('" + this.FK_FrmAttachment + "','" + this.PKVal + "','" + db.MyPK + "')\">删除</a>";
                        }
                        else if (athDesc.IsDeleteInt == 2)
                        {
                            if (db.Rec.Equals(WebUser.No))
                            {
                                op = "&nbsp;&nbsp;&nbsp;<a href=\"javascript:Del('" + this.FK_FrmAttachment + "','" + this.PKVal + "','" + db.MyPK + "')\">删除</a>";
                            }
                        }
                    }

                    this.Pub1.Add(op);
                }
                this.Pub1.AddTDEnd();

                this.Pub1.AddTREnd();
            }
            if (i == 0)
            {
                this.Pub1.AddTR();
                this.Pub1.AddTD("0");
                if (athDesc.Sort.Contains(","))
                {
                    this.Pub1.AddTD("&nbsp&nbsp");
                }
                this.Pub1.AddTD("style='width:100px'", "<span style='color:red;' >上传附件</span>");
                this.Pub1.AddTD("&nbsp&nbsp");
                this.Pub1.AddTD("&nbsp&nbsp");
                this.Pub1.AddTD("&nbsp&nbsp");
                this.Pub1.AddTD("&nbsp&nbsp");
                this.Pub1.AddTREnd();
            }

            AddFileUpload(isUpdate, athDesc);
            this.Pub1.AddTableEnd();

            #endregion 生成表头表体.
        }
Example #14
0
        public static void Copy <T, TCopy>(CCList <T> fromArr, ref CCList <T> arr, TCopy copy) where TCopy : IArrayElementCopy <T>
        {
            if (fromArr == null)
            {
                if (arr != null)
                {
                    for (int i = 0; i < arr.Count; ++i)
                    {
                        copy.Recycle(arr[i]);
                    }
                    PoolCCList <T> .Recycle(ref arr);
                }

                arr = null;
                return;
            }

            if (arr != null)
            {
                for (int i = 0; i < arr.Count; ++i)
                {
                    copy.Recycle(arr[i]);
                }

                PoolCCList <T> .Recycle(ref arr);
            }

            arr = PoolCCList <T> .Spawn();

            arr.InitialCopyOf(fromArr);

            for (int i = 0; i < fromArr.array.Length; ++i)
            {
                if (fromArr.array[i] == null && arr.array[i] != null)
                {
                    for (int k = 0; k < arr.array[i].Length; ++k)
                    {
                        copy.Recycle(arr.array[i][k]);
                    }

                    PoolArray <T> .Release(ref arr.array[i]);
                }
                else if (fromArr.array[i] != null && arr.array[i] == null)
                {
                    arr.array[i] = PoolArray <T> .Claim(fromArr.array[i].Length);
                }
                else if (fromArr.array[i] == null && arr.array[i] == null)
                {
                    continue;
                }

                var cnt = fromArr.array[i].Length;
                for (int j = 0; j < cnt; ++j)
                {
                    copy.Copy(fromArr.array[i][j], ref arr.array[i][j]);
                }
            }

            /*
             * if (arr == null || fromArr.Count != arr.Count) {
             *
             *  if (arr != null) {
             *
             *      for (int i = 0; i < arr.Count; ++i) {
             *
             *          copy.Recycle(arr[i]);
             *
             *      }
             *
             *      PoolCCList<T>.Recycle(ref arr);
             *
             *  }
             *
             *  arr = PoolCCList<T>.Spawn();
             *  arr.InitialCopyOf(fromArr);
             *
             * }
             *
             * for (int i = 0; i < fromArr.array.Length; ++i) {
             *
             *  if (fromArr.array[i] == null && arr.array[i] != null) {
             *
             *      for (int k = 0; k < arr.array[i].Length; ++k) {
             *
             *          copy.Recycle(arr.array[i][k]);
             *
             *      }
             *
             *      PoolArray<T>.Release(ref arr.array[i]);
             *
             *  } else if (fromArr.array[i] != null && arr.array[i] == null) {
             *
             *      arr.array[i] = PoolArray<T>.Claim(fromArr.array[i].Length);
             *
             *  } else if (fromArr.array[i] == null && arr.array[i] == null) {
             *
             *      continue;
             *
             *  }
             *
             *  var cnt = fromArr.array[i].Length;
             *  for (int j = 0; j < cnt; ++j) {
             *
             *      copy.Copy(fromArr.array[i][j], ref arr.array[i][j]);
             *
             *  }
             *
             * }*/
        }
Example #15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //以下判断没发现起到什么作用
            if (BP.WF.Dev2Interface.Flow_IsCanViewTruck(this.FK_Flow, this.WorkID, this.FID) == false)
            {
                //string url = this.Request.RawUrl;
                ////url=url.Replace
                ////this.Response.Redirect(url,true);

                //string errorStr = "您没有权限查看该工作";
                //errorStr += "<br>1,您非该流程的处理人.";
                //errorStr += "<br>2, 您不与该流程发起人是同一个部门。";
                //return ;
            }

            if (this.DoType == "View")
            {
                this.BindTrack_ViewWork();
                return;
            }

            if (this.DoType == "ViewSpecialWork")
            {
                this.BindTrack_ViewSpecialWork();
                return;
            }


            //this.AddTable("class='Table' cellpadding='0' cellspacing='0' border='0' style='width: 100%'");
            //this.AddTR();
            //this.AddTDGroupTitle("style='text-align:center'", "序");
            //this.AddTDGroupTitle("操作时间");
            //this.AddTDGroupTitle("表单"); //moved by liuxc,2014-12-18,应zhangqingpeng要求将此列提前
            //this.AddTDGroupTitle("从节点");
            //this.AddTDGroupTitle("人员");
            //this.AddTDGroupTitle("到节点");
            //this.AddTDGroupTitle("人员");
            //this.AddTDGroupTitle("到达时间");
            //this.AddTDGroupTitle("用时");
            //this.AddTDGroupTitle("活动");
            //this.AddTDGroupTitle("信息");
            //this.AddTDGroupTitle("执行人");
            //this.AddTREnd();

            //获取track.
            DataTable dt = BP.WF.Dev2Interface.DB_GenerTrack(this.FK_Flow, this.WorkID, this.FID).Tables["Track"];
            DataView  dv = dt.DefaultView;

            dv.Sort = "RDT";

            GenerWorkFlow gwf = new GenerWorkFlow();

            gwf.WorkID = this.WorkID;
            gwf.RetrieveFromDBSources();

            string currNodeID = "0";

            if (gwf.WFState != WFState.Complete)
            {
                currNodeID = gwf.FK_Node.ToString(); //获得当前运行到的节点如果流程完成则为O.
            }
            int    idx      = 1;
            string checkStr = "";

            #region    qin   改成时间轴的显示方式 15/7/15   如果不需要这种显示方式
            string str = "";//拼接字符串
            str += "<div style='width: 100%;height:400px;'><div class='content'>";
            str += "<div class='wrapper'>";
            str += "<div class='main'>";

            str += "<h1 class='title'>";
            str += "流程日志</h1>";
            str += "<div class='year'>";
            str += "<h2>";
            str += "<a href='#'>&nbsp;&nbsp;时间轴<i></i></a></h2>";
            str += "<div class='list'>";
            str += "<ul>";
            #endregion qin   改成时间轴的显示方式 15/7/15

            #region 开始循环添加数据
            foreach (DataRowView dr in dv)
            {
                Int64 fid = int.Parse(dr["FID"].ToString());
                if (fid != 0)
                {
                    continue;
                }

                ActionType at = (ActionType)int.Parse(dr[TrackAttr.ActionType].ToString());

                //如果是协作发送,就不输出他. edit 2016.02.20 .
                if (at == ActionType.TeampUp)
                {
                    continue;
                }

                // 记录审核节点。
                if (at == ActionType.WorkCheck)
                {
                    checkStr = dr[TrackAttr.NDFrom].ToString(); //记录当前的审核节点id.
                }
                //审核信息过滤,
                if (at == ActionType.WorkCheck)
                {
                    if (currNodeID == checkStr)
                    {
                        continue;
                    }
                    //如果当前节点与审核信息节点一致,就说明当前人员的审核意见已经保存,但是工作还没有发送,就不让他显示。
                }

                if (at == ActionType.Forward)
                {
                    if (checkStr == dr[TrackAttr.NDFrom].ToString())
                    {
                        continue;
                    }
                }
                str += "<li  class='cls highlight' style=\"background: url('../../Img/Action/" + at.ToString() + ".png') no-repeat 235px 31px\">";
                //this.AddTR();
                //this.AddTDIdx(idx);

                DateTime dtt = DataType.ParseSysDateTime2DateTime(dr[TrackAttr.RDT].ToString());

                // this.AddTD(dtt.ToString("yy年MM月dd日HH:mm"));</br>
                str += "<p class='date'>" + dtt.ToString("yy年MM月dd日") + " " + dtt.ToString("hh时mm分");
                str += "</br>" + BP.DA.DataType.GetWeek((int)dtt.DayOfWeek);
                str += "</br>" + BP.WF.Glo.GenerUserImgHtml(dr[TrackAttr.EmpFrom].ToString(), dr[TrackAttr.EmpFromT].ToString()) + "</p>";
                str += "<p class='intro'>" + dr[TrackAttr.NDFromT].ToString() + "</p>";

                str += "<div class='more'>";

                if (at == ActionType.Forward || at == ActionType.ForwardAskfor || at == ActionType.WorkCheck || at == ActionType.Order ||
                    at == ActionType.FlowOver || //added by liuxc,2014-12-3,正常结束结点也显示表单
                    at == ActionType.Skip)       //added by liuxc,2015-7-13,自动跳转的也显示表单
                {
                    //this.AddTD("<a class='easyui-linkbutton' data-options=\"iconCls:'icon-sheet'\" href=\"javascript:WinOpen('" + BP.WF.Glo.CCFlowAppPath + "WF/WFRpt.aspx?WorkID=" + dr[TrackAttr.WorkID].ToString() + "&FK_Flow=" + this.FK_Flow + "&FK_Node=" + dr[TrackAttr.NDFrom].ToString() + "&DoType=View&MyPK=" + dr[TrackAttr.MyPK].ToString() + "','" + dr[TrackAttr.MyPK].ToString() + "');\">表单</a>");
                    str += "<p><a class='easyui-linkbutton' data-options=\"iconCls:'icon-sheet'\" href=\"javascript:WinOpen('" + BP.WF.Glo.CCFlowAppPath + "WF/WFRpt.aspx?WorkID=" + dr[TrackAttr.WorkID].ToString() + "&FK_Flow=" + this.FK_Flow + "&FK_Node=" + dr[TrackAttr.NDFrom].ToString() + "&DoType=View&MyPK=" + dr[TrackAttr.MyPK].ToString() + "','" + dr[TrackAttr.MyPK].ToString() + "');\">打开<img src='../../Img/Form.png'>表单</a>" + "</p>";
                }

                if (at == ActionType.FlowOver ||
                    at == ActionType.CC ||
                    at == ActionType.UnSend)
                {
                    str += "<p></p>";
                    str += "<p></p>";
                }
                else
                {
                    str += "<p>发送到节点:" + dr[TrackAttr.NDToT].ToString() + "</p>";
                }

                //增加两列,到达时间、用时 added by liuxc,2014-12-4
                if (idx > 1)
                {
                    var toTime = Convert.ToDateTime(dv[idx - 1 - 1][TrackAttr.RDT].ToString());
                    str += "<p>到达时间:" + toTime.ToString("yy年MM月dd日HH:mm") + " 用时:" + DataType.GetSpanTime(toTime, dtt) + "</p>";
                }

                // 删除信息.
                string tag = dr[TrackAttr.Tag].ToString();
                if (tag != null)
                {
                    tag = tag.Replace("~", "'");
                }

                string msg = DataType.ParseText2Html(dr[TrackAttr.Msg].ToString());
                switch (at)
                {
                case ActionType.CallChildenFlow:     //被调用父流程吊起。
                    if (string.IsNullOrEmpty(tag) == false)
                    {
                        AtPara        ap    = new AtPara(tag);
                        GenerWorkFlow mygwf = new GenerWorkFlow();
                        mygwf.WorkID = ap.GetValInt64ByKey("PWorkID");
                        if (mygwf.RetrieveFromDBSources() == 1)
                        {
                            msg = "<p>操作员:{" + dr[TrackAttr.EmpFromT].ToString() + "}在当前节点上,被父流程{" + mygwf.FlowName + "},<a target=b" + ap.GetValStrByKey("PWorkID") + " href='Track.aspx?WorkID=" + ap.GetValStrByKey("PWorkID") + "&FK_Flow=" + ap.GetValStrByKey("PFlowNo") + "' >" + msg + "</a></p>";
                        }
                        else
                        {
                            msg = "<p>操作员:{" + dr[TrackAttr.EmpFromT].ToString() + "}在当前节点上,被父流程调用{" + mygwf.FlowName + "},但是该流程被删除了.</p>" + tag;
                        }

                        msg = "<a target=b" + ap.GetValStrByKey("PWorkID") + " href='Track.aspx?WorkID=" + ap.GetValStrByKey("PWorkID") + "&FK_Flow=" + ap.GetValStrByKey("PFlowNo") + "' >" + msg + "</a>";
                    }
                    break;

                case ActionType.StartChildenFlow:     //吊起子流程。
                    if (string.IsNullOrEmpty(tag) == false)
                    {
                        if (tag.Contains("Sub"))
                        {
                            tag = tag.Replace("Sub", "C");
                        }

                        AtPara        ap    = new AtPara(tag);
                        GenerWorkFlow mygwf = new GenerWorkFlow();
                        mygwf.WorkID = ap.GetValInt64ByKey("CWorkID");
                        if (mygwf.RetrieveFromDBSources() == 1)
                        {
                            msg  = "<p>操作员:{" + dr[TrackAttr.EmpFromT].ToString() + "}在当前节点上调用了子流程{" + mygwf.FlowName + "}, <a target=b" + ap.GetValStrByKey("CWorkID") + " href='Track.aspx?WorkID=" + ap.GetValStrByKey("CWorkID") + "&FK_Flow=" + ap.GetValStrByKey("CFlowNo") + "' >" + msg + "</a></p>";
                            msg += "<p>当前子流程状态:{" + mygwf.WFStateText + "},运转到:{" + mygwf.NodeName + "},最后处理人{" + mygwf.TodoEmps + "},最后处理时间{" + mygwf.RDT + "}。</p>";
                        }
                        else
                        {
                            msg = "<p>操作员:{" + dr[TrackAttr.EmpFromT].ToString() + "}在当前节点上调用了子流程{" + mygwf.FlowName + "},但是该流程被删除了.</p>" + tag;
                        }
                    }
                    break;

                default:
                    break;
                }

                msg = msg.Replace("\"", "");

                str += "<p>" + msg + "</p>";
                str += "</div>";
                str += "</li>";
                idx++;
            }

            //判断当前工作是否完成,如果没有完成,就输出当前人员的待办信息 ,读取信息。

            if (gwf.WFState == WFState.Runing)
            {
                GenerWorkerLists gwls = new GenerWorkerLists(gwf.WorkID, gwf.FK_Node);
                Node             nd   = new Node(gwf.FK_Node);

                str += "<li  class='cls highlight' style=\"background: url('../../Img/Action/Todolist.png') no-repeat 235px 31px\" >";

                str += "<BR><BR><p class='date'>流程运行到: " + gwf.NodeName + "。";

                if (gwf.TodoEmpsNum == 1)
                {
                    string myemp = gwf.TodoEmps;
                    myemp = myemp.Replace("(", "");
                    myemp = myemp.Replace(")", "");
                    string[] strs = myemp.Split(',');
                    str += "<br>" + BP.WF.Glo.GenerUserImgHtml(strs[0], strs[1]) + "。</p>";
                }
                else
                {
                    //   str += "<br>处理人员:(" + gwf.TodoEmps + ")计(" + gwf.TodoEmpsNum + ")个,。</p>";
                }

                str += "<div></div><br><br>";
                if (nd.HisNodeWorkType == NodeWorkType.WorkFL ||
                    nd.HisNodeWorkType == NodeWorkType.StartWorkFL ||
                    nd.HisNodeWorkType == NodeWorkType.WorkFHL)
                {
                    str += "<div><ul>";
                    foreach (GenerWorkerList item in gwls)
                    {
                        if (gwls.Count == 0 ||
                            nd.TodolistModel == TodolistModel.QiangBan ||
                            nd.TodolistModel == TodolistModel.Sharing)
                        {
                            if (item.IsRead == false)
                            {
                                str += "<li><img src='../../Img/Dot.png' width='8px' >处理人:" + BP.WF.Glo.DealUserInfoShowModel(item.FK_Emp, item.FK_EmpText) + "&nbsp;&nbsp; <font style='color:#FFFFFF; background-color:#00CC66' >未读</font></li>";
                            }
                            else
                            {
                                str += "<li><img src='../../Img/Dot.png' width='8px' >处理人:" + BP.WF.Glo.DealUserInfoShowModel(item.FK_Emp, item.FK_EmpText) + "&nbsp;&nbsp;<font style='color:#FFFFFF; background-color:#FF9966' ><strong>已读</strong></font></li>";
                            }
                            break;
                        }

                        switch (nd.TodolistModel)
                        {
                        case TodolistModel.QiangBan:
                            str += "<li><img src='../../Img/Dot.png' width='8px' >处理人:" + BP.WF.Glo.DealUserInfoShowModel(item.FK_Emp, item.FK_EmpText) + "&nbsp;&nbsp;<font style='color:#FFFFFF; background-color:#FF9966' ><strong>已读</strong></font></li>";
                            break;

                        case TodolistModel.Order:
                            if (item.IsPassInt == 1)
                            {
                                str += "<li><img src='../../Img/Dot.png' width='8px' >处理人:" + BP.WF.Glo.DealUserInfoShowModel(item.FK_Emp, item.FK_EmpText) + "&nbsp;&nbsp;<font style='color:#FFFFFF; background-color:#FF9966' ><strong>已处理</strong></font></li>";
                            }
                            else
                            {
                                if (item.IsRead == false)
                                {
                                    str += "<li><img src='../../Img/Dot.png' width='8px' >处理人:" + BP.WF.Glo.DealUserInfoShowModel(item.FK_Emp, item.FK_EmpText) + "&nbsp;&nbsp; <font style='color:#FFFFFF; background-color:#00CC66' >未读</font></li>";
                                }
                                else
                                {
                                    str += "<li><img src='../../Img/Dot.png' width='8px' >处理人:" + BP.WF.Glo.DealUserInfoShowModel(item.FK_Emp, item.FK_EmpText) + "&nbsp;&nbsp;<font style='color:#FFFFFF; background-color:#FF9966' ><strong>已读</strong></font></li>";
                                }
                            }
                            break;

                        case TodolistModel.Sharing:
                            str += "<li><img src='../../Img/Dot.png' width='8px' >处理人:" + BP.WF.Glo.DealUserInfoShowModel(item.FK_Emp, item.FK_EmpText) + "&nbsp;&nbsp;<font style='color:#FFFFFF; background-color:#FF9966' ><strong>已读</strong></font></li>";
                            break;

                        case TodolistModel.Teamup:
                            if (item.IsPassInt == 1)
                            {
                                str += "<li><img src='../../Img/Dot.png' width='8px' >处理人:" + BP.WF.Glo.DealUserInfoShowModel(item.FK_Emp, item.FK_EmpText) + "&nbsp;&nbsp;<font style='color:#FFFFFF; background-color:#999966' ><strong>已处理</strong></font></li>";
                            }
                            else
                            {
                                if (item.IsRead == false)
                                {
                                    str += "<li><img src='../../Img/Dot.png' width='8px' >处理人:" + BP.WF.Glo.DealUserInfoShowModel(item.FK_Emp, item.FK_EmpText) + "&nbsp;&nbsp; <font style='color:#FFFFFF; background-color:#00CC66' >未读</font></li>";
                                }
                                else
                                {
                                    str += "<li><img src='../../Img/Dot.png' width='8px' >处理人:" + BP.WF.Glo.DealUserInfoShowModel(item.FK_Emp, item.FK_EmpText) + "&nbsp;&nbsp;<font style='color:#FFFFFF; background-color:#FF9966' ><strong>已读</strong></font></li>";
                                }
                            }
                            break;

                        default:
                            break;
                        }
                    }
                }

                str += "</ul>";
                str += "</div>";

                str += "<br>";
                str += "<br>";
                str += "<br>";
                str += "<br>";
                str += "<br>";
                str += "<br>";
                str += "<br>";

                str += "</li>";


                ///* 运行中的状态. */
                //str += "<li>";
                //str += "<table>";
                //str += "<caption>当前节点信息</caption>";
                //str += "<tr>";
                //str += "<th>停留节点</th>";
                //str += "<th>处理人</th>";
                //str += "<th>是否读取?</th>";
                //str += "</tr>";
                //foreach (GenerWorkerList item in gwls)
                //{
                //    str += "<tr>";
                //    str += "<td>" + item.FK_NodeText + "</td>";
                //    str += "<td>" + item.FK_EmpText + "</td>";
                //    if (item.IsRead)
                //        str += "<td>已读</td>";
                //    else
                //        str += "<td>未读</td>";
                //    str += "</tr>";
                //}
                //str += "</table>";
                //str += "</li>";
            }

            //结束循环.
            //this.AddTableEnd();
            #endregion

            if (this.CCID != null)
            {
                CCList cl = new CCList();
                cl.MyPK = this.CCID;
                cl.RetrieveFromDBSources();
                // this.AddFieldSet(cl.Title);
                // this.Add("抄送人:" + cl.Rec + ", 抄送日期:" + cl.RDT);
                // this.AddHR();
                // this.Add(cl.DocHtml);
                // this.AddFieldSetEnd();
                str += "<li  class='cls highlight' style=\"background: url('./Img/Action/circle.png') no-repeat 235px 31px\">";
                str += "<p class='date'>&nbsp;</p>";
                str += "<p class='intro'>" + cl.Title + "</p>";
                str += "<p class='version'>&nbsp;</p>";
                str += "<div class='more'>";
                str += "<p>抄送人:" + cl.Rec + "</p>";
                str += "<p>抄送日期:" + cl.RDT + "</p>";
                str += "</div>";
                str += "</li>";
                if (cl.HisSta == CCSta.UnRead)
                {
                    cl.HisSta = CCSta.Read;
                    cl.Update();
                }
            }

            str += "</ul>";
            str += "</div>";
            str += "</div>";
            str += "</div>";
            str += "</div>";
            str += "</div>";
            str += "</div>";
            //this.Clear();
            HiddenField1.Value = str.ToString();
        }
Example #16
0
        public void TableMode()
        {
            this.Pub2.AddTable();
            this.Pub2.AddTR();
            this.Pub2.AddTDTitle("IDX");
            this.Pub2.AddTDTitle("日期时间");
            this.Pub2.AddTDTitle("从节点");
            this.Pub2.AddTDTitle("人员");
            this.Pub2.AddTDTitle("到节点");
            this.Pub2.AddTDTitle("人员");
            this.Pub2.AddTDTitle("活动");
            this.Pub2.AddTDTitle("信息");
            this.Pub2.AddTDTitle("表单");
            this.Pub2.AddTDTitle("执行人");
            this.Pub2.AddTREnd();

            string sqlOfWhere1 = "";

            string dbStr = BP.Sys.SystemConfig.AppCenterDBVarStr;
            Paras  prs   = new Paras();

            if (this.FID == 0)
            {
                sqlOfWhere1 = " WHERE (FID=" + dbStr + "WorkID11 OR WorkID=" + dbStr + "WorkID12 )  ";
                prs.Add("WorkID11", this.WorkID);
                prs.Add("WorkID12", this.WorkID);
            }
            else
            {
                sqlOfWhere1 = " WHERE (FID=" + dbStr + "FID11 OR WorkID=" + dbStr + "FID12 ) ";
                prs.Add("FID11", this.FID);
                prs.Add("FID12", this.FID);
            }

            string sql = "";

            sql     = "SELECT MyPK,ActionType,ActionTypeText,FID,WorkID,NDFrom,NDFromT,NDTo,NDToT,EmpFrom,EmpFromT,EmpTo,EmpToT,RDT,WorkTimeSpan,Msg,NodeData,Exer,Tag FROM ND" + int.Parse(this.FK_Flow) + "Track " + sqlOfWhere1;
            prs.SQL = sql;
            DataTable dt = null;

            try
            {
                dt = DBAccess.RunSQLReturnTable(prs);
            }
            catch
            {
                // 处理track表.
                Track.CreateOrRepairTrackTable(this.FK_Flow);
                dt = DBAccess.RunSQLReturnTable(prs);
            }

            DataView dv = dt.DefaultView;

            dv.Sort = "RDT";

            int idx = 1;

            foreach (DataRowView dr in dv)
            {
                ActionType at = (ActionType)int.Parse(dr[TrackAttr.ActionType].ToString());
                if (at != ActionType.WorkCheck)
                {
                    continue;
                }

                this.Pub2.AddTR();
                this.Pub2.AddTDIdx(idx++);
                DateTime dtt = DataType.ParseSysDateTime2DateTime(dr[TrackAttr.RDT].ToString());
                this.Pub2.AddTD(dtt.ToString("yyyy年MM月dd日HH:mm"));

                this.Pub2.AddTD(dr[TrackAttr.NDFromT].ToString());


                this.Pub2.AddTD(dr[TrackAttr.EmpFromT].ToString());
                this.Pub2.AddTD(dr[TrackAttr.NDToT].ToString());
                this.Pub2.AddTD(dr[TrackAttr.EmpToT].ToString());

                this.Pub2.AddTD("<img src='../../Img/Action/" + at.ToString() + ".png' class='ActionType' border=0/>" + BP.WF.Track.GetActionTypeT(at));

                // 删除信息
                string tag = dr[TrackAttr.Tag].ToString();
                string msg = dr[TrackAttr.Msg].ToString();
                switch (at)
                {
                case ActionType.CallChildenFlow:     //被调用父流程吊起。
                    tag = dr[TrackAttr.Tag].ToString();
                    if (string.IsNullOrEmpty(tag) == false)
                    {
                        AtPara ap = new AtPara(tag);
                        this.Pub2.AddTD("class=TD", "<a target=b" + ap.GetValStrByKey("PWorkID") + " href='Track.aspx?WorkID=" + ap.GetValStrByKey("PWorkID") + "&FK_Flow=" + ap.GetValStrByKey("PFlowNo") + "' >" + msg + "</a>");
                    }
                    else
                    {
                        this.Pub2.AddTD("class=TD", msg);
                    }
                    break;

                case ActionType.StartChildenFlow:     //吊起子流程。
                    tag = dr[TrackAttr.Tag].ToString();
                    if (string.IsNullOrEmpty(tag) == false)
                    {
                        AtPara ap = new AtPara(tag);
                        this.Pub2.AddTD("class=TD", "<a target=b" + ap.GetValStrByKey("CWorkID") + " href='Track.aspx?WorkID=" + ap.GetValStrByKey("CWorkID") + "&FK_Flow=" + ap.GetValStrByKey("CFlowNo") + "' >" + msg + "</a>");
                    }
                    else
                    {
                        this.Pub2.AddTD("class=TD", msg);
                    }
                    break;

                default:
                    this.Pub2.AddTD(DataType.ParseText2Html(msg));
                    break;
                }

                this.Pub2.AddTD("<a href=\"javascript:WinOpen('" + BP.WF.Glo.CCFlowAppPath + "WF/WFRpt.aspx?WorkID=" + dr[TrackAttr.WorkID].ToString() + "&FK_Flow=" + this.FK_Flow + "&FK_Node=" + dr[TrackAttr.NDTo].ToString() + "&DoType=View&MyPK=" + dr[TrackAttr.MyPK].ToString() + "','" + dr[TrackAttr.MyPK].ToString() + "');\">表单</a>");
                this.Pub2.AddTD(dr[TrackAttr.Exer].ToString());
                this.Pub2.AddTREnd();
            }
            this.Pub2.AddTableEnd();

            if (this.CCID != null)
            {
                CCList cl = new CCList();
                cl.MyPK = this.CCID;
                cl.RetrieveFromDBSources();
                this.Pub2.AddFieldSet(cl.Title);
                this.Pub2.Add("抄送人:" + cl.Rec + ", 抄送日期:" + cl.RDT);
                this.Pub2.AddHR();
                this.Pub2.Add(cl.DocHtml);
                this.Pub2.AddFieldSetEnd();
                if (cl.HisSta == CCSta.UnRead)
                {
                    cl.HisSta = CCSta.Read;
                    cl.Update();
                }
            }
        }
 public static void Recycle(ref CCList <TValue> dic)
 {
     Pools.current.PoolRecycle(ref dic);
 }