private void rightMenuStrip_Opened(object sender, EventArgs e)
        {
            if (treeT.SelectedNode.Tag is EMR.Controls.Entity.EmrCatalogue)
            {
                新增病历ToolStripMenuItem.Enabled = true;
                修改病历ToolStripMenuItem.Enabled = false;
                除病历ToolStripMenuItem.Enabled  = false;
                签名ToolStripMenuItem.Enabled   = false;
                退回ToolStripMenuItem.Enabled   = false;
            }
            else if (treeT.SelectedNode.Tag is EMR.Controls.Entity.EmrWriteRecord)
            {
                新增病历ToolStripMenuItem.Enabled = false;
                修改病历ToolStripMenuItem.Enabled = true;
                除病历ToolStripMenuItem.Enabled  = true;

                签名ToolStripMenuItem.Enabled = true;
                退回ToolStripMenuItem.Enabled = true;

                EMR.Controls.Entity.EmrWriteRecord record = treeT.SelectedNode.Tag as EMR.Controls.Entity.EmrWriteRecord;
                bool           _sign, _back;
                EmrBindKeyData _bindkey = new EmrBindKeyData(controller.emrView.CurrBindKeyData.HosptialId, controller.emrView.CurrBindKeyData.PatientId, controller.emrView.CurrBindKeyData.CurrDeptCode, controller.emrView.CurrBindKeyData.CurrDeptName, controller.emrView.CurrBindKeyData.UserCode, controller.emrView.CurrBindKeyData.UserName, controller.emrView.CurrBindKeyData.UserLevel, controller.emrView.CurrBindKeyData.UserLevelName);
                _bindkey.ChangeEmrData(record.ID, record.EmrDataId, record.CatalogueCode, record.DeptCode, record.DeptName, record.UserCode, record.UserName, record.FirstSignature, record.FirstDoctorLevel, record.SecondSignature, record.SecondDoctorCode, record.SecondDoctorLevel, record.ThreeSignature, record.ThreeDoctorCode, record.ThreeDoctorLevel, record.RecordText);
                controller.VerifSignNameState(_bindkey, out _sign, out _back);
                签名ToolStripMenuItem.Enabled = _sign;
                退回ToolStripMenuItem.Enabled = _back;
            }
        }
        private void 退回ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            EMR.Controls.Entity.EmrWriteRecord record = treeT.SelectedNode.Tag as EMR.Controls.Entity.EmrWriteRecord;
            EmrBindKeyData _bindkey = new EmrBindKeyData(controller.emrView.CurrBindKeyData.HosptialId, controller.emrView.CurrBindKeyData.PatientId, controller.emrView.CurrBindKeyData.CurrDeptCode, controller.emrView.CurrBindKeyData.CurrDeptName, controller.emrView.CurrBindKeyData.UserCode, controller.emrView.CurrBindKeyData.UserName, controller.emrView.CurrBindKeyData.UserLevel, controller.emrView.CurrBindKeyData.UserLevelName);

            _bindkey.ChangeEmrData(record.ID, record.EmrDataId, record.CatalogueCode, record.DeptCode, record.DeptName, record.UserCode, record.UserName, record.FirstSignature, record.FirstDoctorLevel, record.SecondSignature, record.SecondDoctorCode, record.SecondDoctorLevel, record.ThreeSignature, record.ThreeDoctorCode, record.ThreeDoctorLevel, record.RecordText);
            selectRecordId = record.ID;
            controller.VerifSignBack(_bindkey);
        }
        private void 签名ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            EMR.Controls.Entity.EmrWriteRecord record = treeT.SelectedNode.Tag as EMR.Controls.Entity.EmrWriteRecord;
            EmrBindKeyData _bindkey = new EmrBindKeyData(controller.emrView.CurrBindKeyData.HosptialId, controller.emrView.CurrBindKeyData.PatientId, controller.emrView.CurrBindKeyData.CurrDeptCode, controller.emrView.CurrBindKeyData.CurrDeptName, controller.emrView.CurrBindKeyData.UserCode, controller.emrView.CurrBindKeyData.UserName, controller.emrView.CurrBindKeyData.UserLevel, controller.emrView.CurrBindKeyData.UserLevelName);

            _bindkey.ChangeEmrData(record.ID, record.EmrDataId, record.CatalogueCode, record.DeptCode, record.DeptName, record.UserCode, record.UserName, record.FirstSignature, record.FirstDoctorLevel, record.SecondSignature, record.SecondDoctorCode, record.SecondDoctorLevel, record.ThreeSignature, record.ThreeDoctorCode, record.ThreeDoctorLevel, record.RecordText);
            selectRecordId = record.ID;

            Signature dlg = new Signature();

            dlg.ShowDialog();
            if (dlg.retOk)
            {
                Bitmap imgSign = dlg.SavedBitmap;
                controller.VerifSignName(_bindkey, imgSign);
            }
        }
 public static void InitData(EmrBindKeyData keydata, IEmrDataSource emrDataSource)
 {
     _keydata       = keydata;
     _emrDataSource = emrDataSource;
     emrDataSource.InitData(keydata);
 }