Esempio n. 1
0
        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;
        }
Esempio n. 2
0
        private void lblOK_Click(object sender, EventArgs e)
        {
            this.AnsyWorker(ui =>
            {
                ui.UpdateTitle("正在缴费中,请稍等...");

                ui.SynUpdateUI(() =>
                {
                    #region 验证缴费处方信息

                    DataTable dtMain = dsRecipe.Tables[0].DefaultView.ToTable();

                    IEnumerable <string> _CLINICRECIPEIDs = dtMain.AsEnumerable().Where(b => b.Field <bool>("PITCHON1") == true).Select(a => a.Field <string>("CLINICRECIPEID")).Distinct();
                    if (_CLINICRECIPEIDs.Count() == 0)
                    {
                        SkyComm.ShowMessageInfo("请选择要缴费的处方!");
                        return;
                    }
                    this.ucTime1.timer1.Stop();
                    //选中处方的金额
                    decimal sumMoney = DecimalRound.Round(Convert.ToDecimal(dtMain.Compute("SUM(TOTALMONEY)", "PITCHON1 = true")), 2);

                    ClinicPhysicianRecipeFacade clinicPhysicianRecipeFacade = new ClinicPhysicianRecipeFacade();
                    DataSet dsTemp = clinicPhysicianRecipeFacade.FindRecipeDetailByDiagnoseID(SkyComm.DiagnoseID, string.Empty, "3");

                    DataSet ds = dsTemp.Clone();
                    foreach (DataRow row in dsTemp.Tables[0].Rows)
                    {
                        if (_CLINICRECIPEIDs.Contains(row["CLINICRECIPEID"].ToString()))
                        {
                            ds.Tables[0].ImportRow(row);
                        }
                    }
                    if (ds.Tables[0].Rows.Count < 1)
                    {
                        SkyComm.ShowMessageInfo("没有找到可进行缴费的处方记录,请检查处方号");
                        this.ucTime1.Sec = 60;
                        this.ucTime1.timer1.Start();
                        return;
                    }
                    //调用大通审方系统
                    if (!CheckDTPass(ds))
                    {
                        return;
                    }
                    #endregion

                    #region 组织缴费处方信息
                    CommonFacade commonFacade = new CommonFacade();
                    DateTime ServerTime       = commonFacade.GetServerDateTime();

                    LeechdomCharge charge = new LeechdomCharge(SkyComm.DiagnoseID, SysOperatorInfo.OperatorID);
                    charge.AddRecipeCharge(ds);

                    decimal decHisMoney = DecimalRound.Round(Convert.ToDecimal(charge.detailAccountData.Tables[0].Compute("SUM(MONEY)", "")), 2);

                    if (decHisMoney != sumMoney)
                    {
                        charge.detailAccountData.Clear();
                        charge.ecipeMedicineData.Clear();
                        SkyComm.ShowMessageInfo("选择的处方金额不正确,请在门诊窗口进行缴费!");
                        this.ucTime1.Sec = 60;
                        this.ucTime1.timer1.Start();
                        return;
                    }

                    if (decHisMoney > SkyComm.cardBlance)
                    {
                        charge.detailAccountData.Clear();
                        charge.ecipeMedicineData.Clear();
                        SkyComm.ShowMessageInfo("余额不足,请先进行自助预存,再进行缴费!");
                        this.ucTime1.Sec = 60;
                        this.ucTime1.timer1.Start();
                        return;
                    }
                    #endregion

                    #region 缴费
                    try
                    {
                        //验证西北妇幼高值耗材
                        if (!CheckHValueMaterial(charge.detailAccountData))
                        {
                            throw new Exception("缴费信息中有高值耗材,请在门诊窗口进行缴费!");
                        }

                        DetailAccountFacade detailAccountFacade = new DetailAccountFacade();
                        DataSet dads = detailAccountFacade.insertEntityNoInvoice(charge.detailAccountData, ref charge.ecipeMedicineData);
                        SkyComm.GetCardBalance();
                        SkyComm.ShowMessageInfo("缴费成功!");

                        //根据“药房自动配药接口类型”配置为2时,调用西北妇幼的派昂接口 19797
                        string AutoDoseConfig = SystemInfo.SystemConfigs["药房自动配药接口类型"].DefaultValue;
                        string strCK          = string.Empty;
                        if (AutoDoseConfig == "2" && charge.ecipeMedicineData.Tables[0].Rows.Count > 0)
                        {
                            strCK = UploadAngPaiData(dads, charge.ecipeMedicineData, dsTemp);
                        }

                        PrintReport(dads, strCK, dsRecipe);//打印交费凭证
                    }
                    catch (Exception err)
                    {
                        charge.detailAccountData.Clear();
                        charge.ecipeMedicineData.Clear();
                        Skynet.LoggingService.LogService.GlobalInfoMessage(SkyComm.DiagnoseID + "缴费失败:" + err.Message);
                        SkyComm.ShowMessageInfo("缴费失败:" + err.Message);
                        this.ucTime1.Sec = 60;
                        this.ucTime1.timer1.Start();
                        return;
                    }

                    dsRecipe = GetRecipeInfo();
                    if (dsRecipe == null || dsRecipe.Tables[0].Rows.Count == 0)
                    {
                        SkyComm.CloseWin(this);
                    }
                    else
                    {
                        this.gdcMain.DataSource = dsRecipe.Tables[0].DefaultView;

                        lblYE.Text = SkyComm.cardBlance.ToString();

                        refreshUI();
                    }
                    #endregion
                });
            });
        }
Esempio n. 3
0
        /// <summary>
        /// 点击支付宝缴费
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void label2_Click(object sender, EventArgs e)
        {
            this.ucTime1.timer1.Stop();

            #region 验证缴费处方信息

            DataTable dtMain = dsRecipe.Tables[0].DefaultView.ToTable();

            IEnumerable <string> _CLINICRECIPEIDs = dtMain.AsEnumerable().Where(b => b.Field <bool>("PITCHON1") == true).Select(a => a.Field <string>("CLINICRECIPEID")).Distinct();
            if (_CLINICRECIPEIDs.Count() == 0)
            {
                SkyComm.ShowMessageInfo("请选择要缴费的处方!");
                return;
            }
            this.ucTime1.timer1.Stop();
            //选中处方的金额
            decimal sumMoney = DecimalRound.Round(Convert.ToDecimal(dtMain.Compute("SUM(TOTALMONEY)", "PITCHON1 = true")), 2);

            ClinicPhysicianRecipeFacade clinicPhysicianRecipeFacade = new ClinicPhysicianRecipeFacade();
            DataSet dsTemp = clinicPhysicianRecipeFacade.FindRecipeDetailByDiagnoseID(SkyComm.DiagnoseID, string.Empty, "3");

            DataSet ds = dsTemp.Clone();
            foreach (DataRow row in dsTemp.Tables[0].Rows)
            {
                if (_CLINICRECIPEIDs.Contains(row["CLINICRECIPEID"].ToString()))
                {
                    ds.Tables[0].ImportRow(row);
                }
            }
            if (ds.Tables[0].Rows.Count < 1)
            {
                SkyComm.ShowMessageInfo("没有找到可进行缴费的处方记录,请检查处方号");
                this.ucTime1.Sec = 60;
                this.ucTime1.timer1.Start();
                return;
            }
            ////调用大通审方系统
            //if (!CheckDTPass(ds))
            //{
            //    return;
            //}
            #endregion

            #region 组织缴费处方信息
            CommonFacade commonFacade = new CommonFacade();
            DateTime     ServerTime   = commonFacade.GetServerDateTime();

            LeechdomCharge charge = new LeechdomCharge(SkyComm.DiagnoseID, SysOperatorInfo.OperatorID);
            charge.AddRecipeCharge(ds);

            decimal decHisMoney = DecimalRound.Round(Convert.ToDecimal(charge.detailAccountData.Tables[0].Compute("SUM(MONEY)", "")), 2);

            if (decHisMoney != sumMoney)
            {
                charge.detailAccountData.Clear();
                charge.ecipeMedicineData.Clear();
                SkyComm.ShowMessageInfo("选择的处方金额不正确,请在门诊窗口进行缴费!");
                this.ucTime1.Sec = 60;
                this.ucTime1.timer1.Start();
                return;
            }


            #endregion

            FrmNetPay payFrm = new FrmNetPay();

            payFrm.PayMoney = Decimal.Parse(lblTotalMoney.Text.ToString());

            payFrm.ServiceType = "3";

            payFrm.PayMethod = "2";

            payFrm.PayType = "缴费";

            DialogResult mDialogResult = payFrm.ShowDialog();

            if (mDialogResult == DialogResult.OK)
            {
                string hisno = payFrm.hisNo;
                NetPay(hisno, "线上支付宝");

                SkyComm.ShowMessageInfo(payFrm.PayType + "成功!");
            }
            else
            {
                this.ucTime1.timer1.Start();//计时器动
            }
        }
Esempio n. 4
0
        public void NetPay(string hisno, string payMethod)
        {
            this.AnsyWorker(ui =>
            {
                ui.UpdateTitle("正在缴费中,请稍等...");

                ui.SynUpdateUI(() =>
                {
                    #region 验证缴费处方信息

                    DataTable dtMain = dsRecipe.Tables[0].DefaultView.ToTable();

                    IEnumerable <string> _CLINICRECIPEIDs = dtMain.AsEnumerable().Where(b => b.Field <bool>("PITCHON1") == true).Select(a => a.Field <string>("CLINICRECIPEID")).Distinct();
                    if (_CLINICRECIPEIDs.Count() == 0)
                    {
                        SkyComm.ShowMessageInfo("请选择要缴费的处方!");
                        return;
                    }
                    this.ucTime1.timer1.Stop();
                    //选中处方的金额
                    decimal sumMoney = DecimalRound.Round(Convert.ToDecimal(dtMain.Compute("SUM(TOTALMONEY)", "PITCHON1 = true")), 2);

                    ClinicPhysicianRecipeFacade clinicPhysicianRecipeFacade = new ClinicPhysicianRecipeFacade();
                    DataSet dsTemp = clinicPhysicianRecipeFacade.FindRecipeDetailByDiagnoseID(SkyComm.DiagnoseID, string.Empty, "3");

                    DataSet ds = dsTemp.Clone();
                    foreach (DataRow row in dsTemp.Tables[0].Rows)
                    {
                        if (_CLINICRECIPEIDs.Contains(row["CLINICRECIPEID"].ToString()))
                        {
                            ds.Tables[0].ImportRow(row);
                        }
                    }
                    if (ds.Tables[0].Rows.Count < 1)
                    {
                        SkyComm.ShowMessageInfo("没有找到可进行缴费的处方记录,请检查处方号");
                        this.ucTime1.Sec = 60;
                        this.ucTime1.timer1.Start();
                        return;
                    }
                    //调用大通审方系统
                    if (!CheckDTPass(ds))
                    {
                        return;
                    }
                    #endregion

                    #region 组织缴费处方信息
                    CommonFacade commonFacade = new CommonFacade();
                    DateTime ServerTime       = commonFacade.GetServerDateTime();

                    LeechdomCharge charge = new LeechdomCharge(SkyComm.DiagnoseID, SysOperatorInfo.OperatorID);
                    charge.AddRecipeCharge(ds);

                    decimal decHisMoney = DecimalRound.Round(Convert.ToDecimal(charge.detailAccountData.Tables[0].Compute("SUM(MONEY)", "")), 2);

                    if (decHisMoney != sumMoney)
                    {
                        charge.detailAccountData.Clear();
                        charge.ecipeMedicineData.Clear();
                        SkyComm.ShowMessageInfo("选择的处方金额不正确,请在门诊窗口进行缴费!");
                        this.ucTime1.Sec = 60;
                        this.ucTime1.timer1.Start();
                        return;
                    }


                    #endregion

                    #region 缴费
                    try
                    {
                        //验证西北妇幼高值耗材
                        if (!CheckHValueMaterial(charge.detailAccountData))
                        {
                            throw new Exception("缴费信息中有高值耗材,请在门诊窗口进行缴费!");
                        }

                        DetailAccountFacade detailAccountFacade = new DetailAccountFacade();


                        DataSet data = new DataSet();

                        Hashtable hashtable = new Hashtable();

                        hashtable.Add("@HISSEQNO", hisno);

                        string mSql = "SELECT * FROM T_BANKHISEXCHANGE_TRANS where HISSEQNO = @HISSEQNO";// and BANKSTATE = '1'

                        QuerySolutionFacade querySolutionFacade = new QuerySolutionFacade();

                        data = querySolutionFacade.ExeQuery(mSql, hashtable);

                        TBankhisexchangeTransData transData = new TBankhisexchangeTransData();

                        transData.Bankseqno    = data.Tables[0].Rows[0]["BANKSEQNO"].ToString();
                        transData.Hisseqno     = data.Tables[0].Rows[0]["HISSEQNO"].ToString();
                        transData.Ohisseqno    = data.Tables[0].Rows[0]["OHISSEQNO"].ToString();
                        transData.Bankstate    = data.Tables[0].Rows[0]["BANKSTATE"].ToString();
                        transData.Hisstate     = data.Tables[0].Rows[0]["HISSTATE"].ToString();
                        transData.Buscd        = data.Tables[0].Rows[0]["BUSCD"].ToString();
                        transData.Hisid        = data.Tables[0].Rows[0]["HISID"].ToString();
                        transData.Trfamt       = data.Tables[0].Rows[0]["TRFAMT"].ToString();
                        transData.Usetype      = data.Tables[0].Rows[0]["USETYPE"].ToString();
                        transData.Operatorid   = data.Tables[0].Rows[0]["OPERATORID"].ToString();
                        transData.Operatetime  = Convert.ToDateTime(data.Tables[0].Rows[0]["OPERATETIME"].ToString());
                        transData.Diagnoseid   = data.Tables[0].Rows[0]["DIAGNOSEID"].ToString();
                        transData.BusinessType = data.Tables[0].Rows[0]["BUSINESSTYPE"].ToString();
                        transData.DataSources  = data.Tables[0].Rows[0]["DATASOURCES"].ToString();
                        transData.DataSources  = data.Tables[0].Rows[0]["DATASOURCES"].ToString();
                        transData.RefundType   = Convert.ToInt32(data.Tables[0].Rows[0]["REFUNDTYPE"].ToString());
                        transData.RefundMoney  = Convert.ToDecimal(data.Tables[0].Rows[0]["REFUNDMONEY"].ToString());
                        transData.Remark       = "_FromPayForRecipeForm";


                        foreach (DataRow Row in charge.detailAccountData.Tables[0].Rows)
                        {
                            Row.BeginEdit();

                            Row["ISBANKCARD"]          = 1;
                            Row["BALANCEMODE"]         = payMethod;
                            Row["BANKTRANSNO"]         = transData.Hisseqno;
                            Row["IS_FEECHARGING_CARD"] = "1";
                            Row.EndEdit();
                            decHisMoney += Convert.ToDecimal(Row["MONEY"]);
                        }



                        DataSet dads = detailAccountFacade.insertEntityNoInvoiceZZZD(charge.detailAccountData, ref charge.ecipeMedicineData, transData);

                        //DataSet dads = detailAccountFacade.insertEntityNoInvoice(charge.detailAccountData, ref charge.ecipeMedicineData);
                        SkyComm.GetCardBalance();
                        SkyComm.ShowMessageInfo("缴费成功!");

                        //根据“药房自动配药接口类型”配置为2时,调用西北妇幼的派昂接口 19797
                        string AutoDoseConfig = SystemInfo.SystemConfigs["药房自动配药接口类型"].DefaultValue;
                        string strCK          = string.Empty;
                        if (AutoDoseConfig == "2" && charge.ecipeMedicineData.Tables[0].Rows.Count > 0)
                        {
                            strCK = UploadAngPaiData(dads, charge.ecipeMedicineData, dsTemp);
                        }

                        PrintReport(dads, strCK, dsRecipe);//打印交费凭证
                    }
                    catch (Exception err)
                    {
                        charge.detailAccountData.Clear();
                        charge.ecipeMedicineData.Clear();
                        Skynet.LoggingService.LogService.GlobalInfoMessage(SkyComm.DiagnoseID + "缴费失败:" + err.Message);
                        SkyComm.ShowMessageInfo("缴费失败:" + err.Message);
                        this.ucTime1.Sec = 60;
                        this.ucTime1.timer1.Start();
                        return;
                    }

                    dsRecipe = GetRecipeInfo();
                    if (dsRecipe == null || dsRecipe.Tables[0].Rows.Count == 0)
                    {
                        SkyComm.CloseWin(this);
                    }
                    else
                    {
                        this.gdcMain.DataSource = dsRecipe.Tables[0].DefaultView;

                        lblYE.Text = SkyComm.cardBlance.ToString();

                        refreshUI();
                    }
                    #endregion
                });
            });
        }
Esempio n. 5
0
        private void lblQianDao_Click(object sender, EventArgs e)
        {
            //如果已经有卡号时,则表示已经读过卡,则不需要再重新读卡
            if (string.IsNullOrEmpty(SkyComm.cardInfoStruct.CardNo))
            {
                int intResult = SkyComm.ReadCard("挂号");
                if (intResult == 0)
                {
                    return;
                }
            }

            //this.AnsyWorker(ui =>
            {
                //根据是否有预约信息,如果有预约信息,弹出界面选择。
                double minutes = Convert.ToDouble(SystemInfo.SystemConfigs["预约挂号报到延时时间"].DefaultValue);
                BespeakRegisterFacade bespeakFacade = new BespeakRegisterFacade();
                CommonFacade          commonFacade  = new CommonFacade();
                DateTime ServerdateTime             = commonFacade.GetServerDateTime();
                DataSet  bespeakInfoData            = bespeakFacade.FindCurrentBespeakByDiagnoseID(SkyComm.DiagnoseID, 1, ServerdateTime.AddMinutes(-minutes));
                bool     IsQueryBespeakData         = false;
                //ui.SynUpdateUI(() =>
                {
                    if (bespeakInfoData.Tables[0].Rows.Count == 0)
                    {
                        #region 没有预约信息时查询预约

                        SkyComm.ShowMessageInfo("没有查询到预约信息,如果已经预约请到相应窗口取号!");
                        return;

                        #endregion
                    }

                    //有预约信息时
                    if (bespeakInfoData == null || bespeakInfoData.Tables[0].Rows.Count > 0)
                    {
                        #region  预约信息确认取号
                        //有预约信息,再判断预约信息是几条

                        FrmBespeakList frm = new FrmBespeakList();
                        try
                        {
                            frm.dsBespeak          = bespeakInfoData;
                            frm.IsQueryBespeakData = IsQueryBespeakData;
                            if (frm.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
                            {
                                SkyComm.GetCardBalance();
                            }
                        }
                        catch (Exception ex)
                        {
                            Skynet.LoggingService.LogService.GlobalInfoMessage("就诊号:" + SkyComm.DiagnoseID + "取号失败:" + ex.Message);
                        }
                        finally
                        {
                            frm.Dispose();
                        }
                        #endregion
                    }
                }
                //);
            }
            //);
        }
        /// <summary>
        /// 获取卡余额
        /// </summary>
        private void GetMoeny()
        {
            //获取诊疗号
            string diagnoseId = SkyComm.DiagnoseID;

            //预交金
            if (eCardSavingFacade == null)
            {
                eCardSavingFacade = new CardSavingFacade();
            }

            string yje = string.Empty;

            if (SystemInfo.SystemConfigs["院内就诊卡模式"].DefaultValue.ToString() != "2")
            {
                yje = eCardSavingFacade.FindBalanceMoneyByDiagnoseID(diagnoseId).ToString("0.00");
            }
            else
            {
                yje = eCardSavingFacade.FindBalanceMoneyByDiagnoseID_New(diagnoseId, SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["ACCOUNT_ID"].ToString()).ToString("0.00");
            }
            //门诊未结
            //string wj = eCardAuthorizationFacade.FindClinicNoCheckoutMoney(diagnoseId).ToString("0.00");

            //门诊未缴费
            #region 查询未缴费的金额
            QuerySolutionFacade query = new QuerySolutionFacade();
            Hashtable           ht    = new Hashtable();
            string wj     = "0.00";
            string strsql = " SELECT COALESCE(SUM(TOTALMONEY),0) TOTALMONEY FROM (" +
                            " select SUM(C.TOTALMONEY) TOTALMONEY" +
                            " from CLINICPHYSICIANRECIPE C" +
                            " where C.DIAGNOSEID=:DIAGNOSEID AND RECIPESTATE = 0 and OPERATETIME >= :YPDATE " +
                            " AND C.RECIPETYPE IN ('药品费','中草药','医材')" +
                            " union all " +
                            " SELECT SUM(D_SUMMARY_INFO.UNITPRICE * CLINICPHYSICIANRECIPE.AMOUNT * S_MEDORD_DETAIL.AMOUNT) AS TOTALMONEY" +
                            " FROM CLINICPHYSICIANRECIPE,D_SUMMARY_INFO,S_MEDORD_DETAIL,S_MEDORD_MAIN " +
                            " WHERE CLINICPHYSICIANRECIPE.RECIPECONTENT = S_MEDORD_DETAIL.MEDORDID AND S_MEDORD_DETAIL.ITEMID = D_SUMMARY_INFO.ITEMID AND" +
                            "  CLINICPHYSICIANRECIPE.DIAGNOSEID=:DIAGNOSEID AND RECIPESTATE = 0 AND" +
                            "  CLINICPHYSICIANRECIPE.RECIPETYPE <> '附加'  AND CLINICPHYSICIANRECIPE.RECIPECONTENT = S_MEDORD_MAIN.MEDORDID " +
                            "  AND OPERATETIME >=:JZFDATE AND (ISCHANGEPRICE<> 1 OR ISCHANGEPRICE IS NULL)" +
                            " union all " +
                            " SELECT SUM(CLINICPHYSICIANRECIPE.UNITPRICE * CLINICPHYSICIANRECIPE.AMOUNT) AS TOTALMONEY" +
                            " FROM CLINICPHYSICIANRECIPE " +
                            " WHERE CLINICPHYSICIANRECIPE.DIAGNOSEID=:DIAGNOSEID AND RECIPESTATE = 0 AND" +
                            "  CLINICPHYSICIANRECIPE.RECIPETYPE <> '附加' " +
                            "  AND OPERATETIME >=:JZFDATE AND ISCHANGEPRICE = 1" +
                            " union all  " +
                            " select SUM(CLINICPHYSICIANRECIPE.UNITPRICE * CLINICPHYSICIANRECIPE.AMOUNT) TOTALMONEY" +
                            " from CLINICPHYSICIANRECIPE  " +
                            " where  RECIPESTATE = 0  AND CLINICPHYSICIANRECIPE.RECIPETYPE = '附加' " +
                            "  AND CLINICPHYSICIANRECIPE.DIAGNOSEID=:DIAGNOSEID and OPERATETIME >=:JZFDATE ) AA ";

            string ypDate  = SystemInfo.SystemConfigs["药品处方有效期"].DefaultValue;
            string jzfDate = SystemInfo.SystemConfigs["检治费处方有效期"].DefaultValue;

            CommonFacade commonFacade = new CommonFacade();
            DateTime     dtCurrent    = commonFacade.GetServerDateTime();

            ht.Add(":DIAGNOSEID", diagnoseId);
            ht.Add(":YPDATE", dtCurrent.Date.AddDays(Convert.ToInt32(ypDate) * -1));
            ht.Add(":JZFDATE", dtCurrent.Date.AddDays(Convert.ToInt32(jzfDate) * -1));

            try
            {
                lblNoPaymentCharge.Visible = false;
                decimal decNoCharge = 0;
                DataSet ds          = query.ExeQuery(strsql, ht);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    decNoCharge = DecimalRound.Round(Convert.ToDecimal(ds.Tables[0].Rows[0]["TOTALMONEY"]), 2);
                }
                wj          = decNoCharge.ToString();
                lblwjf.Text = decNoCharge.ToString();

                if (decNoCharge != 0)
                {
                    lblNoPaymentCharge.Visible = true;
                }
                else
                {
                    lblNoPaymentCharge.Visible = false;
                }
            }
            catch (Exception ex)
            {
                SkynetMessage.MsgInfo("获取未交费信息出错:" + ex.Message);
            }

            #endregion

            lblwjf.Text = wj + "元";
            //余额
            lblye.Text = SkyComm.cardBlance.ToString();
        }
Esempio n. 7
0
        private void lblOK_Click(object sender, EventArgs e)
        {
            CommonFacade connonFac  = new CommonFacade();
            DateTime     ServerTime = connonFac.GetServerDateTime();
            double       minutes    = Convert.ToDouble(SystemInfo.SystemConfigs["预约挂号报到延时时间"].DefaultValue);

            if (lbltitle.Text == "预约号")
            {
                //根据预约号查询病人的预约信息
                BespeakRegisterFacade bespeakRegisterFacade = new BespeakRegisterFacade();
                this.bespeakData = bespeakRegisterFacade.FindCurrentBespeakByDiagnoseID(lblhm.Text.Trim(), 2, ServerTime.AddMinutes(-minutes));

                if (0 == this.bespeakData.Tables[0].Rows.Count)
                {
                    lblErr.Text    = "确认失败:此预约号无效,请重新输入!";
                    lblErr.Visible = true;
                    bespeakData    = null;
                    ucTime1.Sec    = 60;
                    return;
                }

                if (1 == Convert.ToInt32(this.bespeakData.Tables[0].Rows[0]["USEMARK"]))
                {
                    lblErr.Text    = "确认失败:此预约号已使用,不能再进行取号!";
                    lblErr.Visible = true;
                    bespeakData    = null;
                    ucTime1.Sec    = 60;
                    return;
                }

                if (-1 == Convert.ToInt32(this.bespeakData.Tables[0].Rows[0]["USEMARK"]))
                {
                    lblErr.Text    = "确认失败:此预约号已退约,不能再进行取号!";
                    lblErr.Visible = true;
                    bespeakData    = null;
                    ucTime1.Sec    = 60;
                    return;
                }

                if (2 == Convert.ToInt32(this.bespeakData.Tables[0].Rows[0]["USEMARK"]))
                {
                    lblErr.Text    = "确认失败:此预约号的预约时间为:" + this.bespeakData.Tables[0].Rows[0]["BESPEAKDATE"].ToString() + ",预约时间已过期,不能再使用!";
                    lblErr.Visible = true;
                    bespeakData    = null;
                    ucTime1.Sec    = 60;
                    return;
                }

                if (ServerTime.ToLongDateString() != Convert.ToDateTime(this.bespeakData.Tables[0].Rows[0]["BESPEAKDATE"]).ToLongDateString())
                {
                    lblErr.Text    = "确认失败:此预约号预约时间为:" + Convert.ToDateTime(this.bespeakData.Tables[0].Rows[0]["BESPEAKDATE"]).ToShortDateString() + ",今天不能使用!";
                    lblErr.Visible = true;
                    bespeakData    = null;
                    ucTime1.Sec    = 60;
                    return;
                }

                if (Convert.ToDateTime(this.bespeakData.Tables[0].Rows[0]["BESPEAKDATE"]).AddMinutes(minutes) < ServerTime)
                {
                    lblErr.Text    = "确认失败:此预约号的预约时间为:" + this.bespeakData.Tables[0].Rows[0]["BESPEAKDATE"].ToString() + ",预约时间已过期,不能再使用!";
                    lblErr.Visible = true;
                    bespeakData    = null;
                    ucTime1.Sec    = 60;
                    return;
                }
            }
            else
            {
                //根据手机号查询病人的预约信息
                BespeakRegisterFacade bespeakRegisterFacade = new BespeakRegisterFacade();
                this.bespeakData = bespeakRegisterFacade.FindCurrentBespeakByDiagnoseID(lblhm.Text.Trim(), 3, ServerTime.AddMinutes(-minutes));
                if (bespeakData.Tables[0].Rows.Count == 0)
                {
                    lblErr.Text    = "确认失败:此手机号没有找到可取号的预约数据!";
                    lblErr.Visible = true;
                    bespeakData    = null;
                    ucTime1.Sec    = 60;
                    return;
                }
            }

            DialogResult = System.Windows.Forms.DialogResult.OK;
        }
Esempio n. 8
0
        public void BespeakSignIn(IWin32Window owner)
        {
            //如果已经有卡号时,则表示已经读过卡,则不需要再重新读卡
            if (string.IsNullOrEmpty(SkyComm.cardInfoStruct.CardNo))
            {
                int intResult = SkyComm.ReadCard("挂号");
                if (intResult == 0)
                {
                    return;
                }
            }

            //判断打印机是否有纸
            if (AutoHostConfig.ReadCardType == "XUHUI")
            {
                PrintManage_XH thePrintManage = new PrintManage_XH();
                string         CheckInfo      = thePrintManage.CheckPrintStatus();
                if (!string.IsNullOrEmpty(CheckInfo))
                {
                    SkyComm.ShowMessageInfo(CheckInfo);
                    return;
                }
            }

            //根据是否有预约信息,如果有预约信息,弹出界面选择。
            double minutes = Convert.ToDouble(SystemInfo.SystemConfigs["预约挂号报到延时时间"].DefaultValue);
            BespeakRegisterFacade bespeakFacade = new BespeakRegisterFacade();
            CommonFacade          commonFacade  = new CommonFacade();
            DateTime ServerdateTime             = commonFacade.GetServerDateTime();
            DataSet  bespeakInfoData            = bespeakFacade.FindCurrentBespeakByDiagnoseID(SkyComm.DiagnoseID, 1, ServerdateTime.AddMinutes(-minutes));
            bool     IsQueryBespeakData         = false;
            //ui.SynUpdateUI(() =>
            {
                if (bespeakInfoData.Tables[0].Rows.Count == 0)
                {
                    #region 没有预约信息时查询预约

                    SkyComm.ShowMessageInfo("没有查询到预约信息,如果已经预约请到相应窗口取号!");
                    return;

                    #endregion
                }

                //有预约信息时
                if (bespeakInfoData == null || bespeakInfoData.Tables[0].Rows.Count > 0)
                {
                    #region  预约信息确认取号
                    //有预约信息,再判断预约信息是几条

                    FrmBespeakList frm = new FrmBespeakList();
                    try
                    {
                        frm.dsBespeak          = bespeakInfoData;
                        frm.IsQueryBespeakData = IsQueryBespeakData;
                        if (frm.ShowDialog(owner) == System.Windows.Forms.DialogResult.OK)
                        {
                            SkyComm.GetCardBalance();
                        }
                    }
                    catch (Exception ex)
                    {
                        Skynet.LoggingService.LogService.GlobalInfoMessage("就诊号:" + SkyComm.DiagnoseID + "取号失败:" + ex.Message);
                    }
                    finally
                    {
                        frm.Dispose();
                    }
                    #endregion
                }
            }

            ExitScanCard();
        }