/// <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="billNo">单据编号</param>
        /// <param name="role">消息发送到的角色</param>
        /// <param name="msgContent">消息内容</param>
        void SendNewFlowMessage(string billNo, CE_RoleEnum role, string msgContent)
        {
            Flow_BillFlowMessage msg = new Flow_BillFlowMessage();

            msg.初始发起方用户编码 = BasicInfo.LoginID;
            msg.单据号       = billNo;
            msg.单据类型      = labelTitle.Text;
            msg.单据流水号     = billNo;
            msg.接收方类型     = BillFlowMessage_ReceivedUserType.角色.ToString();
            msg.单据状态      = BillStatus.等待处理.ToString();
            msg.发起方消息     = msgContent;

            msg.接收方 = role.ToString();

            msg.期望的处理完成时间 = null;
            m_billFlowMsg.SendRequestMessage(BasicInfo.LoginID, msg);
        }
        /// <summary>
        /// 发送新的流消息
        /// </summary>
        /// <param name="bill">单据内容</param>
        void SendNewFlowMessage(string billNo)
        {
            Flow_BillFlowMessage msg = new Flow_BillFlowMessage();

            msg.初始发起方用户编码 = BasicInfo.LoginID;
            msg.单据号       = billNo;
            msg.单据类型      = labelTitle.Text;
            msg.单据流水号     = billNo;
            msg.接收方类型     = BillFlowMessage_ReceivedUserType.角色.ToString();
            msg.接收方       = CE_RoleEnum.会计.ToString();
            msg.单据状态      = BillStatus.等待处理.ToString();

            msg.发起方消息 = string.Format("{0}号自制件退货单已提交,请财务审核",
                                      billNo);

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

            m_billFlowMsg.SendRequestMessage(BasicInfo.LoginID, msg);
        }
Пример #4
0
        /// <summary>
        /// 发送新的流消息
        /// </summary>
        /// <param name="bill">单据内容</param>
        void SendNewFlowMessage(S_HomemadePartBill bill)
        {
            Flow_BillFlowMessage msg = new Flow_BillFlowMessage();

            msg.初始发起方用户编码 = BasicInfo.LoginID;
            msg.单据号       = bill.Bill_ID;
            msg.单据类型      = labelTitle.Text;
            msg.单据流水号     = bill.Bill_ID;
            msg.接收方类型     = BillFlowMessage_ReceivedUserType.角色.ToString();
            msg.单据状态      = BillStatus.等待处理.ToString();

            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("物品【{0}】,批次号【{1}】  ※※※ 等待【检验员】处理", txtName.Text, txtBatchNo.Text);

            msg.发起方消息 = sb.ToString();
            msg.接收方   = CE_RoleEnum.自制件检验组长.ToString();

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

            m_billFlowMsg.SendRequestMessage(BasicInfo.LoginID, msg);
        }
Пример #5
0
        /// <summary>
        /// 发送新的流消息
        /// </summary>
        /// <param name="billNo">单据内容</param>
        void SendNewFlowMessage(string billNo)
        {
            try
            {
                string[] roleCodes = m_billMessageServer.GetSuperior(CE_RoleStyleType.级领导, BasicInfo.LoginID).ToArray();

                Flow_BillFlowMessage msg = new Flow_BillFlowMessage();
                msg.初始发起方用户编码 = BasicInfo.LoginID;
                msg.单据号       = billNo;
                msg.单据类型      = labelTitle.Text;
                msg.单据流水号     = billNo;
                msg.接收方类型     = BillFlowMessage_ReceivedUserType.角色.ToString();
                msg.单据状态      = BillStatus.等待处理.ToString();

                msg.发起方消息 = string.Format("【用途】:{0}  【退库类别】:{1} 【申请人】:{2}  ※※※ 等待【上级领导】处理",
                                          txtPurpose.Text, cmbType.Text, txtProposer.Text);

                msg.接收方 = "";

                if (roleCodes.Count() > 0)
                {
                    foreach (string role in roleCodes)
                    {
                        msg.接收方 += role + ",";
                    }
                }

                msg.接收方 = msg.接收方.Substring(0, msg.接收方.Length - 1);

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

                m_billFlowMsg.SendRequestMessage(BasicInfo.LoginID, msg);
            }
            catch (Exception exce)
            {
                MessageDialog.ShowErrorMessage(exce.Message);
            }
        }
Пример #6
0
        /// <summary>
        /// 发送新的流消息
        /// </summary>
        /// <param name="billNo">单据号</param>
        void SendNewFlowMessage(string billNo)
        {
            try
            {
                Flow_BillFlowMessage msg = new Flow_BillFlowMessage();

                msg.初始发起方用户编码 = BasicInfo.LoginID;
                msg.单据号       = billNo;
                msg.单据类型      = labelTitle.Text;
                msg.单据流水号     = billNo;
                msg.接收方类型     = BillFlowMessage_ReceivedUserType.角色.ToString();
                msg.单据状态      = BillStatus.等待处理.ToString();

                msg.发起方消息 = string.Format("{0} 号单据重新打印,请主管审核", billNo);

                string[] roleCodes = m_billMessageServer.GetDeptDirectorRoleName(BasicInfo.DeptCode);

                msg.接收方 = "";
                if (roleCodes.Count() > 0)
                {
                    foreach (string role in roleCodes)
                    {
                        msg.接收方 += role + ",";
                    }
                }

                msg.接收方       = msg.接收方.Substring(0, msg.接收方.Length - 1);
                msg.期望的处理完成时间 = null;

                m_billFlowMsg.SendRequestMessage(BasicInfo.LoginID, msg);
            }
            catch (Exception exce)
            {
                Console.WriteLine(exce.Message);
            }
        }