コード例 #1
0
        private void GrabTicket(RegDept regDept)
        {
            if (this.chkWaitforTime.Checked && this.m_allSelectDoctors.Count > 0)
            {
                foreach (SelectDoctor current in this.m_allSelectDoctors)
                {
                    object obj = regDept.ListDoctors[current.RowsIndex].Tags[current.CellIndex];
                    if (obj != null)
                    {
                        Log.WriteInfo(string.Format("获取预约票源网址:{0}",(string)obj));
                        OrderInfo queryRegTime = this.m_regHelper.GetQueryRegTime((string)obj);
                        if (queryRegTime.ResResult == ResponseReuslt.SUCCESS)
                        {
                            this.m_bIsSuccessGetTicket = true;
                            this.m_ResetEvent.Reset();

                            if (File.Exists(RegSetting.Instance.SoundPath))
                            {
                                this.m_sdPlayer.SoundLocation = RegSetting.Instance.SoundPath;
                                this.m_sdPlayer.Play();
                            }

                            OrderForm orderForm = new OrderForm(queryRegTime);
                            orderForm.TopMost = true;
                            orderForm.ShowDialog();
                            orderForm.Dispose();
                            this.cmbArea.Enabled = true;
                            this.cmbDepartment.Enabled = true;
                            this.cmbHospital.Enabled = true;

                            break;
                        }
                        else if (queryRegTime.ResResult == ResponseReuslt.NON_LOGIN)
                        {
                            this.m_bIsSuccessGetTicket = true;
                            this.m_ResetEvent.Reset();
                            MessageBoxEx.Show("请先登录后再预约", "提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Asterisk);
                            this.cmbArea.Enabled = true;
                            this.cmbDepartment.Enabled = true;
                            this.cmbHospital.Enabled = true;
                            break;
                        }
                        else
                        {
                            Log.WriteError(string.Format("获取预约票源网址失败", (string)obj));
                        }
                    }
                }
            }
        }
コード例 #2
0
 private void RefreshDatagridView(RegDept regDept)
 {
     this.btnRefresh.Text = "刷新";
     this.btnRefresh.Refresh();
     this.m_bIsSuccessGetTicket = false;
     this.m_bIsHaveTickets = false;
     this.panelInfo.Text = (this.m_bIsProvinceHos ? "(提前7天下午15:00放号,取号时间请以接收的短信为准)" : "(提前7天下午14:00放号,取号时间请以接收的短信为准)");
     if (regDept.ResResult != ResponseReuslt.SUCCESS)
     {
         this.panelInfo.Text = "信息读取有误:可能网路连接失败,或者不存在该科室信息";
         return;
     }
     if (regDept.RealCount == 0)
     {
         this.panelInfo.Text = "该科室暂无排班";
         return;
     }
     this.GrabTicket(regDept);
     if (this.lbDate1.Text != regDept.Dates[0])
     {
         this.lbDate1.Text = regDept.Dates[0];
         this.lbDate2.Text = regDept.Dates[1];
         this.lbDate3.Text = regDept.Dates[2];
         this.lbDate4.Text = regDept.Dates[3];
         this.lbDate5.Text = regDept.Dates[4];
         this.lbDate6.Text = regDept.Dates[5];
         this.lbDate7.Text = regDept.Dates[6];
         this.lbDate8.Text = regDept.Dates[7];
     }
     for (int i = 0; i < regDept.RealCount; i++)
     {
         int num = 0;
         int index = this.dataGridViewX1.Rows.Add();
         RegDoctor regDoctor = regDept.ListDoctors[i];
         System.Windows.Forms.DataGridViewCell dataGridViewCell = this.dataGridViewX1.Rows[index].Cells[num];
         dataGridViewCell.Value = regDoctor.Name;
         num++;
         for (int j = 0; j < 16; j++)
         {
             if (regDoctor.Values[j] != null)
             {
                 dataGridViewCell = this.dataGridViewX1.Rows[index].Cells[num];
                 dataGridViewCell.Value = regDoctor.Values[j];
                 dataGridViewCell.ToolTipText = regDoctor.ToolTipTexts[j];
                 dataGridViewCell.Tag = regDoctor.Tags[j];
                 if (j >= 14)
                 {
                     this.m_bIsHaveTickets = true;
                 }
             }
             num++;
         }
     }
 }