Exemplo n.º 1
0
 private void checkedListBoxControlEmrNode_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e)
 {
     try
     {
         if (e.State == CheckState.Checked)
         {
             EmrNode emrNode = checkedListBoxControlEmrNode.Items[e.Index].Value as EmrNode;
             if (emrNode != null)
             {
                 if (emrNode.DataRowItem["isfirstdaily"].ToString() == "1")
                 {
                     EmrModel firstDailyEmrModelInMemory   = Util.GetFirstDailyEmrModel(m_CurrentUCEmrInput.CurrentInputBody.CurrentTreeList); //获取内存中是否存在首次病程的节点
                     bool     isHasFirstDailyEmrInDataBase = m_HistoryEmrBll.IsHasFirstDailyEmr(m_CurrentInpatient.NoOfFirstPage.ToString());  //获取数据库中是否存在首次病程的节点
                     if (firstDailyEmrModelInMemory != null && isHasFirstDailyEmrInDataBase)
                     {
                         MyMessageBox.Show("该病人已经存在首次病程,不能重复导入。", "提示", MyMessageBoxButtons.Ok, DrectSoft.Common.Ctrs.DLG.MessageBoxIcon.WarningIcon);
                         checkedListBoxControlEmrNode.Items[e.Index].CheckState = CheckState.Unchecked;
                         return;
                     }
                 }
             }
             foreach (CheckedListBoxItem subItem in checkedListBoxControlEmrNode.Items)
             {
                 if (subItem.CheckState == CheckState.Unchecked)
                 {
                     SetCheckAllStateUnEvent(false);
                     return;
                 }
             }
             SetCheckAllStateUnEvent(true);
         }
         else
         {
             SetCheckAllStateUnEvent(false);
         }
     }
     catch (Exception ex)
     {
         MyMessageBox.Show(1, ex);
     }
 }