Beispiel #1
0
 //消息及通知的实时显示
 private void timer5_Tick(object sender, System.EventArgs e)
 {
     if (SendMessageClass.AcceptMessage == true)
     {
         //新消息
         if (IsUp)
         {
             ShowXX();
             IsUp           = false;
             timer3.Enabled = true;
         }
         //新通知
         if (SendMessageClass.NewInFormation == true)
         {
             SendMessageClass.NewInFormation = false;;
             dt = upForm.selMessage(SendMessageType.通知, mtype, DeptID);
             if (dt != null)
             {
                 FrmInform fi = new FrmInform(title);
                 fi.dt = dt;
                 fi.ShowDialog();
             }
         }
     }
 }
Beispiel #2
0
        /// <summary>
        /// 侦听特定端口的用户请求
        /// </summary>
        /// <param name="port">/本地待侦听端口</param>
        /// <param name="FormStr">弹出窗体的标题</param>
        /// <param name="deptID">科室ID</param>
        /// <param name="operate">操作员</param>
        /// <param name="mtype">消息类型(归属)</param>
        /// <param name="interval">弹出的间隔时间</param>
        /// <param name="formicon">闪烁的图标</param>
        public static void StartListen(int port, string FormStr, long deptID, long operate, int mtype, int interval, System.Drawing.Icon formicon)
        {
            temport        = port;
            timer.Elapsed += new System.Timers.ElapsedEventHandler(timer_Elapsed);
            timer.Enabled  = false;
            timer.Interval = 2000;
            ChangeIPInfo(1, deptID, operate, mtype);
            th = new Thread(new ThreadStart(StartListen));
            th.IsBackground = true;
            th.Start();
            DataTable myTb = upForm.selMessage(SendMessageType.通知, mtype, deptID);

            if (myTb.Rows.Count > 0)
            {
                FrmInform fi = new FrmInform("");
                fi.dt = myTb;
                fi.ShowDialog();
            }
            if (uf == null)
            {
                showupform(FormStr, deptID, operate, mtype, interval, formicon);
            }
            else
            {
                uf.groupBox1.Text = FormStr.Trim();
                uf.DeptID         = deptID;
                uf.YS             = operate;
                uf.mtype          = mtype;
                uf.JGSJ           = interval;
                if (formicon != null)
                {
                    uf.Icon = formicon;
                }
            }
        }
Beispiel #3
0
        /// <summary>
        /// 显示通知
        /// </summary>
        /// <param name="mType">通知的归属类型(0=所有模块,1=,2=,3= (模块ID))</param>
        /// <param name="deptID">通知归属的科室ID</param>
        /// <param name="ysID">操作用户ID</param>
        public static void ShowInform(int mType, long deptID, long ysID)
        {
            FrmInform fi = new FrmInform(mType, deptID, ysID);

            fi.ShowDialog();
        }