/// <summary> /// 弹出提示信息框 /// </summary> /// <param name="Info"></param> public static void ShowMessageInfo(string Info) { MyAlert frm2 = new MyAlert(AlertTypeenum.信息, Info); frm2.ShowDialog(); frm2.Dispose(); }
public static void MsgInfo(string msg) { MyAlert m = new MyAlert(); m.alerttype = "信息"; m.Msg = msg; m.ShowDialog(); }
private void office1_Click(object sender, EventArgs e) { if (this.itemClick != null) { this.itemClick(true); } OfficeItem list = sender as OfficeItem; string oficeId = list.lblOfficeId.Text; string ofice = list.lblOffice.Text; //douyaming 2016-05-05 CASE:24356 if (ofice.Contains("妇") || ofice.Contains("产")) { if (SkyComm.eCardAuthorizationData.Tables[0].Rows.Count > 0 && SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["SEX"].ToString() != "女") { MyAlert frmAlter = new MyAlert(AlertTypeenum.信息, "当前性别【" + SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["SEX"].ToString() + "】不能进行【" + ofice + "】就诊!"); frmAlter.ShowDialog(); return; } } //wangchao 2016.10.27 case:25866 if (ofice.Contains("儿")) { if (SkyComm.eCardAuthorizationData.Tables[0].Rows.Count > 0 && SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["AGEUNIT"].ToString().Contains("岁")) { string ageString = SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["AGE"].ToString().Trim(); if (ageString != "" && Convert.ToInt32(ageString) > 18) { MyAlert frmAlter = new MyAlert(AlertTypeenum.信息, "当前患者年龄超过18岁,不允许就诊【" + ofice + "】!"); frmAlter.ShowDialog(); return; } } } string mOfficeMessage = ""; mOfficeMessage = SkyComm.getvalue(oficeId); if (!string.IsNullOrEmpty(mOfficeMessage)) { SkyComm.ShowMessageInfo(mOfficeMessage); } FrmDoctorChoose frm = new FrmDoctorChoose(); frm.officeId = oficeId; frm.office = ofice; frm.ShowDialog(this); frm.Dispose(); if (this.itemClick != null) { this.itemClick(false); } }
/// <summary> /// 上一页 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void plBeforePage_Click(object sender, EventArgs e) { if (newPage == 1) { MyAlert frm = new MyAlert(AlertTypeenum.信息, "已经是第一页了!"); frm.ShowDialog(); return; } newPage--; officeNameBind(0); }
/// <summary> /// 下一页 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void plNextPage_Click(object sender, EventArgs e) { if (newPage == Amountpage) { MyAlert frm = new MyAlert(AlertTypeenum.信息, "已经是最后一页了!"); frm.ShowDialog(); return; } newPage++; officeNameBind(0); }
//挂号三 private void lblRegister3_Click(object sender, EventArgs e) { MyAlert m = new MyAlert(); m.alerttype = "确认取消"; m.Msg = "您确认要挂此" + (isZJ ? "门诊专家" : "门诊普通") + "号吗?"; if (m.ShowDialog() == DialogResult.Cancel) { return; } backgroundWorker2.RunWorkerAsync(3); //this.ParentForm.Close(); }
private void pCASH_Click(object sender, EventArgs e) { timer2.Stop(); pExit.Enabled = false; MyAlert m = new MyAlert(); m.alerttype = "开始充值"; if (m.ShowDialog() == DialogResult.OK) { this.Close(); //this.backgroundWorker1.RunWorkerAsync(); } else { //退卡 this.Close(); } }
//开始阶段 void Start() { //>>>>>>>>>>>>>>>>加载资源<<<<<<<<<<<<<<<<< string uiRootPath = PathData.UI_PATH + "UIRoot"; string alertPath = PathData.UI_PATH + "Alert"; string confirmPath = PathData.UI_PATH + "Confirm"; string loadPath = PathData.UI_PATH + "Load"; string stayTipsPath = PathData.UI_PATH + "StayTips"; string tipsPath = PathData.UI_PATH + "Tips"; gbb.GetResourcesManager.Load <Object>(uiRootPath); gbb.GetResourcesManager.Load <Object>(alertPath); gbb.GetResourcesManager.Load <Object>(confirmPath); gbb.GetResourcesManager.Load <Object>(loadPath); gbb.GetResourcesManager.Load <Object>(stayTipsPath); gbb.GetResourcesManager.Load <Object>(tipsPath); //>>>>>>>>>>>>>>>>使用资源<<<<<<<<<<<<<<<<< //初始化UIRoot _uiRoot = (GameObject)Instantiate(gbb.GetResourcesManager.FindAsset(uiRootPath).obj); _uiRoot.name = "[UIRoot]"; DontDestroyOnLoad(_uiRoot);//注册为非销毁对象 _uiContainer = GameObject.Find("[UIRoot]/Container").transform; //初始化公共界面 _alert = createPucUI <MyAlert>(gbb.GetResourcesManager.FindAsset(alertPath).obj); _confirm = createPucUI <MyConfirm>(gbb.GetResourcesManager.FindAsset(confirmPath).obj); _load = createPucUI <MyLoad>(gbb.GetResourcesManager.FindAsset(loadPath).obj); _stayTips = createPucUI <MyStayTips>(gbb.GetResourcesManager.FindAsset(stayTipsPath).obj); _preTips = gbb.GetResourcesManager.FindAsset(tipsPath).obj; //>>>>>>>>>>>>>>>>删除资源<<<<<<<<<<<<<<<<< gbb.GetResourcesManager.Remove(uiRootPath); gbb.GetResourcesManager.Remove(alertPath); gbb.GetResourcesManager.Remove(confirmPath); gbb.GetResourcesManager.Remove(loadPath); gbb.GetResourcesManager.Remove(stayTipsPath); gbb.GetResourcesManager.Remove(tipsPath); }
public JsonResult CreateAlert(string AlertName, string AlertFrequency, string AlertQuery, bool IsPlutoSearch, bool IsEnergySearch, bool IsPermitSearch, bool IsViolationSearch, bool IsEvictionSearch, bool IsElevatorSearch, bool IsPropertySalesSearch, string ProjectSearchAdditional) { string msg = "Alert created successfully"; try { DatabaseMaxValues result = IsPlutoSearch ? mainDAL.GetMaxValues() : new DatabaseMaxValues(); MyAlert myAlert = new MyAlert() { Username = GlobalVariables.GetFromCookie("NYCUser", "Username"), AlertName = AlertName, AlertQuery = AlertQuery, Frequency = Convert.ToInt32(AlertFrequency), Last_OBJECTID = IsPlutoSearch ? result.OBJECTID : null, IsEnergySearch = IsEnergySearch, IsPermitSearch = IsPermitSearch, IsViolationSearch = IsViolationSearch, IsEvictionSearch = IsEvictionSearch, IsElevatorSearch = IsElevatorSearch, IsPropertySalesSearch = IsPropertySalesSearch, ProjectSearchAdditional = ProjectSearchAdditional, DateCreated = DateTime.Now, Last_DateCheck = DateTime.Now, Next_DateCheck = AlertFrequency == "7" ? DateTime.Now.AddDays(7) : DateTime.Now.AddDays(1), IsUnread = false }; db.MyAlerts.Add(myAlert); db.SaveChanges(); return(Json(new { msg }, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { msg = ex.Message; return(Json(new { msg }, JsonRequestBehavior.AllowGet)); } }
public void OutCard(int sqadd, int blockAddr, IDCardInfo userInfo, decimal sumChargeMoney) { try { //PatientInfoFacade pfacade = new PatientInfoFacade(); //string ConditionStr = " AND A.IDENTITYNAME='身份证' AND A.IDENTITYCARD='" + FrmMain.userInfo.Number.Trim() + "' AND B.CIRCUIT_STATE=0 "; //DataSet pdata = pfacade.FindCardPatientinfoByCondition(ConditionStr); //if (pdata!=null && pdata.Tables[0].Rows.Count > 0) //{ // MyMsg.MsgInfo("发卡失败! 证件【" + FrmMain.userInfo.Number + "】已经办理了卡业务,请先到窗口注销后再继续办理!"); // return; //} //if (eLCardAuthorizationData != null) //{ // eLCardAuthorizationData.Tables[0].Rows.Clear(); //} if (k101.CheckCardPosition() == false) { MyMsg.MsgInfo("卡机状态不正确,不能继续发卡,请联系管理员!"); return; } string cardTemp = string.Empty; string cardType = SkyComm.getvalue("卡类型"); if (cardType == "磁条卡") { k101.MoveCard("移动到读磁卡位"); if (k101.MoveCard("移动到读磁卡位") == false) { k101.MoveCard("回收卡片"); MyMsg.MsgInfo("卡片传动失败,不能继续发卡,请联系管理员!"); return; } cardTemp = k101.ReadCard(); if (cardTemp == string.Empty) { k101.MoveCard("回收卡片"); MyMsg.MsgInfo("磁卡数据错误,或是空卡,不能继续发卡,请联系管理员!"); return; } FrmMain.cardInfoStruct.CardNo = cardTemp; string sql = "SELECT * FROM T_PRECARD WHERE CARDID = '" + cardTemp + "'"; //DataSet dsPre = new QuerySolutionFacade().ExecCustomQuery(sql); //if (dsPre.Tables[0].Rows.Count <= 0) //{ // k101.MoveCard("回收卡片"); // MyMsg.MsgInfo("卡片数据非法,请重试发卡,或联系管理员!"); // return; //} //ConditionStr = " AND B.CARDID='" + cardTemp + "' AND (B.CIRCUIT_STATE=0 OR B.CIRCUIT_STATE=1) "; //pdata = pfacade.FindCardPatientinfoByCondition(ConditionStr); //if (pdata != null && pdata.Tables[0].Rows.Count > 0) //{ // k101.MoveCard("回收卡片"); // MyMsg.MsgInfo("发卡失败! 卡片损坏,请重试发卡!"); // return; //} } string CardNo = cardTemp; SkyComm skyComm = new SkyComm(); skyComm.CreatCard(CardNo, FrmMain.userInfo.Name, FrmMain.userInfo.Number, FrmMain.userInfo.Address, sumChargeMoney); bool isSuccess = true; if (cardType == "IC卡") { k101.MoveCard("传动到IC卡位"); if (k101.MoveCard("传动到IC卡位") == false) { k101.MoveCard("回收卡片"); MyMsg.MsgInfo("卡片传动失败,不能继续发卡,请通过补办卡重新发卡!"); return; } //写卡,如果失败则重试 int state = -1; while (0 != state) { state = k101.WriteCard(CardNo); if (state != 0) { MyAlert my = new MyAlert(); my.Msg = "写卡失败,是否重试?"; my.alerttype = "确认取消"; if (my.ShowDialog() == DialogResult.OK) { state = -1; } else { state = 0; } isSuccess = false; } else { isSuccess = true; } } } if (!string.IsNullOrEmpty(cardTemp)) { if (isSuccess == true) { //吐出卡片 if (k101.MoveCard("传动到前端夹卡位") == false) { MyMsg.MsgInfo("吐卡失败!请通过补办卡重新发卡!"); isSuccess = false; } else { isSuccess = true; MyMsg.MsgInfo("发卡成功!"); } } if (isSuccess == false) { k101.MoveCard("回收卡片"); //CardFreezeThawData eCardFreezeThawData = (CardFreezeThawData)eCardAuthorizationFacade.SelectPatientAndCardInfoByAccount_ID_FREEZE_THAW(eLCardAuthorizationData.Tables[0].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_ACCOUNT_ID].ToString()); //20100616 mzq //if (eCardFreezeThawData.Tables[0].Rows.Count <= 0) //{ // MyMsg.MsgInfo("此操作没有找到所要挂失的卡信息!"); // return; //} //eCardFreezeThawData.Tables["T_CARD_FREEZE_THAW_ATHU"].Rows[0].BeginEdit(); ////冻结时间 //eCardFreezeThawData.Tables["T_CARD_FREEZE_THAW_ATHU"].Rows[0][CardFreezeThawData.T_CARD_FREEZE_THAW_LOCKDATE] = DateTime.Now; //////冻结员 //eCardFreezeThawData.Tables["T_CARD_FREEZE_THAW_ATHU"].Rows[0][CardFreezeThawData.T_CARD_FREEZE_THAW_LOCKOPERATOR] = SysOperatorInfo.OperatorID; //eCardFreezeThawData.Tables["T_CARD_FREEZE_THAW_ATHU"].Rows[0].EndEdit(); //1.在中间层更新发卡表T_CARD_AUTHORIZATION的CIRCUIT_STATE为1(冻结状态)信息 //2.在中间层插入T_CARD_FREEZE_THAW表信息 //CardFreezeThawaFcade eCardFreezeThawaFcade = new CardFreezeThawaFcade(); //eCardFreezeThawaFcade.insertEntity(eCardFreezeThawData); MyMsg.MsgInfo("写卡失败,请通过补办卡重新发卡!"); //this.eLCardAuthorizationData = (CardAuthorizationData)eCardAuthorizationFacade.SelectPatientAndCardInfoByCardID(eLCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_CARDID].ToString()); } } } catch (Exception err) { k101.MoveCard("回收卡片"); MyMsg.MsgInfo("吐卡失败!请重试自助发卡!" + err.Message); //this.eLCardAuthorizationData.Clear(); } }
private void office1_Click(object sender, EventArgs e) { if (this.itemClick != null) { this.itemClick(true); } OfficeItem list = sender as OfficeItem; string oficeId = list.lblOfficeId.Text; string ofice = list.lblOffice.Text; try { string[] officename = SkyComm.getvalue("科室挂号开始时间").Split('|'); for (int i = 0; i < officename.Length; i++) { if (ofice == officename[i].Split('/')[0].ToString()) { DateTime Hourset = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd") + " " + officename[i].Split('/')[1].ToString());//拼接凑成正确时间格式 DateTime Hournow = new CommonFacade().GetServerDateTime(); if (Hournow < Hourset) { MyAlert frm1 = new MyAlert(AlertTypeenum.信息, "未到放号时间,暂时不能挂号!"); frm1.ShowDialog(); return; } } } } catch (Exception ex) { MyAlert frm1 = new MyAlert(AlertTypeenum.信息, "科室挂号开始时间配置有误,请检查!"); frm1.ShowDialog(); return; } //douyaming 2016-05-05 CASE:24356 if (ofice.Contains("妇") || ofice.Contains("产")) { if (SkyComm.eCardAuthorizationData.Tables[0].Rows.Count > 0 && SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["SEX"].ToString() != "女") { MyAlert frmAlter = new MyAlert(AlertTypeenum.信息, "当前性别【" + SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["SEX"].ToString() + "】不能进行【" + ofice + "】就诊!"); frmAlter.ShowDialog(); return; } } //wangchao 2016.10.27 case:25866 if (ofice.Contains("儿")) { if (SkyComm.eCardAuthorizationData.Tables[0].Rows.Count > 0 && SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["AGEUNIT"].ToString().Contains("岁")) { string ageString = SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["AGE"].ToString().Trim(); if (ageString != "" && Convert.ToInt32(ageString) > 18) { MyAlert frmAlter = new MyAlert(AlertTypeenum.信息, "当前患者年龄超过18岁,不允许就诊【" + ofice + "】!"); frmAlter.ShowDialog(); return; } } } string mOfficeMessage = ""; mOfficeMessage = SkyComm.getvalue(oficeId); if (!string.IsNullOrEmpty(mOfficeMessage)) { SkyComm.ShowMessageInfo(mOfficeMessage); } FrmDoctorChoose frm = new FrmDoctorChoose(); frm.officeId = oficeId; frm.office = ofice; frm.ShowDialog(this); frm.Dispose(); if (this.itemClick != null) { this.itemClick(false); } }
private void Saving(decimal money) { if (eCardSavingFacade == null) { eCardSavingFacade = new CardSavingFacade(); } if (SkyComm.eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows.Count <= 0) { MyAlert frm = new MyAlert(AlertTypeenum.信息, "此操作没有找到所需要的患者信息!"); frm.ShowDialog(); return; } DataSet cardSavingData = new DataSet(); POSBase Posfac = IPOSFactory.CreateIPOS(AutoHostConfig.PosInterfaceType); if (Posfac == null) { SkyComm.ShowMessageInfo("银联POS接口配置不正确,请与管理员联系!"); return; } ValidateCode vc = new ValidateCode(); string HisSeqNo = string.Empty; HisSeqNo = DateTime.Now.ToString("yyMMddHHmmss") + SysOperatorInfo.OperatorID + vc.GenValidateCode(4); #region 住院预交金充值 AdvanceRecordData AdvData = new AdvanceRecordData(); DataRow dr = AdvData.Tables[0].NewRow(); dr[AdvanceRecordData.H_ADVANCE_RECORD_ADVANCEID] = "新增"; dr[AdvanceRecordData.H_ADVANCE_RECORD_BUSINESSBANK] = HisSeqNo; dr[AdvanceRecordData.H_ADVANCE_RECORD_CANCELMARK] = 0; dr[AdvanceRecordData.H_ADVANCE_RECORD_CHEQUEID] = ""; dr[AdvanceRecordData.H_ADVANCE_RECORD_CURRENTINHOSMARK] = inHosData.Tables[0].Rows[0]["CURRENTINHOSMARK"].ToString();; dr[AdvanceRecordData.H_ADVANCE_RECORD_INHOSID] = inHosData.Tables[0].Rows[0]["INHOSID"].ToString(); dr[AdvanceRecordData.H_ADVANCE_RECORD_OFFICEID] = inHosData.Tables[0].Rows[0]["INHOSOFFICEID"].ToString();//this.txtZyks.Text; dr[AdvanceRecordData.H_ADVANCE_RECORD_OPERATEDATE] = new CommonFacade().GetServerDateTime(); dr[AdvanceRecordData.H_ADVANCE_RECORD_OPERATORID] = SysOperatorInfo.OperatorID; dr[AdvanceRecordData.H_ADVANCE_RECORD_PAYMODEID] = SkyComm.getvalue("住院预交金充值方式_银行卡").ToString(); dr[AdvanceRecordData.H_ADVANCE_RECORD_PAYMONEY] = RechargeMoney; dr[AdvanceRecordData.H_ADVANCE_RECORD_RECEIPTID] = string.Empty; AdvData.Tables[0].Rows.Add(dr); AdvanceRecordFacade theAdvanceRecordFacade = new AdvanceRecordFacade(); #endregion string advanceid = string.Empty; Hashtable BankTranht = new Hashtable(); BankTranht.Add("SEQNO", HisSeqNo); BankTranht.Add("MONEY", money); BankTranht.Add("OPERATORID", SysOperatorInfo.OperatorCode); BankTranht.Add("POSNO", AutoHostConfig.PosNo); BankTranht.Add("DIAGNOSEID", SkyComm.DiagnoseID); BankTranht.Add("CARDID", SkyComm.cardInfoStruct.CardNo); if (AutoHostConfig.PosInterfaceType.Equals("锡盟新利"))//锡盟新利 弹出错误提示 { try { Posfac.Trans("1", BankTranht); } catch (Exception ex) { SkyComm.ShowMessageInfo(ex.Message.ToString()); return; } } else { Posfac.Trans("1", BankTranht); } if (BankTranht["CARDNO"] != null) { eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_CHECKLOT] = BankTranht["CARDNO"].ToString(); eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_BANKCARDNO] = BankTranht["CARDNO"].ToString(); eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_BANKTRANSNO] = BankTranht["BANKSEQNO"].ToString(); } try { advanceid = theAdvanceRecordFacade.insertEntity(AdvData, false); Posfac.Trans("2", BankTranht); Savingsucceed = 1; } catch (Exception ex) { Skynet.LoggingService.LogService.GlobalInfoMessage("POS接口调用成功,HIS保存失败:" + ex.Message + "\r\n开始调用撤消方法"); SkyComm.ShowMessageInfo("预交金充值失败,需要撤销银行交易,请按POS机提示操作,点击确定后,请重新插入银行卡!"); Posfac.Trans("-2", BankTranht); Skynet.LoggingService.LogService.GlobalInfoMessage("POS接口调用成功,HIS失败,调用银行撤消完成!"); SkyComm.ShowMessageInfo("银行交易失败,充值金额已退回卡,请重新充值!"); //SkynetMessage.MsgInfo("HIS充值失败:"+ex.Message); return; } //SkyComm.GetCardBalance(); if (Savingsucceed == 1) { string receiptID = theAdvanceRecordFacade.GetReceiptIDByAdvanceID(advanceid); //打印充值凭证 PrintInfo("住院预交金充值凭证", receiptID, money.ToString(), advanceid, HisSeqNo); decimal old_YE = Convert.ToDecimal(inHosData.Tables[0].Rows[0]["BALANCEMONEY"].ToString()); SkyComm.ShowMessageInfo("您成功充值" + money + "元!卡中余额" + (old_YE + money).ToString("0.00##") + "元!"); string _isPrint = SkyComm.getvalue("锡盟预交款打印凭证"); //Case 31629 锡盟预交款打印凭证 _isPrint = string.IsNullOrEmpty(_isPrint) ? "0" : "1"; if (_isPrint.Equals("0")) { try { MoneyTransferPresenter moneyTransferPresenter = new MoneyTransferPresenter(); DataSet dataSet = moneyTransferPresenter.getBankInfo(SkyComm.DiagnoseID, HisSeqNo); dataSet.WriteXml(Application.StartupPath + @"\\ReportXml\\" + "银行pos凭证" + SkyComm.DiagnoseID + ".xml"); if (!File.Exists(Application.StartupPath + @"\\Reports\\" + "银行pos凭证" + ".frx")) { SkynetMessage.MsgInfo("银行pos凭证" + ".frx报表文件不存在,无法打印."); return; } //Common_XH theCamera_XH = new Common_XH(); //theCamera_XH.DoorLightOpen(LightTypeenum.凭条, LightOpenTypeenum.闪烁); PrintManager print = new PrintManager(); print.InitReport("银行pos凭证"); print.AddData(dataSet.Tables[0], "pos"); print.Print(); print.Dispose(); } catch (Exception e) { } } } SkyComm.CloseWin(this); }
private void lblCashStored_Click(object sender, EventArgs e) { btnEnd.Enabled = false; WaitDialogForm form = new WaitDialogForm("正在存钞中,请稍候...", "正在组织数据,请稍候......", new Size(240, 60)); try { MoneyServer.NotAllowCashin(); //拍照,纸币器 switch (AutoHostConfig.ReadCardType) { case "XUHUI": AutoServiceSDK.SdkService.Common_XH camera = new AutoServiceSDK.SdkService.Common_XH(); camera.TakeCameraEnd(); camera.DoorLightClose(LightTypeenum.纸币器); break; default: break; } timer2.Stop(); timer1.Stop(); #region 休眠3秒以后重新获取纸币金额 Thread.Sleep(5000); Skynet.LoggingService.LogService.GlobalInfoMessage("在结束预存之后休眠2秒重新获取存钞明细"); int InMoney = MoneyServer.GetInMoney(AutoHostConfig.Machineno, SysOperatorInfo.OperatorID); Skynet.LoggingService.LogService.GlobalInfoMessage("在结束预存之后重新获取存钞明细金额:" + InMoney); if (InMoney > 0) { //投入数量 int intOld = Convert.ToInt32(lblAmount.Text) + 1; lblAmount.Text = intOld.ToString(); //投入金额 RechargeMoney += Convert.ToDecimal(InMoney); RechargeMoney = DecimalRound.Round(RechargeMoney, 2); lblMoney.Text = RechargeMoney.ToString(); } #endregion if (RechargeMoney == 0) { btnClose_Click(null, null); return; } lblNoPaymentCharge.Enabled = true; ucTime1.timer1.Stop(); if (eCardSavingFacade == null) { eCardSavingFacade = new CardSavingFacade(); } if (eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows.Count <= 0) { MyAlert frm = new MyAlert(AlertTypeenum.信息, "此操作没有找到所要充值的卡信息!"); frm.ShowDialog(); return; } eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0].BeginEdit(); //卡号 eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_CARDID] = SkyComm.cardInfoStruct.CardNo; //充值时间 eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_OPERATETIME] = new CommonFacade().GetServerDateTime(); ////操作员 eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_OPERATOR] = SysOperatorInfo.OperatorID; ////充值类型 eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_SAVINGMODE] = 1; ////Add money Skynet.LoggingService.LogService.GlobalInfoMessage("现金发卡保存数据设置押金之前"); if (CallType == 2) { Decimal deposit = Convert.ToDecimal(SkyComm.getvalue("发卡工本费")); eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_ADDMONEY] = RechargeMoney - Convert.ToDecimal(SkyComm.dsCardType.Tables[0].Rows[0]["FEES"]) - deposit; } else { eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_ADDMONEY] = RechargeMoney; } Skynet.LoggingService.LogService.GlobalInfoMessage("现金发卡保存数据设置押金之后"); //业务类型 eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_BUSSNESSTYPE] = "充值"; //支付方式 eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_MODETYPE] = SkyComm.AddMoneyCashMode; //单位 eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_UNIT] = ""; //支票号 eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_CHECKLOT] = ""; //充值数据来源 eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_ADDMONEYSOURCE] = AutoHostConfig.BankName; eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0].EndEdit(); ReckonAccountTimeFacade reckonAccountsTimeFacade = new ReckonAccountTimeFacade(); DateTime accountTime = reckonAccountsTimeFacade.GetEndTime(SysOperatorInfo.OperatorID, "门诊"); if (Convert.ToDateTime(eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_OPERATETIME]) < accountTime) { SkyComm.ShowMessageInfo("该时间段已经结帐,不能办理预交金业务,请重试!"); return; } DataSet cardSavingData = eCardSavingFacade.insertEntity(eCardAuthorizationData); SkyComm.GetCardBalance(); Skynet.LoggingService.LogService.GlobalInfoMessage("充值成功,调用类型:" + CallType); Savingsucceed = 1; if (CallType != 2) { //打印充值凭证 PrintInfo("自助充值凭证", cardSavingData.Tables[0].Rows[0]["TRANSACTION_ID"].ToString(), RechargeMoney.ToString()); } } catch (Exception ex) { SkyComm.ShowMessageInfo("存钞失败:" + ex.Message); Skynet.LoggingService.LogService.GlobalInfoMessage("存钞失败:" + ex.Message); } finally { MoneyServer.ClosePort(); form.Close(); form.Dispose(); btnEnd.Enabled = true; } Skynet.LoggingService.LogService.GlobalInfoMessage("充值成功,调用类型:" + CallType); if (CallType == 0) { FrmRechargeSuccessful frmRecharge = new FrmRechargeSuccessful(); frmRecharge.RechargeMoney = RechargeMoney; frmRecharge.ShowDialog(this); frmRecharge.Dispose(); SkyComm.CloseWin(this); } else if (CallType == 2) { SkyComm.CloseWin(this); } else { SkyComm.ShowMessageInfo("您成功充值" + RechargeMoney + "元!卡中余额" + SkyComm.cardBlance.ToString() + ""); SkyComm.CloseWin(this); } //GetMoeny(); }
private void identityCard_Click(object sender, EventArgs e) { if (SkyComm.getvalue("自助机类型") == "0") { #region 柜式自助机驱动 FrmReadIdenetityGS FrmReadIdenetity = new FrmReadIdenetityGS(); try { timer1.Stop(); if (FrmReadIdenetity.ShowDialog(this) == System.Windows.Forms.DialogResult.OK) { #region 验证卡状态 string CardID = FrmReadIdenetity.strCardNO; BusinessFacade.His.CardClubManager.CardAuthorizationFacade eCardAuthorizationFacade = new BusinessFacade.His.CardClubManager.CardAuthorizationFacade(); if (SystemInfo.SystemConfigs["是否启用就诊卡与副卡关联"].DefaultValue.ToString() == "1") { bool isSecondaryCard = false;//是否副卡 CardID = eCardAuthorizationFacade.GetMotherCardID(CardID, "", ref isSecondaryCard); } CardAuthorizationData eCardAuthorizationData = (CardAuthorizationData)eCardAuthorizationFacade.SelectPatientAndCardInfoByCardID(CardID); if (eCardAuthorizationData.Tables[0].Rows.Count == 0) { MyAlert registerInfo = new MyAlert(AlertTypeenum.信息, "卡号无效"); registerInfo.ShowDialog(); this.Close(); return; } CardID = eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_CARDID].ToString(); if (!string.IsNullOrEmpty(CardID)) { if (Convert.ToInt32(eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_CIRCUIT_STATE]) == 1) { MyAlert registerInfo = new MyAlert(AlertTypeenum.信息, "此卡已挂失不能使用!"); registerInfo.ShowDialog(); this.Close(); return; } if (Convert.ToInt32(eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_CIRCUIT_STATE]) == 2) { MyAlert registerInfo = new MyAlert(AlertTypeenum.信息, "此卡已注销不能使用"); registerInfo.ShowDialog(); this.Close(); return; } if (Skynet.Framework.Common.SystemInfo.SystemConfigs["是否启用卡有效期"].DefaultValue.Equals("1")) { var dtCard = eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].AsEnumerable(); _isVilid = dtCard.Where(a => a.Field <DateTime>(CardAuthorizationData.T_CARD_AUTHORIZATION_CARDVALIDDATE) <= DateTime.Now).ToList().Count > 0 ? true : false; if (_isVilid) { MyAlert registerInfo = new MyAlert(AlertTypeenum.信息, "该卡已经过了有效期,请联系管理员!"); registerInfo.ShowDialog(); this.Close(); return; } } } else { MyAlert registerInfo = new MyAlert(AlertTypeenum.信息, "请持身份证在窗口签约"); registerInfo.ShowDialog(); this.Close(); return; } #endregion SkyComm.cardInfoStruct.CardNo = CardID; SkyComm.DiagnoseID = eCardAuthorizationData.Tables[0].Rows[0]["DIAGNOSEID"].ToString(); SkyComm.cardInfoStruct.isIdentityCard = true; CardRead cardUtility = new CardRead(this); strMsg = cardUtility.GetPatiantInfo(); this.DialogResult = DialogResult.OK; } timer1.Start(); } catch (Exception ex) { timer1.Start(); FrmReadIdenetity.Dispose(); Skynet.LoggingService.LogService.GlobalInfoMessage("读取居民身份证信息失败:" + ex.Message); return; } finally { FrmReadIdenetity.Dispose(); } #endregion } else { #region 壁挂式自助机驱动 FrmReadIdenetityBG FrmReadIdenetity = new FrmReadIdenetityBG(); try { timer1.Stop(); if (FrmReadIdenetity.ShowDialog(this) == System.Windows.Forms.DialogResult.OK) { #region 验证卡状态 string CardID = FrmReadIdenetity.strCardNO; BusinessFacade.His.CardClubManager.CardAuthorizationFacade eCardAuthorizationFacade = new BusinessFacade.His.CardClubManager.CardAuthorizationFacade(); if (SystemInfo.SystemConfigs["是否启用就诊卡与副卡关联"].DefaultValue.ToString() == "1") { bool isSecondaryCard = false;//是否副卡 CardID = eCardAuthorizationFacade.GetMotherCardID(CardID, "", ref isSecondaryCard); } CardAuthorizationData eCardAuthorizationData = (CardAuthorizationData)eCardAuthorizationFacade.SelectPatientAndCardInfoByCardID(CardID); if (eCardAuthorizationData.Tables[0].Rows.Count == 0) { MyAlert registerInfo = new MyAlert(AlertTypeenum.信息, "卡号无效"); registerInfo.ShowDialog(); this.Close(); return; } CardID = eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_CARDID].ToString(); if (!string.IsNullOrEmpty(CardID)) { if (Convert.ToInt32(eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_CIRCUIT_STATE]) == 1) { MyAlert registerInfo = new MyAlert(AlertTypeenum.信息, "此卡已挂失不能使用!"); registerInfo.ShowDialog(); this.Close(); return; } if (Convert.ToInt32(eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_CIRCUIT_STATE]) == 2) { MyAlert registerInfo = new MyAlert(AlertTypeenum.信息, "此卡已注销不能使用"); registerInfo.ShowDialog(); this.Close(); return; } if (Skynet.Framework.Common.SystemInfo.SystemConfigs["是否启用卡有效期"].DefaultValue.Equals("1")) { var dtCard = eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].AsEnumerable(); _isVilid = dtCard.Where(a => a.Field <DateTime>(CardAuthorizationData.T_CARD_AUTHORIZATION_CARDVALIDDATE) <= DateTime.Now).ToList().Count > 0 ? true : false; if (_isVilid) { MyAlert registerInfo = new MyAlert(AlertTypeenum.信息, "该卡已经过了有效期,请联系管理员!"); registerInfo.ShowDialog(); this.Close(); return; } } } else { MyAlert registerInfo = new MyAlert(AlertTypeenum.信息, "请持身份证在窗口签约"); registerInfo.ShowDialog(); this.Close(); return; } #endregion SkyComm.cardInfoStruct.CardNo = CardID; SkyComm.DiagnoseID = eCardAuthorizationData.Tables[0].Rows[0]["DIAGNOSEID"].ToString(); SkyComm.cardInfoStruct.isIdentityCard = true; CardRead cardUtility = new CardRead(this); strMsg = cardUtility.GetPatiantInfo(); this.DialogResult = DialogResult.OK; } timer1.Start(); } catch (Exception ex) { timer1.Start(); FrmReadIdenetity.Dispose(); Skynet.LoggingService.LogService.GlobalInfoMessage("读取居民身份证信息失败:" + ex.Message); return; } finally { FrmReadIdenetity.Dispose(); } #endregion } }
private void lblOk_Click(object sender, EventArgs e) { try { if (Convert.ToDateTime(BespeakDataset.Tables[0].Rows[0]["BESPEAKDATE"].ToString()).Date == DateTime.Now.Date) //如果预约时间为当天,则调用挂号方法,重新组织数据 { if (registerInfoData.Tables.Count > 0 && registerInfoData.Tables[0].Rows.Count > 0) { registerInfoData.Tables[0].Rows.Clear(); } DataRow rowReg = registerInfoData.Tables[0].NewRow(); int i = registerInfoData.Tables[0].Rows.Count + 1; rowReg[RegisterInfoData.T_REGISTER_INFO_REGISTERID] = "新增" + i.ToString(); rowReg[RegisterInfoData.T_REGISTER_INFO_CANCELMARK] = "0"; rowReg[RegisterInfoData.T_REGISTER_INFO_OPERATORID] = SysOperatorInfo.OperatorID; rowReg[RegisterInfoData.T_REGISTER_INFO_OPERATEDATE] = new CommonFacade().GetServerDateTime(); rowReg[RegisterInfoData.T_REGISTER_INFO_CHARGEMARK] = 0; rowReg[RegisterInfoData.T_REGISTER_INFO_PATIENTNAME] = patientData.Tables[0].Rows[0]["PATIENTNAME"].ToString(); rowReg[RegisterInfoData.T_REGISTER_INFO_SEX] = patientData.Tables[0].Rows[0]["SEX"].ToString(); rowReg[RegisterInfoData.T_REGISTER_INFO_REGISTEROFFICEID] = BespeakDataset.Tables[0].Rows[0]["BESPEAKOFFICEID"].ToString(); rowReg[RegisterInfoData.T_REGISTER_INFO_OFFICE] = BespeakDataset.Tables[0].Rows[0]["BESPEAKOFFICENAME"].ToString(); rowReg[RegisterInfoData.T_REGISTER_INFO_REGISTERCLASS] = REGISTERCLASS; rowReg[RegisterInfoData.T_REGISTER_INFO_DOCTORID] = BespeakDataset.Tables[0].Rows[0]["BESPEAKDOCTORID"].ToString(); rowReg[RegisterInfoData.T_REGISTER_INFO_USERNAME] = BespeakDataset.Tables[0].Rows[0]["BESPEAKDOCTORNAME"].ToString(); rowReg[RegisterInfoData.T_REGISTER_INFO_CASECOST] = Gbf; rowReg[RegisterInfoData.T_REGISTER_INFO_BESPEAKMONEY] = 0;//预约费 rowReg[RegisterInfoData.T_REGISTER_INFO_REGISTERFEE] = Ghf; rowReg[RegisterInfoData.T_REGISTER_INFO_CARDID] = SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["CARDID"].ToString(); rowReg[RegisterInfoData.T_REGISTER_INFO_EXAMINEMONEY] = Zj; rowReg[RegisterInfoData.T_REGISTER_INFO_BESPEAKID] = ""; rowReg[RegisterInfoData.T_REGISTER_INFO_DIAGNOSEID] = SkyComm.DiagnoseID; rowReg[RegisterInfoData.T_REGISTER_INFO_AGE] = patientData.Tables[0].Rows[0]["AGE"].ToString(); rowReg[RegisterInfoData.T_REGISTER_INFO_AGEUNIT] = patientData.Tables[0].Rows[0]["AGEUNIT"].ToString(); rowReg[RegisterInfoData.T_REGISTER_INFO_ADDRESS] = patientData.Tables[0].Rows[0]["ADDRESS"].ToString(); rowReg[RegisterInfoData.T_REGISTER_INFO_TELEPHONE] = patientData.Tables[0].Rows[0]["TELEPHONE"].ToString(); OfficeFacade officeFacade = new OfficeFacade(); DataSet officeSet = officeFacade.QueryByOfficeType(26, ""); DataRow officeRow = officeSet.Tables[0].AsEnumerable().FirstOrDefault(o => o.Field <string>("OFFICEID") == BespeakDataset.Tables[0].Rows[0]["BESPEAKOFFICEID"].ToString()); rowReg[RegisterInfoData.T_REGISTER_INFO_OFFICEADDRESS] = officeRow["OFFICEADDRESS"].ToString().Trim(); rowReg[RegisterInfoData.T_REGISTER_INFO_DIAGNOSESTATE] = 0; rowReg[RegisterInfoData.T_REGISTER_INFO_CHECKFEE] = jcf; rowReg[RegisterInfoData.T_REGISTER_INFO_WORKTYPE] = BespeakDataset.Tables[0].Rows[0]["WORKTYPE"].ToString(); rowReg[RegisterInfoData.T_REGISTER_INFO_ARRANAGERECORDID] = BespeakDataset.Tables[0].Rows[0]["ARRANAGERECORDID"].ToString(); //if (SystemInfo.SystemConfigs["是否启用分时预约"] != null && SystemInfo.SystemConfigs["是否启用分时预约"].DefaultValue == "1") //{ rowReg[RegisterInfoData.T_REGISTER_INFO_QUEUEID] = BespeakDataset.Tables[0].Rows[0]["QUEUEID"].ToString(); //} rowReg[RegisterInfoData.T_REGISTER_INFO_BIRTHDAY] = patientData.Tables[0].Rows[0]["BIRTHDAY"].ToString(); rowReg[RegisterInfoData.T_REGISTER_INFO_EXECDATE] = new CommonFacade().GetServerDateTime(); rowReg["BESPEAKDATE"] = Convert.ToDateTime(BespeakDataset.Tables[0].Rows[0]["BESPEAKDATE"].ToString()); rowReg["BESPEAKMODE"] = ""; decimal decMoney = Convert.ToDecimal(Ghf) + Convert.ToDecimal(Zj) + Convert.ToDecimal(Gbf) + Convert.ToDecimal(jcf); rowReg["CASHDEFRAY"] = decMoney; rowReg["ACCOUNTDEFRAY"] = 0; rowReg["DISCOUNTDEFRAY"] = 0; rowReg["BALANCEMARK"] = 2; rowReg["BALANCESTATE"] = 0; rowReg["BALANCESTATE"] = 0; rowReg["BALANCEMODE"] = "预交金";//结算方式 registerInfoData.Tables[0].Rows.Add(rowReg); bespeakFac = new BespeakRegisterFacade(); //ZHOUHU ADD 20180130 CASE:29222 string isRegContr = new OfficeFacade().FindByOfficeID(BespeakDataset.Tables[0].Rows[0]["BESPEAKOFFICEID"].ToString()).Tables[0].Rows[0]["ISREGCONTR"].ToString(); //chenqiang 2017-03-09 add by Case:27423 if ("1" == SystemInfo.SystemConfigs["挂号、预约限制条件"].DefaultValue && isRegContr == "1") { if (registerFacade.FindNowDateRegisterInfo(patientData.Tables[0].Rows[0]["DIAGNOSEID"].ToString(), BespeakDataset.Tables[0].Rows[0]["BESPEAKOFFICEID"].ToString(), Convert.ToDateTime(BespeakDataset.Tables[0].Rows[0]["BESPEAKDATE"].ToString()).Date) > 0) { MyAlert registerInfo = new MyAlert(AlertTypeenum.信息, "一位患者同天同科室限一个号,系统不允许挂号"); registerInfo.ShowDialog(); return; } if (bespeakFac.FindBespeakPatientInfo(BespeakDataset.Tables[0].Rows[0]["BESPEAKOFFICEID"].ToString(), Convert.ToDateTime(BespeakDataset.Tables[0].Rows[0]["BESPEAKDATE"].ToString()).Date, patientData.Tables[0].Rows[0]["IDENTITYCARD"].ToString(), patientData.Tables[0].Rows[0]["DIAGNOSEID"].ToString()) > 0) { MyAlert registerInfo = new MyAlert(AlertTypeenum.信息, "一位患者同天同科室限一个号,当天已有预约信息,系统不允许挂号"); registerInfo.ShowDialog(); return; } } //chenqiang 2017.06.16 add by Case:28088 if (registerFacade.FindNowDateRegisterInfo(registerInfoData.Tables[0].Rows[0]["DOCTORID"].ToString(), registerInfoData.Tables[0].Rows[0]["REGISTEROFFICEID"].ToString(), registerInfoData.Tables[0].Rows[0]["WORKTYPE"].ToString(), registerInfoData.Tables[0].Rows[0]["DIAGNOSEID"].ToString(), Convert.ToDateTime(registerInfoData.Tables[0].Rows[0]["OPERATEDATE"].ToString()).Date) > 0) { MyAlert registerInfo = new MyAlert(AlertTypeenum.信息, "一个患者同一个班次只能挂一个号,系统不允许挂号"); registerInfo.ShowDialog(); return; } if (bespeakFac.FindBespeakPatientInfo(registerInfoData.Tables[0].Rows[0]["DIAGNOSEID"].ToString(), registerInfoData.Tables[0].Rows[0]["DOCTORID"].ToString(), registerInfoData.Tables[0].Rows[0]["REGISTEROFFICEID"].ToString(), registerInfoData.Tables[0].Rows[0]["WORKTYPE"].ToString(), Convert.ToDateTime(registerInfoData.Tables[0].Rows[0]["OPERATEDATE"].ToString()).Date) > 0) { MyAlert registerInfo = new MyAlert(AlertTypeenum.信息, "一个患者同一个班次只能挂一个号,系统不允许挂号"); registerInfo.ShowDialog(); return; } string ss = SystemInfo.SystemConfigs["院内就诊卡模式"].DefaultValue.ToString(); DataSet ds = this.registerFacade.insertEntityForFZBD(this.registerInfoData); MyAlert frmAlter = new MyAlert(AlertTypeenum.信息, "挂号成功!"); frmAlter.ShowDialog(); //输出挂号凭证 if (null == ds.Tables[0].Columns["EXAMINENAME"]) { DataColumn col = new DataColumn("EXAMINENAME", typeof(System.String)); col.Caption = "EXAMINENAME"; ds.Tables[0].Columns.Add(col); } if (!ds.Tables[0].Columns.Contains("EXAMINELOC")) { ds.Tables[0].Columns.Add("EXAMINELOC"); } UsersFacade uf = new UsersFacade(); foreach (DataRow row in ds.Tables[0].Rows) { string keyval = row["DOCTORID"].ToString(); if (keyval != "-1") { row["EXAMINENAME"] = uf.FindByUserInfo(keyval).Tables[0].Rows[0]["EXAMINENAME"].ToString(); } 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"] = ""; } } } SkyComm.GetCardBalance(); PrintReport(ds, "自助挂号"); // PrintTriageInfo(ds.Tables[0], theServerTime); } else { DataRow dr = BespeakDataset.Tables[0].Rows[0]; dr["PATIENTNAME"] = patientData.Tables[0].Rows[0]["PATIENTNAME"].ToString(); dr["TELEPHONE"] = patientData.Tables[0].Rows[0]["TELEPHONE"].ToString(); dr["IDENTITYCARD"] = patientData.Tables[0].Rows[0]["IDENTITYCARD"].ToString(); dr["SEX"] = patientData.Tables[0].Rows[0]["SEX"].ToString(); //判断是否已经预约 DataSet dsBespeak = new DataSet(); if (!string.IsNullOrEmpty(patientData.Tables[0].Rows[0]["IDENTITYCARD"].ToString())) { dsBespeak = bespeakFac.FindBespeakInfoByIdentityOrDiagnoseId(BespeakDataset.Tables[0].Rows[0]["BESPEAKOFFICEID"].ToString(), BespeakDataset.Tables[0].Rows[0]["BESPEAKDOCTORID"].ToString(), Convert.ToDateTime(BespeakDataset.Tables[0].Rows[0]["BESPEAKDATE"].ToString()), BespeakDataset.Tables[0].Rows[0]["WORKTYPE"].ToString(), patientData.Tables[0].Rows[0]["IDENTITYCARD"].ToString(), "", patientData.Tables[0].Rows[0]["PATIENTNAME"].ToString()); } else { dsBespeak = bespeakFac.FindBespeakInfoByIdentityOrDiagnoseId(BespeakDataset.Tables[0].Rows[0]["BESPEAKOFFICEID"].ToString(), BespeakDataset.Tables[0].Rows[0]["BESPEAKDOCTORID"].ToString(), Convert.ToDateTime(BespeakDataset.Tables[0].Rows[0]["BESPEAKDATE"].ToString()), BespeakDataset.Tables[0].Rows[0]["WORKTYPE"].ToString(), "", patientData.Tables[0].Rows[0]["DIAGNOSEID"].ToString(), ""); } if (Convert.ToInt16(dsBespeak.Tables[0].Rows[0][0]) > 0) { MyAlert frm = new MyAlert(AlertTypeenum.信息, Convert.ToDateTime(BespeakDataset.Tables[0].Rows[0]["BESPEAKDATE"].ToString()).ToShortDateString() + "已有预约信息,不能再次预约!"); frm.ShowDialog(); return; } //ZHOUHU ADD 20180130 CASE:29222 string isRegContr = new OfficeFacade().FindByOfficeID(BespeakDataset.Tables[0].Rows[0]["BESPEAKOFFICEID"].ToString()).Tables[0].Rows[0]["ISREGCONTR"].ToString(); //chenqiang 2017-03-09 add by Case:27423 if ("1" == SystemInfo.SystemConfigs["挂号、预约限制条件"].DefaultValue && isRegContr == "1") { bespeakFac = new BespeakRegisterFacade(); if (registerFacade.FindNowDateRegisterInfo(patientData.Tables[0].Rows[0]["DIAGNOSEID"].ToString(), BespeakDataset.Tables[0].Rows[0]["BESPEAKOFFICEID"].ToString(), Convert.ToDateTime(BespeakDataset.Tables[0].Rows[0]["BESPEAKDATE"].ToString()).Date) > 0) { MyAlert registerInfo = new MyAlert(AlertTypeenum.信息, "一位患者同天同科室限一个号,系统不允许挂号"); registerInfo.ShowDialog(); return; } if (bespeakFac.FindBespeakPatientInfo(BespeakDataset.Tables[0].Rows[0]["BESPEAKOFFICEID"].ToString(), Convert.ToDateTime(BespeakDataset.Tables[0].Rows[0]["BESPEAKDATE"].ToString()).Date, patientData.Tables[0].Rows[0]["IDENTITYCARD"].ToString(), patientData.Tables[0].Rows[0]["DIAGNOSEID"].ToString()) > 0) { MyAlert registerInfo = new MyAlert(AlertTypeenum.信息, "一位患者同天同科室限一个号,当天已有预约信息,系统不允许挂号"); registerInfo.ShowDialog(); return; } } //chenqiang 2017.06.16 add by Case:28088 if (registerFacade.FindNowDateRegisterInfo(BespeakDataset.Tables[0].Rows[0]["BESPEAKDOCTORID"].ToString(), BespeakDataset.Tables[0].Rows[0]["BESPEAKOFFICEID"].ToString(), BespeakDataset.Tables[0].Rows[0]["WORKTYPE"].ToString(), patientData.Tables[0].Rows[0]["DIAGNOSEID"].ToString(), Convert.ToDateTime(BespeakDataset.Tables[0].Rows[0]["BESPEAKDATE"].ToString()).Date) > 0) { MyAlert registerInfo = new MyAlert(AlertTypeenum.信息, "一个患者同一个班次只能挂一个号,系统不允许挂号"); registerInfo.ShowDialog(); return; } if (bespeakFac.FindBespeakPatientInfo(patientData.Tables[0].Rows[0]["DIAGNOSEID"].ToString(), BespeakDataset.Tables[0].Rows[0]["BESPEAKDOCTORID"].ToString(), BespeakDataset.Tables[0].Rows[0]["BESPEAKOFFICEID"].ToString(), BespeakDataset.Tables[0].Rows[0]["WORKTYPE"].ToString(), Convert.ToDateTime(BespeakDataset.Tables[0].Rows[0]["OPERATEDATE"].ToString()).Date) > 0) { MyAlert registerInfo = new MyAlert(AlertTypeenum.信息, "一个患者同一个班次只能挂一个号,系统不允许挂号"); registerInfo.ShowDialog(); return; } //chenqiang add by case:33511 if (SystemInfo.SystemConfigs["是否启用号源云平台接口"].DefaultValue != "0") { if (BespeakDataset.Tables[0].Rows.Count > 1) { MyAlert registerInfo = new MyAlert(AlertTypeenum.信息, "在启用号源接口时,同一次只能预约一个医生!"); registerInfo.ShowDialog(); return; } } BespeakDataset = (BespeakRegisterData)bespeakFac.insertBespeakEntityReturn(BespeakDataset, patientData, 1); //chenqiang add by case:33511 if (SystemInfo.SystemConfigs["是否启用号源云平台接口"].DefaultValue != "0") { if (arrangeSource == "1" && Convert.ToDateTime(BespeakDataset.Tables[0].Rows[0]["BESPEAKDATE"].ToString()).Date != new CommonFacade().GetServerDateTime().Date) { RegisterClouldInterface theRegisterClouldInterface = new RegisterClouldInterface(); int intResult = theRegisterClouldInterface.BespeakRegisteInfo(BespeakDataset); if (intResult < 0) { bespeakFac.CancelBespeak(BespeakDataset.Tables[0].Rows[0]["BESPEAKID"].ToString()); return; } } } MyAlert frmAlter = new MyAlert(AlertTypeenum.信息, "预约成功!"); frmAlter.ShowDialog(); PrintReport(BespeakDataset, "自助预约"); //预约成功后,发短信 try { Hashtable htPara = new Hashtable(); htPara.Add("@预约时间", Convert.ToDateTime(BespeakDataset.Tables[0].Rows[0]["BESPEAKDATE"]).ToString("MM月dd日HH时mm分")); string OfficeAddress = SysOperatorInfo.OperatorAreaname + BespeakDataset.Tables[0].Rows[0]["OFFICEADDRESS"].ToString(); htPara.Add("@科室位置", OfficeAddress); htPara.Add("@科室", BespeakDataset.Tables[0].Rows[0]["BESPEAKOFFICENAME"].ToString()); htPara.Add("@医生", BespeakDataset.Tables[0].Rows[0]["BESPEAKDOCTORNAME"].ToString()); htPara.Add("@排队号", BespeakDataset.Tables[0].Rows[0]["QUEUEID"].ToString()); htPara.Add("@预约号", BespeakDataset.Tables[0].Rows[0]["BESPEAKID"].ToString()); UMSMsgLib.UMSMsg.Instance.SendMsg(BespeakDataset.Tables[0].Rows[0]["TELEPHONE"].ToString(), "预约挂号", htPara); } catch (Exception ex) { Skynet.LoggingService.LogService.GlobalInfoMessage("预约成功后,发短信失败!" + ex.Message); } } SkyComm.CloseWin(this); } catch (Exception ex) { MyAlert frm = new MyAlert(AlertTypeenum.信息, ex.Message); frm.ShowDialog(); } }
private void TimeDetailItem1_Click(object sender, EventArgs e) { UcTimeDetailItem doctor = sender as UcTimeDetailItem; string order = doctor.lblOrder.Text; string time = doctor.lblTime.Text; DataRow dr = BespeakDataset.Tables[0].Rows[0]; dr["QUEUEID"] = order; DateTime dtCurrent = new CommonFacade().GetServerDateTime(); //if (Convert.ToDateTime(time).TimeOfDay < dtCurrent.TimeOfDay) //{ // time = dtCurrent.AddMinutes(20).TimeOfDay.ToString(); //} dr["BESPEAKDATE"] = Convert.ToDateTime(Convert.ToDateTime(dr["BESPEAKDATE"].ToString()).ToShortDateString() + " " + time); //Case #27421 string mEndTime = ""; foreach (DataRow row in DtTimeDetail.Rows) { mEndTime = row["DETAILTIME"].ToString(); } DateTime mDateTime = Convert.ToDateTime(Convert.ToDateTime(dr["BESPEAKDATE"]).ToString("yyyy-MM-dd") + " " + mEndTime); if (Convert.ToDateTime(dr["BESPEAKDATE"]) > mDateTime) { dr["BESPEAKDATE"] = mDateTime; } dr["OPERATEDATE"] = dtCurrent; if (this.itemClick != null) { this.itemClick(true); } //预约前先刷卡 if (string.IsNullOrEmpty(SkyComm.cardInfoStruct.CardNo)) { FrmMain frmM = new FrmMain(); int intResult = SkyComm.ReadCard("预约"); if (intResult == 0) { if (this.itemClick != null) { this.itemClick(false); } return; } } if (office.Contains("妇") || office.Contains("产")) { if (SkyComm.eCardAuthorizationData.Tables[0].Rows.Count > 0 && SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["SEX"].ToString() != "女") { MyAlert frmAlter = new MyAlert(AlertTypeenum.信息, "当前性别【" + SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["SEX"].ToString() + "】不能进行【" + office + "】就诊!"); frmAlter.ShowDialog(); if (this.itemClick != null) { this.itemClick(false); } return; } } //wangchao 2016.10.27 case:25866 if (office.Contains("儿")) { if (SkyComm.eCardAuthorizationData.Tables[0].Rows.Count > 0 && SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["AGEUNIT"].ToString().Contains("岁")) { string ageString = SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["AGE"].ToString().Trim(); if (ageString != "" && Convert.ToInt32(ageString) > 18) { MyAlert frmAlter = new MyAlert(AlertTypeenum.信息, "当前患者年龄超过18岁,不允许就诊【" + office + "】!"); frmAlter.ShowDialog(); if (this.itemClick != null) { this.itemClick(false); } return; } } } FrmBespeakConfirm frm = new FrmBespeakConfirm(); frm.BespeakDataset = BespeakDataset; frm.arrangeSource = arrangeSource; frm.arranageDetailSource = doctor.arranageDetailSource.Text; frm.ShowDialog(this); frm.Dispose(); if (this.itemClick != null) { this.itemClick(false); } }
public int OutCard(int sqadd, int blockAddr, IDCardInfo userInfo, decimal sumChargeMoney) { try { if (k101.CheckCardPosition() == false) { MyMsg.MsgInfo("卡机状态不正确,不能继续发卡,请联系管理员!"); return(-1); } // //吐出卡片 //k101.MoveCard("传动到前端夹卡位"); //MyMsg.MsgInfo("发卡成功!"); //return; string cardTemp = string.Empty; string cardType = Settings.Default.卡类型; if (cardType == "磁条卡") { k101.MoveCard("移动到读磁卡位"); if (k101.MoveCard("移动到读磁卡位") == false) { k101.MoveCard("回收卡片"); MyMsg.MsgInfo("卡片传动失败,不能继续发卡,请联系管理员!"); return(-1); } cardTemp = k101.ReadCard(); if (cardTemp == string.Empty) { k101.MoveCard("回收卡片"); MyMsg.MsgInfo("磁卡数据错误,或是空卡,不能继续发卡,请联系管理员!"); return(-1); } FrmMain.cardInfoStruct.CardNo = cardTemp; } string CardNo = cardTemp; if (Settings.Default.运行模式 == "RUN") { LogService.GlobalInfoMessage("调用发卡存储过程"); SkyComm skyComm = new SkyComm(); skyComm.CreatCard(CardNo, FrmMain.userInfo.Name, FrmMain.userInfo.Sex, Convert.ToDateTime(FrmMain.userInfo.Birthday), FrmMain.userInfo.Number, FrmMain.userInfo.Address, FrmMain.userInfo.People); LogService.GlobalInfoMessage("调用发卡存储过程成功"); } bool isSuccess = true; if (cardType == "IC卡") { LogService.GlobalInfoMessage("传动到IC卡位"); k101.MoveCard("传动到IC卡位"); if (k101.MoveCard("传动到IC卡位") == false) { LogService.GlobalInfoMessage("回收卡片"); k101.MoveCard("回收卡片"); MyMsg.MsgInfo("卡片传动失败,不能继续发卡,请通过补办卡重新发卡!"); return(-1); } //写卡,如果失败则重试 int state = -1; while (0 != state) { LogService.GlobalInfoMessage("写卡"); state = k101.WriteCard(CardNo); LogService.GlobalInfoMessage("写卡完成"); if (state != 0) { MyAlert my = new MyAlert(); my.Msg = "写卡失败,是否重试?"; my.alerttype = "确认取消"; if (my.ShowDialog() == DialogResult.OK) { state = -1; } else { state = 0; } isSuccess = false; } else { isSuccess = true; } } } if (!string.IsNullOrEmpty(cardTemp)) { if (isSuccess == true) { LogService.GlobalInfoMessage("传动到前端夹卡位"); //吐出卡片 if (k101.MoveCard("传动到前端夹卡位") == false) { LogService.GlobalInfoMessage("吐卡失败!请通过补办卡重新发卡!"); MyMsg.MsgInfo("吐卡失败!请通过补办卡重新发卡!"); isSuccess = false; return(-1); } else { LogService.GlobalInfoMessage("发卡成功"); isSuccess = true; MyMsg.MsgInfo("发卡成功!"); } } if (isSuccess == false) { LogService.GlobalInfoMessage("回收卡片"); k101.MoveCard("回收卡片"); MyMsg.MsgInfo("写卡失败,请通过补办卡重新发卡!"); return(-1); } } return(0); } catch (Exception err) { LogService.GlobalInfoMessage("吐卡失败!请重试自助发卡!" + err.Message); k101.MoveCard("回收卡片"); MyMsg.MsgInfo("吐卡失败!请重试自助发卡!" + err.Message); return(-1); } }
private void DoctorItem1_Click(object sender, EventArgs e) { UcDoctorItem doctor = sender as UcDoctorItem; DataRow dr = BespeakDataset.Tables[0].Rows[0]; dr["BESPEAKDOCTORID"] = doctor.lblDoctorId.Text; dr["BESPEAKDOCTORNAME"] = doctor.lblDoctorName.Text; dr["BESPEAKMODE"] = "自助预约"; dr["BESPEAKMODENAME"] = "自助预约"; dr["WORKTYPE"] = doctor.lblWorkType.Text.Replace("余号", ""); dr["USEMARK"] = 0; dr["CANCELMARK"] = 0; dr["INVOICEID"] = ""; dr["OVERTYPETIMES"] = 0; dr["CASHDEFRAY"] = 0; dr["ACCOUNTDEFRAY"] = 0; dr["DISCOUNTDEFRAY"] = 0; dr["OPERATORID"] = SysOperatorInfo.OperatorID; dr["OPERATORNAME"] = SysOperatorInfo.OperatorName; dr["STATE"] = 3; dr["STARTTIME"] = doctor.ONDUTY.Text; dr["ENDTIME"] = doctor.OFFDUTY.Text; dr["ARRANAGERECORDID"] = doctor.lblDetailId.Text; dr["ROLE"] = doctor.lblRole.Text; if (SystemInfo.SystemConfigs["是否启用分时预约"] == null || SystemInfo.SystemConfigs["是否启用分时预约"].DefaultValue == "0") { DateTime dtCurrent = new CommonFacade().GetServerDateTime(); //dr["QUEUEID"] = ""; dr["BESPEAKDATE"] = Convert.ToDateTime(Convert.ToDateTime(dr["BESPEAKDATE"].ToString()).ToShortDateString() + " " + doctor.lblOffduty.Text); dr["OPERATEDATE"] = dtCurrent; } BespeakModeFacade bespeakModeFac = new BespeakModeFacade(); DataSet BespeakModeDataset = (BespeakModeData)bespeakModeFac.FindAll(); if (BespeakModeDataset.Tables[0].Rows.Count > 0) { DataRow[] drr = BespeakModeDataset.Tables[0].Select("BESPEAKMODE='自助预约'"); if (drr.Length > 0) { dr["BESPEAKMONEY"] = DecimalRound.Round(Convert.ToDecimal(drr[0]["BESPEAKMONEY"].ToString()), 2).ToString(); } } string detailId = doctor.lblDetailId.Text; if (this.itemClick != null) { this.itemClick(true); } if (SystemInfo.SystemConfigs["是否启用分时预约"] != null && SystemInfo.SystemConfigs["是否启用分时预约"].DefaultValue == "1") { FrmTimeDetailChoose frm = new FrmTimeDetailChoose(); frm.detailId = detailId; frm.office = office; frm.DoctorRole = doctor.lblRole.Text; frm.BespeakDataset = BespeakDataset; frm.arrangeSource = doctor.arrangeSource.Text; frm.ShowDialog(this); frm.Dispose(); if (this.itemClick != null) { this.itemClick(false); } } else { //预约前先刷卡 if (string.IsNullOrEmpty(SkyComm.cardInfoStruct.CardNo)) { FrmMain frmM = new FrmMain(); int intResult = SkyComm.ReadCard("预约"); if (intResult == 0) { if (this.itemClick != null) { this.itemClick(false); } return; } } if (office.Contains("妇") || office.Contains("产")) { if (SkyComm.eCardAuthorizationData.Tables[0].Rows.Count > 0 && SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["SEX"].ToString() != "女") { MyAlert frmAlter = new MyAlert(AlertTypeenum.信息, "当前性别【" + SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["SEX"].ToString() + "】不能进行【" + office + "】就诊!"); frmAlter.ShowDialog(); if (this.itemClick != null) { this.itemClick(false); } return; } } //wangchao 2016.10.27 case:25866 if (office.Contains("儿")) { if (SkyComm.eCardAuthorizationData.Tables[0].Rows.Count > 0 && SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["AGEUNIT"].ToString().Contains("岁")) { string ageString = SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["AGE"].ToString().Trim(); if (ageString != "" && Convert.ToInt32(ageString) > 18) { MyAlert frmAlter = new MyAlert(AlertTypeenum.信息, "当前患者年龄超过18岁,不允许就诊【" + office + "】!"); frmAlter.ShowDialog(); if (this.itemClick != null) { this.itemClick(false); } return; } } } FrmBespeakConfirmWithoutTimeShare frm = new FrmBespeakConfirmWithoutTimeShare(); frm.BespeakDataset = BespeakDataset; frm.arrangeSource = doctor.arrangeSource.Text; frm.ShowDialog(this); frm.Dispose(); if (this.itemClick != null) { this.itemClick(false); } } }
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; }
private void Saving(decimal money) { if (eCardSavingFacade == null) { eCardSavingFacade = new CardSavingFacade(); } if (SkyComm.eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows.Count <= 0) { MyAlert frm = new MyAlert(AlertTypeenum.信息, "此操作没有找到所要充值的卡信息!"); frm.ShowDialog(); return; } eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0].BeginEdit(); //卡号 eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_CARDID] = SkyComm.cardInfoStruct.CardNo; //充值时间 eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_OPERATETIME] = new CommonFacade().GetServerDateTime(); ////操作员 eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_OPERATOR] = SysOperatorInfo.OperatorID; ////充值类型 eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_SAVINGMODE] = 1; Skynet.LoggingService.LogService.GlobalInfoMessage("发卡保存数据设置押金之前"); ////Add money if (CallType == 2) { Decimal deposit = Convert.ToDecimal(SkyComm.getvalue("发卡工本费")); eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_ADDMONEY] = money - Convert.ToDecimal(SkyComm.dsCardType.Tables[0].Rows[0]["FEES"]) - deposit; } else { eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_ADDMONEY] = money; //此处需调接口 } Skynet.LoggingService.LogService.GlobalInfoMessage("发卡保存数据设置押金之后"); //业务类型 eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_BUSSNESSTYPE] = "充值"; //支付方式 eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_MODETYPE] = SkyComm.AddMoneyPosMode; //单位 eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_UNIT] = ""; //支票号 eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_CHECKLOT] = ""; //充值数据来源 eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_ADDMONEYSOURCE] = AutoHostConfig.BankName; eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0].EndEdit(); ReckonAccountTimeFacade reckonAccountsTimeFacade = new ReckonAccountTimeFacade(); DateTime accountTime = reckonAccountsTimeFacade.GetEndTime(SysOperatorInfo.OperatorID, "门诊"); if (Convert.ToDateTime(eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_OPERATETIME]) < accountTime) { SkyComm.ShowMessageInfo("该时间段已经结帐,不能办理预交金业务,请重试!"); return; } DataSet cardSavingData = new DataSet(); POSBase Posfac = IPOSFactory.CreateIPOS(AutoHostConfig.PosInterfaceType); if (Posfac == null) { SkyComm.ShowMessageInfo("银联POS接口配置不正确,请与管理员联系!"); return; } ValidateCode vc = new ValidateCode(); string HisSeqNo = string.Empty; HisSeqNo = DateTime.Now.ToString("yyMMddHHmmss") + SysOperatorInfo.OperatorID + vc.GenValidateCode(4); Hashtable BankTranht = new Hashtable(); BankTranht.Add("SEQNO", HisSeqNo); BankTranht.Add("MONEY", money); BankTranht.Add("OPERATORID", SysOperatorInfo.OperatorCode); BankTranht.Add("POSNO", AutoHostConfig.PosNo); BankTranht.Add("DIAGNOSEID", SkyComm.DiagnoseID); BankTranht.Add("CARDID", SkyComm.cardInfoStruct.CardNo); Posfac.Trans("1", BankTranht); if (BankTranht["CARDNO"] != null) { eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_CHECKLOT] = BankTranht["CARDNO"].ToString(); eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_BANKCARDNO] = BankTranht["CARDNO"].ToString(); eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_BANKTRANSNO] = BankTranht["BANKSEQNO"].ToString(); } try { //if (SkynetMessage.MsgInfo("是否要充值成功?", true) == false) //{ // throw new Exception("操作操作测试放弃充值!"); //} cardSavingData = eCardSavingFacade.insertEntity(eCardAuthorizationData); Posfac.Trans("2", BankTranht); Savingsucceed = 1; } catch (Exception ex) { Skynet.LoggingService.LogService.GlobalInfoMessage("POS接口调用成功,HIS保存失败:" + ex.Message + "\r\n开始调用撤消方法"); SkynetMessage.MsgInfo("HIS充值失败,需要撤消银行交易,请按POS机提示操作!"); Posfac.Trans("-2", BankTranht); Skynet.LoggingService.LogService.GlobalInfoMessage("POS接口调用成功,HIS失败,调用银行撤消完成!"); //SkynetMessage.MsgInfo("HIS充值失败:"+ex.Message); return; } SkyComm.GetCardBalance(); if (CallType != 2) { //打印充值凭证 PrintInfo("自助充值凭证", cardSavingData.Tables[0].Rows[0]["TRANSACTION_ID"].ToString(), money.ToString()); if (CallType == 0) { FrmRechargeSuccessful frmRecharge = new FrmRechargeSuccessful(); frmRecharge.RechargeMoney = money; frmRecharge.ShowDialog(this); frmRecharge.Dispose(); SkyComm.CloseWin(this); } else { SkyComm.ShowMessageInfo("您成功充值" + money + "元!卡中余额" + SkyComm.cardBlance.ToString() + ""); SkyComm.CloseWin(this); } } else { DialogResult = System.Windows.Forms.DialogResult.OK; SkyComm.CloseWin(this); } //GetMoeny(); }