private void UpdateCertAuth()
 {
     if ((tag && dgvEBCert.SelectedRows.Count > 0) || (!tag && dgvEBCertAuth.SelectedRows.Count > 0))
     {
         EBMCertAuthInfo form = new EBMCertAuthInfo(Enums.OperateType.Update, tag,
                                                    tag ? certList[dgvEBCert.SelectedRows[0].Index] : certAuthList[dgvEBCertAuth.SelectedRows[0].Index]);
         DialogResult result = form.ShowDialog();
         if (result == DialogResult.OK && form.CertData != null)
         {
             if (tag)
             {
                 certList[dgvEBCert.SelectedRows[0].Index] = form.CertData;
             }
             else
             {
                 certAuthList[dgvEBCertAuth.SelectedRows[0].Index] = form.CertData;
             }
         }
         form.Dispose();
     }
     else
     {
         MessageBox.Show("未选中任何索引");
     }
 }
 private void InfoCertAuth()
 {
     if ((tag && dgvEBCert.SelectedRows.Count > 0) || (!tag && dgvEBCertAuth.SelectedRows.Count > 0))
     {
         EBMCertAuthInfo form = new EBMCertAuthInfo(Enums.OperateType.Info, tag,
                                                    tag ? certList[dgvEBCert.SelectedRows[0].Index] : certAuthList[dgvEBCertAuth.SelectedRows[0].Index]);
         DialogResult result = form.ShowDialog();
     }
     else
     {
         MessageBox.Show("未选中任何索引");
     }
 }
        private void AddCertAuth(bool tag)
        {
            EBMCertAuthInfo form   = new EBMCertAuthInfo(Enums.OperateType.Add, tag);
            DialogResult    result = form.ShowDialog();

            if (result == DialogResult.OK && form.CertData != null)
            {
                if (tag)
                {
                    certList.Add(form.CertData);
                }
                else
                {
                    certAuthList.Add(form.CertData);
                }
            }
            form.Dispose();
        }