예제 #1
0
        private void BindLinuupInfo(string queueId)
        {
            listQueue.Items.Clear();

            DataTable dtLineupInfos = _qm.GetLineupInfos(queueId, false);

            if (dtLineupInfos.Rows.Count <= 0)
            {
                return;
            }

            ListViewItem lviFirst = new ListViewItem("此处插入");

            lviFirst.ImageIndex = 0;
            lviFirst.Tag        = null;
            listQueue.Items.Add(lviFirst);

            foreach (DataRow dr in dtLineupInfos.Rows)
            {
                LineUpData lineupData = new LineUpData();
                lineupData.BindRowData(dr);


                ListViewItem lvi = new ListViewItem(new string[] { lineupData.号码前缀 + lineupData.排队号码,
                                                                   lineupData.患者姓名,
                                                                   QueueHelper.GetLineupStateCaption(lineupData.排队状态),
                                                                   lineupData.附加信息.备注 }, -1);
                lvi.BackColor = this.BackColor;
                lvi.Tag       = lineupData;

                listQueue.Items.Add(lvi);


                ListViewItem lviNext = new ListViewItem("此处插入");
                lviNext.ImageIndex = 0;
                lviNext.Tag        = null;
                listQueue.Items.Add(lviNext);

                if (lineupData.排队ID == _lineupInfo.排队ID)
                {
                    if (lvi.Index - 1 >= 0)
                    {
                        listQueue.Items[lvi.Index - 1].ImageIndex = 1;
                        listQueue.Items[lvi.Index - 1].Text       = "禁止插入";
                    }

                    lviNext.ImageIndex = 1;
                    lviNext.Text       = "禁止插入";
                }
            }


            listQueue.View = View.Details;
        }
예제 #2
0
        private void BindQueueListData(List <QueueItem> queueItems)
        {
            if (queueItems == null || queueItems.Count <= 0)
            {
                return;
            }

            foreach (QueueItem queueItem in queueItems)
            {
                DataTable dtLineupInfo = QueueModel.GetLineupInfos(queueItem.QueueId, false);

                //处理正在呼叫的排队信息显示
                if (_queueShowDesign.IsShowLastCall)
                {
                    DataRow[] drCalls = dtLineupInfo.Select("排队状态>1 and 排队状态<=3");
                    if (drCalls.Length > 0)
                    {
                        DateTime   lastTime   = default(DateTime);
                        LineUpData lineupCall = null;

                        foreach (DataRow dr in drCalls)
                        {
                            LineUpData lineUpInfo = new LineUpData();
                            lineUpInfo.BindRowData(dr);

                            if (lineUpInfo.附加信息.末次呼叫时间 >= lastTime)
                            {
                                lineupCall = lineUpInfo;
                                lastTime   = lineUpInfo.附加信息.末次呼叫时间;
                            }
                        }

                        if (lineupCall != null)
                        {
                            string newName = lineupCall.患者姓名.Replace(lineupCall.患者姓名.Substring(1, 1), "*");
                            _callList[queueItem.QueueName].Text = ((_queueShowDesign.IsShowCallIcon)?"    ":"") + "" + lineupCall.号码前缀 + lineupCall.排队号码 + "" + newName;
                        }
                        else
                        {
                            _callList[queueItem.QueueName].Text = "";
                        }
                    }
                    else
                    {
                        _callList[queueItem.QueueName].Text = "";
                    }
                }

                //处理正在排队的数据显示
                DataRow[] drQueues = dtLineupInfo.Select("排队状态=0");
                if (drQueues.Length > 0)
                {
                    string waitQueueInfo = "";
                    for (int i = 0; i < _queueShowDesign.WaitCount; i++)
                    {
                        if (i >= drQueues.Length)
                        {
                            break;
                        }

                        LineUpData lineupInfo = new LineUpData();
                        lineupInfo.BindRowData(drQueues[i]);

                        if (waitQueueInfo != "")
                        {
                            waitQueueInfo = waitQueueInfo + "  ";
                        }

                        string newName = lineupInfo.患者姓名.Replace(lineupInfo.患者姓名.Substring(1, 1), "*");

                        waitQueueInfo = waitQueueInfo + "" + lineupInfo.号码前缀 + lineupInfo.排队号码 + ""
                                        + newName
                                        + ((string.IsNullOrEmpty(lineupInfo.附加信息.备注))?"": "(" + lineupInfo.附加信息.备注 + ")");
                    }

                    _waitList[queueItem.QueueName].Text = waitQueueInfo;
                }
                else
                {
                    _waitList[queueItem.QueueName].Text = "";
                }

                //处理已经过号的排队数据显示
            }
        }