Exemplo n.º 1
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (textDescription.Text == "")
     {
         MsgBox.Show(this, "Please enter text first");
         return;
     }
     //PatNum cannot be set
     if (PopupCur.IsNew)
     {
         //PopCur date got set on load
         PopupCur.PopupLevel  = (EnumPopupLevel)comboPopupLevel.SelectedIndex;
         PopupCur.IsDisabled  = checkIsDisabled.Checked;
         PopupCur.Description = textDescription.Text;
         PopupCur.UserNum     = Security.CurUser.UserNum;
         Popups.Insert(PopupCur);
     }
     else
     {
         if (PopupCur.Description != textDescription.Text)               //if user changed the description
         {
             Popup popupArchive = PopupCur.Copy();
             popupArchive.IsArchived      = true;
             popupArchive.PopupNumArchive = PopupCur.PopupNum;
             Popups.Insert(popupArchive);
             PopupCur.Description = textDescription.Text;
             PopupCur.UserNum     = Security.CurUser.UserNum;
         }                //No need to make an archive entry for changes to PopupLevel or IsDisabled so they get set on every OK Click.
         PopupCur.PopupLevel = (EnumPopupLevel)comboPopupLevel.SelectedIndex;
         PopupCur.IsDisabled = checkIsDisabled.Checked;
         Popups.Update(PopupCur);
     }
     DialogResult = DialogResult.OK;
 }
Exemplo n.º 2
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (textDescription.Text == "")
     {
         MsgBox.Show(this, "Please enter text first");
         return;
     }
     //PatNum cannot be set
     PopupCur.PopupLevel  = (EnumPopupLevel)comboPopupLevel.SelectedIndex;
     PopupCur.IsDisabled  = checkIsDisabled.Checked;
     PopupCur.Description = textDescription.Text;
     if (PopupCur.IsNew)
     {
         Popups.Insert(PopupCur);
     }
     else
     {
         Popups.Update(PopupCur);
     }
     DialogResult = DialogResult.OK;
 }
Exemplo n.º 3
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (PopupCur.Description != textDescription.Text)           //if user changed the note
     {
         if (MsgBox.Show(this, true, "Save changes to note?"))
         {
             Popup popupArchive = PopupCur.Copy();
             popupArchive.IsArchived      = true;
             popupArchive.PopupNumArchive = PopupCur.PopupNum;
             Popups.Insert(popupArchive);
             PopupCur.Description   = textDescription.Text;
             PopupCur.DateTimeEntry = DateTime.Now;
             PopupCur.UserNum       = Security.CurUser.UserNum;
             Popups.Update(PopupCur);
         }
     }
     else
     {
         MinutesDisabled = 10;
     }
     DialogResult = DialogResult.OK;
 }
Exemplo n.º 4
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (PopupCur.Description.Replace("\r", "") != textDescription.Text.Replace("\r", ""))         //if user changed the note. remove "\r" to homogenize line returns because "\r\n" is the same as "\n"
     {
         if (MsgBox.Show(this, true, "Save changes to note?"))
         {
             Popup popupArchive = PopupCur.Copy();
             popupArchive.IsArchived      = true;
             popupArchive.PopupNumArchive = PopupCur.PopupNum;
             Popups.Insert(popupArchive);
             PopupCur.Description   = textDescription.Text;
             PopupCur.DateTimeEntry = DateTime.Now;
             PopupCur.UserNum       = Security.CurUser.UserNum;
             Popups.Update(PopupCur);
         }
     }
     else
     {
         MinutesDisabled = 10;
     }
     DialogResult = DialogResult.OK;
 }