private void frmOutpatientDrug_FormClosed(object sender, FormClosedEventArgs e)
 {
     if (!this.isCancel)
     {
         if (this.funMode == Neusoft.HISFC.Components.DrugStore.OutpatientFun.Drug)
         {
             Neusoft.HISFC.BizLogic.Pharmacy.DrugStore drugStoreManager = new Neusoft.HISFC.BizLogic.Pharmacy.DrugStore();
             this.Terminal      = drugStoreManager.GetDrugTerminalById(this.Terminal.ID);
             this.Terminal.Memo = "";
             if (drugStoreManager.UpdateDrugTerminal(this.Terminal) == -1)
             {
                 MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("更新配药终端为可用标记失败"));
                 return;
             }
         }
     }
 }
        /// <summary>
        /// 终端初始化  暂时写死使用配药台
        /// </summary>
        protected int InitTerminal()
        {
            if (this.funMode == Neusoft.HISFC.Components.DrugStore.OutpatientFun.Drug)
            {
                this.Terminal = Neusoft.HISFC.Components.DrugStore.Function.TerminalSelect(this.OperDept.ID, Neusoft.HISFC.Models.Pharmacy.EnumTerminalType.配药台, true);
            }
            else
            {
                this.Terminal = Neusoft.HISFC.Components.DrugStore.Function.TerminalSelect(this.OperDept.ID, Neusoft.HISFC.Models.Pharmacy.EnumTerminalType.发药窗口, true);
            }

            if (this.Terminal == null)
            {
                return(-1);
            }

            if (this.funMode == Neusoft.HISFC.Components.DrugStore.OutpatientFun.Drug)
            {
                if (this.Terminal.Memo == "1")
                {
                    DialogResult rs = MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("该终端已在其他电脑登陆,不能再次使用,您确认登陆此配药终端吗?\n 注意:如果强行登陆后容易造成配药清单打印混乱!"), "", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                    if (rs == DialogResult.No)
                    {
                        this.isCancel = true;
                        return(-1);
                    }
                }
                Neusoft.HISFC.BizLogic.Pharmacy.DrugStore drugStoreManager = new Neusoft.HISFC.BizLogic.Pharmacy.DrugStore();
                this.Terminal.Memo = "1";
                if (drugStoreManager.UpdateDrugTerminal(this.Terminal) == -1)
                {
                    MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("更新配药终端为已在用标记失败"));
                    this.isCancel = true;
                    return(-1);
                }
            }

            this.statusBar1.Panels[3].Text = this.statusBar1.Panels[3].Text + " - " + this.OperDept.Name + this.Terminal.Name + "[" + this.Terminal.ID + "]";

            return(1);
        }