/// <summary>
        /// 发送传递流消息
        /// </summary>
        /// <param name="billNo">单据号</param>
        /// <param name="message">单据消息</param>
        /// <param name="receivedUserType">接收用户类别,角色或用户</param>
        /// <param name="receiver">接收消息的角色或用户组</param>
        /// <param name="lstAdditionalInfo">
        /// 附加信息,用于重定向及数据定位等功能(列表第1个位置始终为重定向单据的单据类型,列表第2个位置始终为重定向单据的单据号)
        /// </param>
        public void SendMessage(string billNo, string message, BillFlowMessage_ReceivedUserType receivedUserType,
                                List <string> receiver, List <string> lstAdditionalInfo)
        {
            if (m_billType == null || m_billType == "")
            {
                m_billType = GetBillType(billNo);
            }

            Debug.Assert(!GlobalObject.GeneralFunction.IsNullOrEmpty(m_billType), "单据类别不能为空");
            Debug.Assert(!GlobalObject.GeneralFunction.IsNullOrEmpty(billNo), "单据号不能为空");
            Debug.Assert(!GlobalObject.GeneralFunction.IsNullOrEmpty(message), "消息不能为空");

            try
            {
                Flow_BillFlowMessage msg = GetMessage(billNo);

                if (msg != null)
                {
                    msg.发起方用户编码 = BasicInfo.LoginID;
                    msg.发起方消息   = message;
                    msg.接收方类型   = receivedUserType.ToString();
                    msg.接收方     = StapleFunction.CreateSplitString(",", receiver);

                    msg.期望的处理完成时间 = null;

                    InitAdditionalInfo(ref msg, lstAdditionalInfo);

                    m_billFlowMsg.ContinueMessage(BasicInfo.LoginID, msg);

                    SendFinishedFlagToMessagePromptForm(billNo);
                }
                else
                {
                    msg = new Flow_BillFlowMessage();

                    msg.初始发起方用户编码 = BasicInfo.LoginID;
                    msg.单据号       = billNo;
                    msg.单据类型      = m_billType;
                    msg.单据流水号     = billNo;
                    msg.接收方类型     = receivedUserType.ToString();
                    msg.单据状态      = BillStatus.等待处理.ToString();
                    msg.发起方消息     = message;
                    msg.接收方       = StapleFunction.CreateSplitString(",", receiver);

                    msg.期望的处理完成时间 = null;

                    InitAdditionalInfo(ref msg, lstAdditionalInfo);

                    m_billFlowMsg.SendRequestMessage(BasicInfo.LoginID, msg);
                }
            }
            catch (Exception exce)
            {
                m_logManagement.WriteException(exce.Message + "\t\r" + exce.StackTrace, out m_error);
            }
        }
Пример #2
0
        /// <summary>
        /// 传递流消息(走流程)
        /// </summary>
        /// <param name="msgContent">消息内容</param>
        /// <param name="receivedRole">接收方角色</param>
        void PassFlowMessage(string msgContent, CE_RoleEnum receivedRole)
        {
            try
            {
                Flow_BillFlowMessage msg = m_billFlowMsg.GetMessage(BasicInfo.LoginID, labelTitle.Text, txtBill_ID.Text);

                if (msg == null)
                {
                    return;
                }

                msg.发起方用户编码 = BasicInfo.LoginID;
                msg.发起方消息   = msgContent;
                msg.接收方类型   = BillFlowMessage_ReceivedUserType.角色.ToString();
                msg.接收方     = receivedRole.ToString();

                msg.期望的处理完成时间 = null;

                m_billFlowMsg.ContinueMessage(BasicInfo.LoginID, msg);
                SendFinishedFlagToMessagePromptForm(txtBill_ID.Text);
            }
            catch (Exception exce)
            {
                Console.WriteLine(exce.Message);
            }
        }
Пример #3
0
        /// <summary>
        /// 传递流消息(走流程)
        /// </summary>
        /// <param name="msgContent">消息内容</param>
        /// <param name="receivedRole">接收方角色</param>
        void PassFlowMessage(string msgContent, CE_RoleEnum receivedRole)
        {
            Flow_BillFlowMessage msg = m_billFlowMsg.GetMessage(BasicInfo.LoginID, labelTitle.Text, m_strBillID);

            if (msg == null)
            {
                return;
            }

            msg.发起方用户编码 = BasicInfo.LoginID;
            msg.发起方消息   = msgContent;
            msg.接收方类型   = BillFlowMessage_ReceivedUserType.角色.ToString();
            msg.接收方     = receivedRole.ToString();

            msg.期望的处理完成时间 = null;
            m_billFlowMsg.ContinueMessage(BasicInfo.LoginID, msg);
            SendFinishedFlagToMessagePromptForm(m_strBillID);
        }
Пример #4
0
        /// <summary>
        /// 传递流消息(走流程)
        /// </summary>
        /// <param name="billNo">单据号</param>
        /// <param name="msgContent">消息内容</param>
        /// <param name="receivedRole">接收方角色</param>
        void PassFlowMessage(string billNo, string msgContent, CE_RoleEnum receivedRole)
        {
            Flow_BillFlowMessage msg = m_billFlowMsg.GetMessage(BasicInfo.LoginID, labelTitle.Text, billNo);

            if (msg == null)
            {
                return;
            }

            msg.发起方用户编码 = BasicInfo.LoginID;
            msg.发起方消息   = string.Format("【用途】:{0}  【退库类别】:{1} 【申请人】:{2}  ※※※ 等待【{3}】处理",
                                        txtPurpose.Text, cmbType.Text, txtProposer.Text, receivedRole.ToString());
            msg.接收方类型 = BillFlowMessage_ReceivedUserType.角色.ToString();
            msg.接收方   = receivedRole.ToString();

            msg.期望的处理完成时间 = null;
            m_billFlowMsg.ContinueMessage(BasicInfo.LoginID, msg);

            SendFinishedFlagToMessagePromptForm(billNo);
        }