Ejemplo n.º 1
0
        private void butSure_Click(object sender, EventArgs e)
        {
            try
            {
                if (cbxQueueName.Items.Count <= 0)
                {
                    MessageBox.Show("尚无队列信息,不能入队。", "提示");
                    return;
                }

                if (txtQueueNo.Tag == null)
                {
                    MessageBox.Show("尚未产生排队号码,不能入队。", "提示");
                    return;
                }

                QueueData queueData = (cbxQueueName.SelectedItem as ItemBind).Tag as QueueData;

                LineUpData lineupInfo = _qm.HasApply(_applyId, queueData.科室ID);
                //判断本科室下是否已进行排队
                if (lineupInfo != null)
                {
                    MessageBox.Show("当前患者检查已在队列 [" + lineupInfo.队列名称 + "] 中存在,本科室内不能重复排队。", "提示");
                    return;
                }

                DateTime serverDate = _qm.GetServerDate();

                string orderNum = serverDate.DayOfYear + "" + serverDate.TimeOfDay.Ticks;



                if (_qm.HasNo(Convert.ToInt32(txtQueueNo.Tag), queueData.队列ID, dtpIntoQueue.Value))
                {
                    MessageBox.Show("排队号码 [" + txtQueueNo.Text + "] 存在重复,需重新产生。", "提示");



                    int queueNo = GetQueueNo(cbxQueueName.Text, dtpIntoQueue.Value);
                    txtQueueNo.Text = queueData.队列信息.号码前缀 + queueNo;
                    txtQueueNo.Tag  = queueNo;

                    return;
                }


                _linuupData = new LineUpData();

                _linuupData.排队ID = SqlHelper.GetNumGuid();

                _linuupData.队列ID = queueData.队列ID;
                _linuupData.队列名称 = queueData.队列名称;


                _linuupData.申请ID = _applyId;
                _linuupData.患者ID = _applyInfo.患者ID;
                _linuupData.患者姓名 = _applyInfo.申请信息.姓名;

                _linuupData.排队日期 = dtpIntoQueue.Value;
                _linuupData.排队号码 = Convert.ToString(txtQueueNo.Tag).PadLeft(queueData.队列信息.号码长度, '0');
                _linuupData.号码前缀 = queueData.队列信息.号码前缀;

                _linuupData.排队状态 = LineUpState.qsQueueing;

                _linuupData.科室ID      = queueData.科室ID;
                _linuupData.科室名称      = _departmentName;
                _linuupData.附加信息.备注   = cbxMemo.Text;
                _linuupData.附加信息.性别   = _applyInfo.申请信息.性别;
                _linuupData.附加信息.年龄   = _applyInfo.申请信息.年龄;
                _linuupData.附加信息.检查项目 = _applyInfo.申请信息.检查项目.项目名称;


                _linuupData.排队序号 = orderNum.ToString();


                _linuupData.附加信息.CopyBasePro(_linuupData);

                _qm.NewLinuUp(_linuupData);



                this.Close();
            }
            catch (Exception ex)
            {
                MsgBox.ShowException(ex, this);
                _linuupData = null;
            }
        }
Ejemplo n.º 2
0
        private void butSure_Click(object sender, EventArgs e)
        {
            try
            {
                if (cbxQueueName.Items.Count <= 0)
                {
                    MessageBox.Show("尚无队列信息,不能入队。", "提示");
                    return;
                }

                if (txtQueueNo.Tag == null)
                {
                    MessageBox.Show("尚未产生排队号码,不能入队。", "提示");
                    return;
                }

                QueueData queueData = (cbxQueueName.SelectedItem as ItemBind).Tag as QueueData;


                DateTime serverDate = _qm.GetServerDate();

                string orderNum = serverDate.DayOfYear + "" + serverDate.TimeOfDay.Ticks;


                if (_qm.HasNo(Convert.ToInt32(txtQueueNo.Tag), queueData.队列ID, dtpIntoQueue.Value))
                {
                    MessageBox.Show("排队号码 [" + txtQueueNo.Text + "] 存在重复,需重新产生。", "提示");

                    int queueNo = GetQueueNo(cbxQueueName.Text, dtpIntoQueue.Value);
                    txtQueueNo.Text = queueData.队列信息.号码前缀 + queueNo;
                    txtQueueNo.Tag  = queueNo;

                    return;
                }

                _lineupInfo.队列ID = queueData.队列ID;
                _lineupInfo.队列名称 = queueData.队列名称;

                _lineupInfo.排队日期 = dtpIntoQueue.Value;
                _lineupInfo.排队号码 = Convert.ToString(txtQueueNo.Tag).PadLeft(queueData.队列信息.号码长度, '0');
                _lineupInfo.号码前缀 = queueData.队列信息.号码前缀;

                _lineupInfo.排队状态 = LineUpState.qsQueueing;

                _lineupInfo.附加信息.备注 = cbxMemo.Text;

                _lineupInfo.排队序号 = orderNum.ToString();


                _lineupInfo.附加信息.CopyBasePro(_lineupInfo);

                _qm.UpdateLineupInfo(_lineupInfo);

                _isOk = true;

                this.Close();
            }
            catch (Exception ex)
            {
                MsgBox.ShowException(ex, this);
            }
        }