Beispiel #1
0
        private void txtEmpNo_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                string empno = this.txtEmpNo.Text.Trim();

                if (empno == "")
                {
                    return;
                }

                DataTable     dt;
                clsDcl_PrePay objPre = new clsDcl_PrePay();
                long          l      = objPre.m_lngGetempinfo(out dt, empno);
                if (l > 0 && dt.Rows.Count == 1)
                {
                    Empid             = dt.Rows[0]["empid_chr"].ToString();
                    Empname           = dt.Rows[0]["lastname_vchr"].ToString();
                    this.lblName.Text = Empname;

                    string userpwd = dt.Rows[0]["psw_chr"].ToString().Trim();
                    clsSymmetricAlgorithm objAlgorithm = new clsSymmetricAlgorithm();
                    this.txtPwd.Tag = objAlgorithm.m_strDecrypt(userpwd, clsSymmetricAlgorithm.enmSymmetricAlgorithmType.DES);
                    objAlgorithm    = null;
                    this.txtPwd.Focus();
                }
                else
                {
                    MessageBox.Show("工号输入错误,请重新输入。", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    this.txtEmpNo.Select();
                }
            }
        }
Beispiel #2
0
        /// <summary>
        /// 重打预交金发票
        /// </summary>
        internal void RePrintInvoice()
        {
            if (this.m_objViewer.m_dataGridViewRs.SelectedRows.Count == 0)
            {
                MessageBox.Show("请选择需要重打的预交金记录。");
                return;
            }

            string prepayId  = this.m_objViewer.m_dataGridViewRs.SelectedRows[0].Cells["PREPAYID_CHR"].Value.ToString();
            string preInvoNo = this.m_objViewer.m_dataGridViewRs.SelectedRows[0].Cells["PREPAYINV_VCHR"].Value.ToString();
            string preStatus = this.m_objViewer.m_dataGridViewRs.SelectedRows[0].Cells["PAYTYPE_INT"].Value.ToString();

            if (preStatus == "正常" || preStatus == "恢复")
            {
                // 正常预交.微信
                frmPrePayRepeatPrn fpprp = new frmPrePayRepeatPrn(preInvoNo, 0, this.m_objViewer.LoginInfo.m_strEmpID);
                if (fpprp.ShowDialog() == DialogResult.OK)
                {
                    string prntype = fpprp.PrnType;
                    string newno   = fpprp.NewNo;
                    if (prntype == "1")
                    {
                        clsPBNetPrint.m_mthPrintPrepayBill(prepayId, "");
                    }
                    else if (prntype == "2")
                    {
                        clsDcl_PrePay dclPrepay = new clsDcl_PrePay();
                        long          l         = dclPrepay.m_lngSaveRepeatPrn(prepayId, preInvoNo, newno, this.m_objViewer.LoginInfo.m_strEmpID, "1");
                        if (l > 0)
                        {
                            clsPBNetPrint.m_mthPrintPrepayBill(prepayId, newno);
                            clsPublic.m_blnSaveCurrInvoiceNo(this.m_objViewer.LoginInfo.m_strEmpID, newno, 2);
                            clsPublic.m_blnWriteXML("BeInHospital", "CurrPrepayBillNo", "AnyOne", newno);
                        }
                        else
                        {
                            MessageBox.Show("保存重打信息失败。", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                        }
                        dclPrepay = null;
                    }
                    else if (prntype == "3")
                    {
                        clsPBNetPrint.m_mthPrintPrepayBill(prepayId, newno);
                    }
                }
            }
            else
            {
                MessageBox.Show("不能重打。");
            }
        }
Beispiel #3
0
        private void frmAuditing_Load(object sender, EventArgs e)
        {
            //if (this.intDefault == 2)
            if (this.txtEmpNo.Text.Trim() != "")
            {
                string empno = this.txtEmpNo.Text.Trim();

                if (empno == "")
                {
                    return;
                }

                DataTable     dt;
                clsDcl_PrePay objPre = new clsDcl_PrePay();
                long          l      = objPre.m_lngGetempinfo(out dt, empno);
                if (l > 0 && dt.Rows.Count == 1)
                {
                    Empid             = dt.Rows[0]["empid_chr"].ToString();
                    Empname           = dt.Rows[0]["lastname_vchr"].ToString();
                    this.lblName.Text = Empname;

                    string userpwd = dt.Rows[0]["psw_chr"].ToString().Trim();
                    clsSymmetricAlgorithm objAlgorithm = new clsSymmetricAlgorithm();
                    this.txtPwd.Tag = objAlgorithm.m_strDecrypt(userpwd, clsSymmetricAlgorithm.enmSymmetricAlgorithmType.DES);
                    objAlgorithm    = null;
                    this.txtPwd.Focus();
                }
                else
                {
                    MessageBox.Show("工号输入错误,请重新输入。", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    this.DialogResult = DialogResult.No;
                    this.Close();
                }
                if (this.intDefault == 2)
                {
                    this.txtEmpNo.Enabled = false;
                }
            }
            this.txtPwd.Focus();
            this.txtPwd.Select();
            //this.txtPwd.Focus();
        }
Beispiel #4
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            if (CurrChargeNo != "")
            {
                if (RepeatPrtInvono != "" && CompletePrt == false)
                {
                    clsDcl_PrePay objPrePay = new clsDcl_PrePay();
                    long          l         = objPrePay.m_lngSaveRepeatPrn(CurrChargeNo, CurrInvoNo, RepeatPrtInvono, this.LoginInfo.m_strEmpID, "2");
                    if (l == 0)
                    {
                        MessageBox.Show("保存发票重打记录失败。", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                        return;
                    }

                    clsPublic.m_blnSaveCurrInvoiceNo(this.LoginInfo.m_strEmpID, RepeatPrtInvono, 1);
                }

                clsPBNetPrint.m_mthPrintInvoiceBill(CurrChargeNo, RepeatPrtInvono, 2, this.HospitalName);
            }
        }
Beispiel #5
0
        /// <summary>
        /// 获取费用信息
        /// </summary>
        /// <param name="regid"></param>
        public void m_mthGetPatientFeeInfo(string regid)
        {
            if (Patient_VO == null)
            {
                return;
            }

            prepayidarr        = new ArrayList();
            Balanceprepaymoney = 0;
            DataTable dt;

            //获取预交金
            long          l         = 0;
            clsDcl_PrePay objPrepay = new clsDcl_PrePay();

            if (Patient_VO.FeeStatus == 4)
            {
                decimal d = 0;
                l = objPrepay.m_lngGetBadChargePrepayByRegID(regid, out d);
                if (l > 0)
                {
                    Patient_VO.PrepayMoney          = 0;
                    Patient_VO.PrepayMoneyBadCharge = d;
                }
            }
            else
            {
                l = objPrepay.m_lngGetPrepayByRegID(regid, 2, out dt);
                if (l > 0 && dt.Rows.Count > 0)
                {
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        string  id    = dt.Rows[i]["prepayid_chr"].ToString();
                        string  no    = dt.Rows[i]["prepayinv_vchr"].ToString();
                        decimal money = clsPublic.ConvertObjToDecimal(dt.Rows[i]["balancetotal"]);
                        Balanceprepaymoney += money;

                        prepayidarr.Add(id + ";" + no + ";" + money.ToString());
                    }

                    //预交金改为显示当前可用预交金
                    Patient_VO.PrepayMoney = Balanceprepaymoney;
                }
            }

            //获取总费用、待结、待清、直接收费、已清、结余、清帐日期、未结天数
            decimal TotalFee         = 0;
            decimal WaitChargeFee    = 0;
            decimal WaitClearFee     = 0;
            decimal DirectorFee      = 0;
            decimal CompleteClearFee = 0;
            string  ClearFeeDate     = "";
            int     NoChargeDays     = 0;

            //最新费用时间
            maxfeedate = DateTime.Now.ToString("yyyy-MM-dd");

            clsDcl_Charge objCharge = new clsDcl_Charge();

            int intParm = 0;

            //判断是否为出院结算出院:出院结算时要判断母婴结算功能
            if (Status == 8)
            {
                //母婴合并结算功能开关0为关、1为开
                intParm = clsPublic.m_intGetSysParm("1119");
            }

            if (intParm == 0)
            {
                l = objCharge.m_lngGetChargeInfoByID(regid, 1, out dt);
            }
            else
            {
                l = objCharge.m_lngGetChargeInfoByIDForBaby(regid, out dt);
            }
            if (l > 0 && dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    //单项总费用
                    decimal d = clsPublic.Round(clsPublic.ConvertObjToDecimal(dt.Rows[i]["unitprice_dec"]) * clsPublic.ConvertObjToDecimal(dt.Rows[i]["amount_dec"]), 2);
                    //单项让利
                    decimal decDiffSum = clsPublic.Round(clsPublic.ConvertObjToDecimal(dt.Rows[i]["TOTALDIFFCOSTMONEY_DEC"]), 2);
                    //总费用
                    TotalFee += d + decDiffSum;
                    //费用状态 0 待确认 1 待结 2 待清 3 已清 4 直收
                    int pstatus = Convert.ToInt32(dt.Rows[i]["pstatus_int"].ToString());
                    if (pstatus == 1)
                    {
                        WaitChargeFee += d + decDiffSum;
                    }
                    else if (pstatus == 2)
                    {
                        WaitClearFee += d + decDiffSum;
                    }
                    else if (pstatus == 3)
                    {
                        CompleteClearFee += d + decDiffSum;
                    }
                    else if (pstatus == 4)
                    {
                        DirectorFee += d + decDiffSum;
                    }
                }

                //最新费用时间
                DataView dv = new DataView(dt);
                dv.Sort = "chargeactive_dat asc";
                if (dv.Count > 0)
                {
                    maxfeedate = Convert.ToDateTime(dv[dv.Count - 1]["chargeactive_dat"].ToString()).ToString("yyyy-MM-dd");
                }

                //最大清帐日期
                dv.RowFilter = "pstatus_int = 3";
                dv.Sort      = "chearaccount_dat asc";
                if (dv.Count > 0)
                {
                    ClearFeeDate = Convert.ToDateTime(dv[dv.Count - 1]["chearaccount_dat"].ToString()).ToString("yyyy-MM-dd HH:mm:ss");
                }

                //未结(待结、待清)日期
                dv.RowFilter = "pstatus_int = 1 or pstatus_int = 2";
                dv.Sort      = "chargeactive_dat asc";
                if (dv.Count > 0)
                {
                    Hashtable has = new Hashtable();
                    foreach (DataRowView drv in dv)
                    {
                        string s = Convert.ToDateTime(drv["chargeactive_dat"].ToString()).ToString("yyyy-MM-dd");
                        if (has.ContainsKey(s) || (s == DateTime.Now.ToString("yyyy-MM-dd")))
                        {
                            continue;
                        }
                        else
                        {
                            has.Add(s, null);
                        }
                    }

                    NoChargeDays = has.Count;
                }
            }

            //结余 = 可用预交金 - 待结 - 待清
            decimal BalanceFee = Balanceprepaymoney - WaitChargeFee - WaitClearFee;

            if (Patient_VO.FeeStatus == 4 && Patient_VO.PrepayMoneyBadCharge > 0)
            {
                if (WaitClearFee >= Patient_VO.PrepayMoneyBadCharge)
                {
                    WaitClearFee -= Patient_VO.PrepayMoneyBadCharge;
                }
                else
                {
                    WaitChargeFee = WaitChargeFee + WaitClearFee - Patient_VO.PrepayMoneyBadCharge;
                    WaitClearFee  = 0;
                }

                BalanceFee        = (WaitChargeFee + WaitClearFee) * -1;
                CompleteClearFee += Patient_VO.PrepayMoneyBadCharge;
            }

            Patient_VO.TotalFee         = TotalFee;
            Patient_VO.WaitChargeFee    = WaitChargeFee;
            Patient_VO.WaitClearFee     = WaitClearFee;
            Patient_VO.DirectorFee      = DirectorFee;
            Patient_VO.CompleteClearFee = CompleteClearFee;
            Patient_VO.BalanceMoney     = BalanceFee;
            Patient_VO.ClearFeeDate     = ClearFeeDate;
            Patient_VO.NoChargeDays     = NoChargeDays;
        }
Beispiel #6
0
 /// <summary>
 /// 构造
 /// </summary>
 public clsCtl_PrePay()
 {
     objSvc = new clsDcl_PrePay();
 }