Example #1
0
        /// <summary>
        /// 执行线程.
        /// </summary>
        public void RunIt()
        {
            BP.WF.Flows fls = new BP.WF.Flows();
            fls.RetrieveAll();

            HisScanSta = ScanSta.Working;
            while (true)
            {
                System.Threading.Thread.Sleep(20000);
                while (this.HisScanSta == ScanSta.Pause)
                {
                    System.Threading.Thread.Sleep(3000);
                    if (this.checkBox1.Checked)
                    {
                        Console.Beep();
                    }
                }

                this.SetText("********************************");

                this.SetText("扫描触发式自动发起流程表......");
                this.DoTask();

                this.SetText("扫描定时发起流程....");
                this.DoAutuFlows(fls);

                this.SetText("扫描消息表....");
                this.DoSendMsg();

                //this.SetText("向CCIM里发送消息...");
                //this.DoSendMsgOfCCIM();

                if (DateTime.Now.Hour < 18 && DateTime.Now.Hour > 8)
                {
                    /* 在工作时间段才可以执行此调度。 */
                    string now = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
                    if (now.Contains(":13") || now.Contains(":33") || now.Contains(":53"))
                    {
                        this.SetText("检索自动节点任务....");
                        this.DoAutoNode();
                    }
                }

                System.Threading.Thread.Sleep(1000);
                switch (this.toolStripStatusLabel1.Text)
                {
                case "服务启动":
                    this.toolStripStatusLabel1.Text = "服务启动..";
                    break;

                case "服务启动..":
                    this.toolStripStatusLabel1.Text = "服务启动........";
                    break;

                case "服务启动....":
                    this.toolStripStatusLabel1.Text = "服务启动.............";
                    break;

                default:
                    this.toolStripStatusLabel1.Text = "服务启动";
                    break;
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            BP.WF.Flows fls = new BP.WF.Flows();
            fls.RetrieveAll();

            FlowSorts ens = new FlowSorts();

            ens.RetrieveAll();

            DataTable dt = BP.WF.Dev2Interface.DB_GenerCanStartFlowsOfDataTable(BP.Web.WebUser.No);

            int     cols      = 3; //定义显示列数 从0开始。
            decimal widthCell = 100 / cols;

            this.Pub1.AddTable("width=100% border=0");
            int  idx = -1;
            bool is1 = false;

            string timeKey = "s" + this.Session.SessionID + DateTime.Now.ToString("yyMMddHHmmss");

            foreach (FlowSort en in ens)
            {
                if (en.ParentNo == "0" ||
                    en.ParentNo == "" ||
                    en.No == "")
                {
                    continue;
                }

                idx++;
                if (idx == 0)
                {
                    is1 = this.Pub1.AddTR(is1);
                }

                this.Pub1.AddTDBegin("width='" + widthCell + "%' border=0 valign=top");
                //输出类别.
                //this.Pub1.AddFieldSet(en.Name);
                this.Pub1.AddB(en.Name);
                this.Pub1.AddUL();

                #region 输出流程。
                foreach (Flow fl in fls)
                {
                    if (fl.FlowAppType == FlowAppType.DocFlow)
                    {
                        continue;
                    }

                    if (fl.FK_FlowSort != en.No)
                    {
                        continue;
                    }

                    bool isHaveIt = false;
                    foreach (DataRow dr in dt.Rows)
                    {
                        if (dr["No"].ToString() != fl.No)
                        {
                            continue;
                        }
                        isHaveIt = true;
                        break;
                    }

                    this.Pub1.AddLi(" <a  href=\"javascript:WinOpen('/WF/Rpt/Search.aspx?RptNo=ND" + int.Parse(fl.No) + "MyRpt&FK_Flow=" + fl.No + "');\" >" + fl.Name + "</a> ");
                }
                #endregion 输出流程。

                this.Pub1.AddULEnd();

                this.Pub1.AddTDEnd();
                if (idx == cols - 1)
                {
                    idx = -1;
                    this.Pub1.AddTREnd();
                }
            }

            while (idx != -1)
            {
                idx++;
                if (idx == cols - 1)
                {
                    idx = -1;
                    this.Pub1.AddTD();
                    this.Pub1.AddTREnd();
                }
                else
                {
                    this.Pub1.AddTD();
                }
            }
            this.Pub1.AddTableEnd();
        }
Example #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            BP.WF.Flows fls = new BP.WF.Flows();
            fls.RetrieveAll();

            FlowSorts ens = new FlowSorts();

            ens.RetrieveAll();

            DataTable dt = BP.WF.Dev2Interface.DB_GenerCanStartFlowsOfDataTable(BP.Web.WebUser.No);

            int     cols      = 3; //定义显示列数 从0开始。
            decimal widthCell = 100 / cols;

            this.Pub1.AddTable("width=100% border=0");
            this.Pub1.AddCaptionMsg("发起流程");

            int  idx = -1;
            bool is1 = false;

            string timeKey = "s" + this.Session.SessionID + DateTime.Now.ToString("yyMMddHHmmss");

            foreach (FlowSort en in ens)
            {
                if (en.ParentNo == "0" ||
                    en.ParentNo == "" ||
                    en.No == "")
                {
                    continue;
                }

                idx++;
                if (idx == 0)
                {
                    is1 = this.Pub1.AddTR(is1);
                }

                this.Pub1.AddTDBegin("width='" + widthCell + "%' border=0 valign=top");
                //输出类别.
                //this.Pub1.AddFieldSet(en.Name);
                this.Pub1.AddB(en.Name);
                this.Pub1.AddUL();

                #region 输出流程。
                foreach (Flow fl in fls)
                {
                    if (fl.FlowAppType == FlowAppType.DocFlow)
                    {
                        continue;
                    }

                    if (fl.FK_FlowSort != en.No)
                    {
                        continue;
                    }

                    bool isHaveIt = false;
                    foreach (DataRow dr in dt.Rows)
                    {
                        if (dr["No"].ToString() != fl.No)
                        {
                            continue;
                        }
                        isHaveIt = true;
                        break;
                    }

                    string extUrl = "";
                    if (fl.IsBatchStart)
                    {
                        extUrl = "<div style='float:right;'><a href='/WF/BatchStart.aspx?FK_Flow=" + fl.No + "' >批量发起</a>|<a href='/WF/Rpt/Search.aspx?RptNo=ND" + int.Parse(fl.No) + "MyRpt&FK_Flow=" + fl.No + "'>查询</a>|<a href=\"javascript:WinOpen('/WF/Chart.aspx?FK_Flow=" + fl.No + "&DoType=Chart&T=" + timeKey + "','sd');\"  >图</a></div>";
                    }
                    else
                    {
                        extUrl = "<div style='float:right;'><a  href='/WF/Rpt/Search.aspx?RptNo=ND" + int.Parse(fl.No) + "MyRpt&FK_Flow=" + fl.No + "'>查询</a>|<a href=\"javascript:WinOpen('/WF/Chart.aspx?FK_Flow=" + fl.No + "&DoType=Chart&T=" + timeKey + "','sd');\"  >流程图</a></div>";
                    }

                    if (isHaveIt)
                    {
                        if (Glo.IsWinOpenStartWork == 1)
                        {
                            this.Pub1.AddLiB("<a href=\"javascript:WinOpenIt('MyFlow.aspx?FK_Flow=" + fl.No + "&FK_Node=" + int.Parse(fl.No) + "01&T=" + timeKey + "');\" >" + fl.Name + "</a> - " + extUrl);
                        }
                        else if (Glo.IsWinOpenStartWork == 2)
                        {
                            this.Pub1.AddLiB("<a href=\"javascript:WinOpenIt('/WF/OneFlow/MyFlow.aspx?FK_Flow=" + fl.No + "&FK_Node=" + int.Parse(fl.No) + "01&T=" + timeKey + "');\" >" + fl.Name + "</a> - " + extUrl);
                        }
                        else
                        {
                            this.Pub1.AddLiB("<a href='MyFlow.aspx?FK_Flow=" + fl.No + "&FK_Node=" + int.Parse(fl.No) + "01' >" + fl.Name + "</a> - " + extUrl);
                        }
                    }
                    else
                    {
                        this.Pub1.AddLi(fl.Name);
                    }
                }
                #endregion 输出流程。

                this.Pub1.AddULEnd();

                this.Pub1.AddTDEnd();
                if (idx == cols - 1)
                {
                    idx = -1;
                    this.Pub1.AddTREnd();
                }
            }

            while (idx != -1)
            {
                idx++;
                if (idx == cols - 1)
                {
                    idx = -1;
                    this.Pub1.AddTD();
                    this.Pub1.AddTREnd();
                }
                else
                {
                    this.Pub1.AddTD();
                }
            }
            this.Pub1.AddTableEnd();
        }