/// <summary> /// 弹出提示信息框 /// </summary> /// <param name="Info"></param> public static void ShowMessageInfo(string Info) { MyAlert frm2 = new MyAlert(AlertTypeenum.信息, Info); frm2.ShowDialog(); frm2.Dispose(); }
private void lblOK_Click(object sender, EventArgs e) { #region 增加挂号提示信息 try { string registerMsg = SkyComm.getvalue("挂号提示"); if (!string.IsNullOrEmpty(registerMsg)) { using (FrmYesNoAlert frmCheck = new FrmYesNoAlert()) { frmCheck.Title = "挂号提示"; frmCheck.Msg = registerMsg; frmCheck.sec = 90; if (frmCheck.ShowDialog() != DialogResult.OK) { return; } } } } catch { } #endregion this.AnsyWorker(ui => { ui.UpdateTitle("取号确认中,请稍等..."); ui.SynUpdateUI(() => { decimal decYE = Convert.ToDecimal(lblYE.Text); decimal decTotal = Convert.ToDecimal(lblTotalMoney.Text); decimal decTotalMoney = 0; ucTime1.timer1.Stop(); string strMessage = string.Empty; int intRowChange = 0; foreach (DataRow Row in dsBespeak.Tables[0].Rows) { if (Convert.ToBoolean(Row["SELECT"]) == true) { decTotalMoney += DecimalRound.Round(Convert.ToDecimal(Row["ALLCOST"]), 2); } if (IsQueryBespeakData == true && Row["DIAGNOSEID"].ToString() != SkyComm.DiagnoseID) { intRowChange++; strMessage = Row["OFFICE"].ToString() + "|" + Row["USERNAME"].ToString() + " 第" + Row["QUEUEID"].ToString() + "号" + "\r\n"; } } if (!string.IsNullOrEmpty(strMessage)) { if (intRowChange < 3) { strMessage += "\r\n"; } strMessage = strMessage + "是否要绑定到当前就诊卡?"; MyAlert myalert = new MyAlert(AlertTypeenum.确认取消, strMessage, "预约信息绑卡确认", 30); if (myalert.ShowDialog() == System.Windows.Forms.DialogResult.OK) { DataSet dsChagnge = dsBespeak.Clone(); foreach (DataRow Row in dsBespeak.Tables[0].Rows) { if (Convert.ToBoolean(Row["SELECT"]) == true && Row["DIAGNOSEID"].ToString() != SkyComm.DiagnoseID) { Row["DIAGNOSEID"] = SkyComm.DiagnoseID; dsChagnge.Tables[0].ImportRow(Row); } } if (dsChagnge.Tables[0].Rows.Count > 0) { try { BespeakRegisterFacade bespeakRegisterFacade = new BespeakRegisterFacade(); dsBespeak.Tables[0].TableName = "T_BESPEAK_REGISTER"; bespeakRegisterFacade.updateDiagnoseID(dsChagnge); } catch (Exception ex) { Skynet.LoggingService.LogService.GlobalInfoMessage("绑卡失败:" + ex.Message); SkyComm.ShowMessageInfo("绑卡失败:" + ex.Message); ucTime1.Sec = 60; ucTime1.timer1.Start(); return; } } } else { return; } } if (decTotal != decTotalMoney) { SkyComm.ShowMessageInfo("请检查您选择的预约记录是否正确!"); ucTime1.Sec = 60; ucTime1.timer1.Start(); return; } if (decTotal > decYE) { SkyComm.ShowMessageInfo("您的健康卡余额不足,不能进行取号,请在自助预存后再进行确认操作!"); ucTime1.Sec = 60; ucTime1.timer1.Start(); return; } ucTime1.timer1.Stop(); //构造挂号的数据 CommonFacade commonFacade = new CommonFacade(); DateTime ServerdateTime = commonFacade.GetServerDateTime(); double minutes = Convert.ToDouble(SystemInfo.SystemConfigs["预约挂号报到延时时间"].DefaultValue); RegisterInfoData registerInfoData = new RegisterInfoData(); int registerID = 0; foreach (DataRow Row in dsBespeak.Tables[0].Rows) { if (Convert.ToBoolean(Row["SELECT"]) == true) { if (Convert.ToDateTime(Row["BESPEAKDATE"]).AddMinutes(minutes) < ServerdateTime) { MyAlert frm = new MyAlert(AlertTypeenum.信息, "此预约号的预约时间为:" + Row["BESPEAKDATE"].ToString() + ",预约时间已过,不能使用!"); frm.ShowDialog(); frm.Dispose(); registerInfoData = new RegisterInfoData(); ucTime1.Sec = 60; ucTime1.timer1.Start(); return; } registerID++; DataRow Newrow = registerInfoData.Tables[0].NewRow(); Newrow[RegisterInfoData.T_REGISTER_INFO_REGISTERID] = "新增" + registerID.ToString(); Newrow[RegisterInfoData.T_REGISTER_INFO_CANCELMARK] = "0"; Newrow[RegisterInfoData.T_REGISTER_INFO_OPERATORID] = SysOperatorInfo.OperatorID; Newrow[RegisterInfoData.T_REGISTER_INFO_OPERATEDATE] = ServerdateTime; Newrow[RegisterInfoData.T_REGISTER_INFO_CHARGEMARK] = 0; Newrow[RegisterInfoData.T_REGISTER_INFO_PATIENTNAME] = Row["PATIENTNAME"].ToString(); Newrow[RegisterInfoData.T_REGISTER_INFO_SEX] = Row["SEX"].ToString(); Newrow[RegisterInfoData.T_REGISTER_INFO_REGISTEROFFICEID] = Row["BESPEAKOFFICEID"].ToString(); Newrow[RegisterInfoData.T_REGISTER_INFO_OFFICE] = Row["OFFICE"].ToString(); Newrow[RegisterInfoData.T_REGISTER_INFO_REGISTERCLASS] = Row["REGISTERCLASS"].ToString(); Newrow[RegisterInfoData.T_REGISTER_INFO_DOCTORID] = Row["BESPEAKDOCTORID"].ToString(); Newrow[RegisterInfoData.T_REGISTER_INFO_USERNAME] = Row["USERNAME"].ToString(); Newrow[RegisterInfoData.T_REGISTER_INFO_CASECOST] = Row["MEDICALRECORDFEE"]; //工本费 Newrow[RegisterInfoData.T_REGISTER_INFO_BESPEAKMONEY] = Row["BESPEAKMONEY"]; //预约费 Newrow[RegisterInfoData.T_REGISTER_INFO_REGISTERFEE] = Row["REGISTERFEE"]; //挂号费 Newrow[RegisterInfoData.T_REGISTER_INFO_EXAMINEMONEY] = Row["EXAMINEMONEY"]; //诊金 Newrow[RegisterInfoData.T_REGISTER_INFO_BESPEAKID] = Row["BESPEAKID"].ToString(); Newrow[RegisterInfoData.T_REGISTER_INFO_DIAGNOSEID] = Row["DIAGNOSEID"].ToString(); Newrow[RegisterInfoData.T_REGISTER_INFO_ADDRESS] = Row["ADDRESS"].ToString(); Newrow[RegisterInfoData.T_REGISTER_INFO_TELEPHONE] = Row["TELEPHONE"].ToString(); Newrow[RegisterInfoData.T_REGISTER_INFO_OFFICEADDRESS] = Row["OFFICEADDRESS"].ToString(); Newrow[RegisterInfoData.T_REGISTER_INFO_DIAGNOSESTATE] = 0; Newrow[RegisterInfoData.T_REGISTER_INFO_WORKTYPE] = Row["WORKTYPE"].ToString();//班次 Newrow[RegisterInfoData.T_REGISTER_INFO_BIRTHDAY] = Convert.ToDateTime(Row["BIRTHDAY"].ToString()).Date; Newrow[RegisterInfoData.T_REGISTER_INFO_EXECDATE] = ServerdateTime; Newrow[RegisterInfoData.T_REGISTER_INFO_BALANCEMARK] = "2"; Newrow[RegisterInfoData.T_REGISTER_INFO_CARDID] = SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["CARDID"].ToString(); Newrow["BALANCEMODE"] = "预交金";//结算方式 Newrow[RegisterInfoData.T_REGISTER_INFO_BALANCESTATE] = 0; Newrow[RegisterInfoData.T_REGISTER_INFO_CHECKFEE] = Row["PLUSFEE"]; //row[RegisterInfoData.T_REGISTER_INFO_BALANCEOPERATOR] = operatorId; //row[RegisterInfoData.T_REGISTER_INFO_BALANCEDATE] = dateTime; //数据传入方式0:门急诊挂号,1:专家挂号,2:门诊医生站读卡挂号,4:医生站急诊划价收费,5:储值卡挂号,6:银医服务,7,自助挂号 Newrow[RegisterInfoData.T_REGISTER_INFO_DATAINPUTTYPE] = 7;//结算状态 Newrow[RegisterInfoData.T_REGISTER_INFO_ARRANAGERECORDID] = Row["ARRANAGERECORDID"].ToString(); Newrow[RegisterInfoData.T_REGISTER_INFO_QUEUEID] = Row["QUEUEID"].ToString(); registerInfoData.Tables[0].Rows.Add(Newrow); } } RegisterInfoFacade registerFacade = new RegisterInfoFacade(); try { DataSet resultDs = registerFacade.insertEntityZj(registerInfoData); SkyComm.GetCardBalance(); if (resultDs.Tables[0].Columns.Contains("EXAMINENAME") == false) { DataColumn col = new DataColumn("EXAMINENAME", typeof(System.String)); col.Caption = "EXAMINENAME"; resultDs.Tables[0].Columns.Add(col); } // douyaming 2013-6-21 挂号发票输出 诊室位置 if (!resultDs.Tables[0].Columns.Contains("EXAMINELOC")) { resultDs.Tables[0].Columns.Add("EXAMINELOC"); } UsersFacade uf = new UsersFacade(); BespeakRegisterFacade bespeakRegisterFacade = new BespeakRegisterFacade(); foreach (DataRow row in resultDs.Tables[0].Rows) { //13470 在挂号发票中输出诊室 string keyval = row["DOCTORID"].ToString(); if (keyval != "-1") { row["EXAMINENAME"] = uf.FindByUserInfo(keyval).Tables[0].Rows[0]["EXAMINENAME"].ToString(); } //douyaming 2013-5-28 挂号发票输出 诊室位置 ExamineFacade ef = new ExamineFacade(); string i_EXAMINENAME = uf.FindByPrimaryKeyString(keyval).ToString(); if (i_EXAMINENAME == "") { row["EXAMINELOC"] = ""; } else { DataRow[] rw = ef.FindAllExamine().Tables[0].Select("EXAMINENAME = '" + i_EXAMINENAME + "' AND OFFICEID = '" + row["REGISTEROFFICEID"].ToString() + "'"); if (rw.Length > 0) { row["EXAMINELOC"] = rw[0]["EXAMINELOC"].ToString(); } else { row["EXAMINELOC"] = ""; } } } foreach (DataRow dr in resultDs.Tables[0].Rows) { //打印挂号凭证 DataTable dtPrint = resultDs.Tables[0].Clone(); dtPrint.ImportRow(dr); DataSet dsPrint = new DataSet(); dsPrint.Tables.Add(dtPrint.Copy()); PrintReport(dsPrint); } try { Hashtable htPara = new Hashtable(); htPara.Add("@预约时间", Convert.ToDateTime(resultDs.Tables[0].Rows[0]["BESPEAKDATE"]).ToString("MM月dd日HH时mm分")); string OfficeAddress = SysOperatorInfo.OperatorAreaname + resultDs.Tables[0].Rows[0]["OFFICEADDRESS"].ToString(); htPara.Add("@科室位置", OfficeAddress); htPara.Add("@科室", resultDs.Tables[0].Rows[0][RegisterInfoData.T_REGISTER_INFO_OFFICE].ToString()); htPara.Add("@医生", resultDs.Tables[0].Rows[0][RegisterInfoData.T_REGISTER_INFO_USERNAME].ToString()); htPara.Add("@排队号", resultDs.Tables[0].Rows[0]["QUEUEID"].ToString()); htPara.Add("@预约号", resultDs.Tables[0].Rows[0]["BESPEAKID"].ToString()); htPara.Add("@诊室位置", resultDs.Tables[0].Rows[0]["EXAMINELOC"].ToString()); htPara.Add("@诊室名称", resultDs.Tables[0].Rows[0]["EXAMINENAME"].ToString()); UMSMsgLib.UMSMsg.Instance.SendMsg(resultDs.Tables[0].Rows[0]["TELEPHONE"].ToString(), "取号", htPara); } catch (Exception ex) { Skynet.LoggingService.LogService.GlobalInfoMessage("取号成功后,发短信失败:" + ex.Message); } } catch (Exception ex) { Skynet.LoggingService.LogService.GlobalInfoMessage(SkyComm.DiagnoseID + "取号[" + registerInfoData.Tables[0].Rows.Count + "]条记录,失败:" + ex.Message); SkyComm.ShowMessageInfo("取号失败:" + ex.Message); ucTime1.Sec = 60; ucTime1.timer1.Start(); return; } SkyComm.ShowMessageInfo("取号成功,请提前15分钟到达分诊大厅进行等候!"); ucTime1.timer1.Stop(); //后台直接进行处理挂号操作 DialogResult = System.Windows.Forms.DialogResult.OK; }); }); //DialogResult = System.Windows.Forms.DialogResult.OK; }