Beispiel #1
0
        /// <summary>
        /// 删除(作废)
        /// </summary>
        /// <param name="Flag">1 删除(作废) 2 删除(作废)后复用</param>
        private void m_mthDelRecipe(int Flag)
        {
            clsDcl_DoctorWorkstation objDoct = new clsDcl_DoctorWorkstation();
            DataTable dtTmp = new DataTable();

            objDoct.m_lngGetRecipeMainInfo(RecipeInfo_VO.m_strOUTPATRECIPEID_CHR, out dtTmp);
            if (dtTmp != null && dtTmp.Rows.Count > 0)
            {
                if (dtTmp.Rows[0]["diagdr_chr"].ToString().Trim() != this.LoginInfo.m_strEmpID)
                {
                    MessageBox.Show("非本人处方,不能操作。", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                    return;
                }
            }

            string info   = "";
            int    status = RecipeInfo_VO.m_intPSTATUS_INT;

            if (status == 0 || status == 1)
            {
                if (Flag == 1)
                {
                    info = "删除";
                }
                else if (Flag == 2)
                {
                    info = "删除后复用";
                }
            }
            else if (status == 4 || status == 5)
            {
                if (Flag == 1)
                {
                    info = "作废";
                }
                else if (Flag == 2)
                {
                    info = "作废后复用";
                }
            }
            else
            {
                return;
            }

            //伪删除、作废处方
            if (MessageBox.Show("确认是否" + info + "当前处方?", "系统提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.No)
            {
                return;
            }

            if (Flag == 2)
            {
                this.m_mthSelect(1);

                if (hasItem.Count == 0)
                {
                    MessageBox.Show("请选择项目!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
            }

            long l = objDoct.m_mthDelRecipe(RecipeInfo_VO.m_strOUTPATRECIPEID_CHR, "-1");

            /*
             *  一、正常的流程:
             *     2 已结算的,不能作废  -4 程序失败
             *  二、以下为:添加了先诊疗后结算的,添加的判断
             *     -3 表示已经有药品(中药或西药)、材料已经配药或发药了
             *     -5 表示已经有检验开始做  -7 表示已经有检查开始做
             * **/
            if ((l > 0 && l != 2) || l == -1)
            {
                MessageBox.Show(info + "处方成功!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                if (Flag == 1)
                {
                    this.DialogResult = DialogResult.Abort;
                }
                else if (Flag == 2)
                {
                    this.DialogResult = DialogResult.Yes;
                }
            }
            else if (l == -3)
            {
                MessageBox.Show(info + "处方失败。药品(或材料)已配或已发。", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else if (l == -5)
            {
                MessageBox.Show(info + "处方失败。存在已做检验。", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else if (l == -7)
            {
                MessageBox.Show(info + "处方失败。存在已做检查。", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                MessageBox.Show(info + "处方失败。", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }