예제 #1
0
        private void btnConsultationCall_Click(object sender, EventArgs e)
        {
            if (cboAndonEvent.SelectedItem == null)
            {
                return;
            }

            int intSelectedCount = 0;

            foreach (EventStakeholder staff in staffs)
            {
                if (staff.Choice)
                {
                    intSelectedCount++;
                }
            }
            if (intSelectedCount <= 0)
            {
                isShowMessageBeforeActive = true;
                IRAPMessageBox.Instance.Show("至少要选择一个人员!", Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
                grdStaffs.Focus();
                return;
            }

            string strProcedureName =
                string.Format(
                    "{0}.{1}",
                    className,
                    MethodBase.GetCurrentMethod().Name);

            WriteLog.Instance.WriteBeginSplitter(strProcedureName);
            try
            {
                int    errCode = 0;
                string errText = "";
                AndonRspedEventInfo andonEvent = cboAndonEvent.SelectedItem as AndonRspedEventInfo;

                string strSuccess  = "";
                string strFailures = "";
                foreach (EventStakeholder staff in staffs)
                {
                    if (staff.Choice)
                    {
                        try
                        {
                            IRAPFVSClient.Instance.usp_AndonEventForwardingEx(
                                IRAPUser.Instance.CommunityID,
                                andonEvent.EventFactID,
                                andonEvent.OpID,
                                0,
                                staff.UserCode,
                                IRAPUser.Instance.SysLogID,
                                out errCode,
                                out errText);
                            WriteLog.Instance.Write(string.Format("({0}){1}", errCode, errText), strProcedureName);

                            if (errCode != 0)
                            {
                                strFailures += string.Format("[{0}]", staff.UserName);
                                isShowMessageBeforeActive = true;
                                IRAPMessageBox.Instance.Show(errText, Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
                            }
                            else
                            {
                                strSuccess += string.Format("[{0}]", staff.UserName);
                            }
                        }
                        catch (Exception error)
                        {
                            WriteLog.Instance.Write(error.Message, strProcedureName);
                            WriteLog.Instance.Write(error.StackTrace, strProcedureName);

                            isShowMessageBeforeActive = true;
                            IRAPMessageBox.Instance.Show(
                                error.Message,
                                Text,
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
                        }
                    }
                }

                string msg = "";
                if (strSuccess != "")
                {
                    msg += string.Format("已经成功呼叫{0}前来参与会诊\n", strSuccess);
                }
                if (strFailures != "")
                {
                    msg += string.Format("{0}呼叫失败,你可以再次重新呼叫!", strFailures);
                }

                if (msg != "")
                {
                    isShowMessageBeforeActive = true;
                    IRAPMessageBox.Instance.Show(msg, Text, MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                }

                btnReturn.PerformClick();
            }
            finally
            {
                WriteLog.Instance.WriteEndSplitter(strProcedureName);
            }
        }
예제 #2
0
        private void cboAndonEvent_SelectedIndexChanged(object sender, EventArgs e)
        {
            string strProcedureName =
                string.Format(
                    "{0}.{1}",
                    className,
                    MethodBase.GetCurrentMethod().Name);

            if (cboAndonEvent.SelectedItem == null)
            {
                grdStaffs.DataSource = null;
                grdvStaffs.BestFitColumns();

                return;
            }

            AndonRspedEventInfo eventAndon = (AndonRspedEventInfo)cboAndonEvent.SelectedItem;

            WriteLog.Instance.WriteBeginSplitter(strProcedureName);
            try
            {
                int    errCode = 0;
                string errText = "";

                IRAPFVSClient.Instance.ufn_GetList_EventStakeholders(
                    IRAPUser.Instance.CommunityID,
                    eventAndon.EventFactID,
                    IRAPUser.Instance.SysLogID,
                    ref staffs,
                    out errCode,
                    out errText);
                WriteLog.Instance.Write(
                    string.Format("({0}){1}", errCode, errText),
                    strProcedureName);

                if (errCode == 0)
                {
                    grdStaffs.DataSource = staffs;
                }
                else
                {
                    grdStaffs.DataSource = null;

                    isShowMessageBeforeActive = true;
                    IRAPMessageBox.Instance.Show(errText, Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception error)
            {
                grdStaffs.DataSource = null;

                WriteLog.Instance.Write(error.Message, strProcedureName);
                WriteLog.Instance.Write(error.StackTrace, strProcedureName);
                isShowMessageBeforeActive = true;
                IRAPMessageBox.Instance.Show(error.Message, Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                WriteLog.Instance.WriteEndSplitter(strProcedureName);
            }
        }