Example #1
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            bool overRule   = false;
            bool hasChecked = false;

            foreach (TreeNode content in tvNotes.Nodes)
            {
                if (content.Checked == true)
                {
                    EmrConstant.NoteStatus ns = (EmrConstant.NoteStatus)Convert.ToInt32(content.Name);
                    //if (ns == EmrConstant.NoteStatus.Draft || ns == EmrConstant.NoteStatus.Checking
                    //    || ns == EmrConstant.NoteStatus.FinallyCkecking)
                    //{
                    //    MessageBox.Show(EmrConstant.ErrorMessage.NoMarge, content.Text);
                    //    //content.Checked = false;
                    //    overRule = true;
                    //}
                    hasChecked = true;
                }
            }
            if (overRule)
            {
                return;
            }

            this.DialogResult = DialogResult.OK;
            if (!hasChecked)
            {
                this.DialogResult = DialogResult.Cancel;
            }
            this.Close();
        }
Example #2
0
        private void NoteListForMerge(string mergeCode)
        {
            noteIDs = new ArrayList();
            tvNotes.Nodes.Clear();

            foreach (XmlNode emrNote in notes)
            {
                if (emrNote.Attributes[AttributeNames.Merge].Value != mergeCode)
                {
                    continue;
                }
                string text = emrNote.Attributes[EmrConstant.AttributeNames.WrittenDate].Value;
                /**20110905  zzl**/
                if (emrNote.Attributes[EmrConstant.AttributeNames.RealName] == null || emrNote.Attributes[EmrConstant.AttributeNames.RealName].Value == "")
                {
                    text += Delimiters.Space + emrNote.Attributes[EmrConstant.AttributeNames.NoteName].Value;
                }
                else
                {
                    text += Delimiters.Space + emrNote.Attributes[EmrConstant.AttributeNames.RealName].Value;
                }
                //text += Delimiters.Space + emrNote.Attributes[EmrConstant.AttributeNames.NoteName].Value;
                int index = Convert.ToInt32(emrNote.Attributes[EmrConstant.AttributeNames.NoteStatus].Value);
                EmrConstant.NoteStateText nst = new EmrConstant.NoteStateText();
                text += Delimiters.Space + nst.Text[index];
                TreeNode newNode = tvNotes.Nodes.Add(text);
                newNode.Tag  = emrNote.Attributes[EmrConstant.AttributeNames.Series].Value;
                newNode.Name = emrNote.Attributes[EmrConstant.AttributeNames.NoteID].Value;

                EmrConstant.NoteStatus ns = (EmrConstant.NoteStatus)index;
                //if (ns == EmrConstant.NoteStatus.Commited || ns == EmrConstant.NoteStatus.Checked
                //    || ns == EmrConstant.NoteStatus.FinallyChecked)
                //2009/6/19
                newNode.Checked = true;
                if (ns == EmrConstant.NoteStatus.Commited || ns == EmrConstant.NoteStatus.Checked ||
                    ns == EmrConstant.NoteStatus.FinallyChecked || ns == EmrConstant.NoteStatus.Checking || ns == EmrConstant.NoteStatus.Draft || ns == EmrConstant.NoteStatus.FinallyCkecking)
                {
                    newNode.Checked = true;
                }
                else
                {
                    if (Globals.commitedAsEnd)
                    {
                        newNode.Remove();
                        uncommitedNoteCount++;
                    }
                    else
                    {
                        newNode.Checked = false;
                    }
                }

                if (!ExistsInNoteIDs(emrNote.Attributes[EmrConstant.AttributeNames.NoteID].Value))
                {
                    noteIDs.Add(emrNote.Attributes[EmrConstant.AttributeNames.NoteID].Value);
                }
            }
        }