Update() public méthode

public Update ( ) : void
Résultat void
 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;
 }
 private void butDelete_Click(object sender, EventArgs e)
 {
     if (PopupCur.IsNew)
     {
         DialogResult = DialogResult.Cancel;
         return;
     }
     //don't ask user to make it go faster.
     PopupCur.IsArchived      = true;
     PopupCur.PopupNumArchive = 0;
     Popups.Update(PopupCur);            //Runs an update to "archive" the popup, but allows it to be shown under the deleted section.
     DialogResult = DialogResult.OK;
 }
Exemple #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?"))
         {
             PopupCur.Description = textDescription.Text;
             Popups.Update(PopupCur);
         }
     }
     else
     {
         MinutesDisabled = 10;
     }
     DialogResult = DialogResult.OK;
 }
Exemple #4
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;
 }
 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;
 }
Exemple #6
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;
 }