Beispiel #1
0
 private void FormRecallTypes_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (changed)
     {
         DataValid.SetInvalid(InvalidType.RecallTypes);
         if (MessageBox.Show(Lan.g(this, "Recalls for all patients should be synchronized.  Synchronize now?"), "", MessageBoxButtons.YesNo)
             == DialogResult.Yes)
         {
             Cursor = Cursors.WaitCursor;
             GC.Collect();                    //free up resources since this could take a lot of memory
             _actionCloseRecallSyncProgress = ODProgressOld.ShowProgressStatus("RecallSyncEvent"
                                                                               , typeof(RecallSyncEvent)
                                                                               , tag: new ProgressBarHelper(Lan.g(this, "Running Prep Queries") + "...", null, 0, 100, ProgBarStyle.Marquee
                                                                                                            , progressBarEventType: ProgBarEventType.Header)
                                                                               , currentForm: this);
             bool syncSuccessful = Recalls.SynchAllPatients();
             _actionCloseRecallSyncProgress?.Invoke();
             GC.Collect();                    //clean up resources, force the garbage collector to collect since resources may remain tied-up
             Cursor = Cursors.Default;
             if (!syncSuccessful)
             {
                 MsgBox.Show(this, "Synch is currently running from a different workstation.  Recalls should be synchronized again later.");
             }
         }
     }
 }
Beispiel #2
0
        private void butSynch_Click(object sender, EventArgs e)
        {
            Cursor = Cursors.WaitCursor;
            GC.Collect();            //free up resources since this could take a lot of memory
            DataValid.SetInvalid(InvalidType.RecallTypes);
            _actionCloseRecallSyncProgress = ODProgressOld.ShowProgressStatus("RecallSyncEvent"
                                                                              , typeof(RecallSyncEvent)
                                                                              , tag: new ProgressBarHelper(Lan.g(this, "Running Prep Queries") + "...", null, 0, 100, ProgBarStyle.Marquee
                                                                                                           , progressBarEventType: ProgBarEventType.Header)
                                                                              , currentForm: this);
            bool syncCompleted = Recalls.SynchAllPatients();

            _actionCloseRecallSyncProgress?.Invoke();
            GC.Collect();            //clean up resources, force the garbage collector to collect since resources may remain tied-up
            Cursor = Cursors.Default;
            if (syncCompleted)
            {
                changed = false;
                MsgBox.Show(this, "Done.");
            }
            else
            {
                MsgBox.Show(this, "Synch is currently running from a different workstation.");
            }
        }
        private void butOK_Click(object sender, System.EventArgs e)
        {
            if (textMedicalCode.Text != "" && !ProcedureCodes.HList.Contains(textMedicalCode.Text))
            {
                MsgBox.Show(this, "Invalid medical code.  It must refer to an existing procedure code entered separately");
                return;
            }
            if (textSubstitutionCode.Text != "" && !ProcedureCodes.HList.Contains(textSubstitutionCode.Text))
            {
                MsgBox.Show(this, "Invalid substitution code.  It must refer to an existing procedure code entered separately");
                return;
            }
            bool DoSynchRecall = false;

            if (IsNew && checkSetRecall.Checked)
            {
                DoSynchRecall = true;
            }
            else if (ProcCode.SetRecall != checkSetRecall.Checked)          //set recall changed
            {
                DoSynchRecall = true;
            }
            if (DoSynchRecall)
            {
                if (!MsgBox.Show(this, true, "Because you have changed the recall setting for this procedure code, all your patient recalls will be resynchronized, which can take a minute or two.  Do you want to continue?"))
                {
                    return;
                }
            }
            ProcCode.AlternateCode1   = textAlternateCode1.Text;
            ProcCode.MedicalCode      = textMedicalCode.Text;
            ProcCode.SubstitutionCode = textSubstitutionCode.Text;
            ProcCode.SubstOnlyIf      = (SubstitutionCondition)comboSubstOnlyIf.SelectedIndex;
            ProcCode.Descript         = textDescription.Text;
            ProcCode.AbbrDesc         = textAbbrev.Text;
            ProcCode.LaymanTerm       = textLaymanTerm.Text;
            ProcCode.ProcTime         = strBTime.ToString();
            ProcCode.GraphicColor     = butColor.BackColor;
            ProcCode.SetRecall        = checkSetRecall.Checked;
            ProcCode.NoBillIns        = checkNoBillIns.Checked;
            ProcCode.IsProsth         = checkIsProsth.Checked;
            ProcCode.IsHygiene        = checkIsHygiene.Checked;
            ProcCode.IsCanadianLab    = checkIsCanadianLab.Checked;
            ProcCode.DefaultNote      = textNote.Text;
            ProcCode.PaintType        = (ToothPaintingType)listPaintType.SelectedIndex;
            ProcCode.TreatArea        = (TreatmentArea)listTreatArea.SelectedIndex + 1;
            ProcCode.BaseUnits        = Int16.Parse(textBaseUnits.Text.ToString());
            if (listCategory.SelectedIndex != -1)
            {
                ProcCode.ProcCat = DefB.Short[(int)DefCat.ProcCodeCats][listCategory.SelectedIndex].DefNum;
            }
            ProcedureCodes.Update(ProcCode);            //whether new or not.
            if (DoSynchRecall)
            {
                Cursor = Cursors.WaitCursor;
                Recalls.SynchAllPatients();
                Cursor = Cursors.Default;
            }
            DialogResult = DialogResult.OK;
        }
Beispiel #4
0
 private void butSynch_Click(object sender, EventArgs e)
 {
     Cursor = Cursors.WaitCursor;
     DataValid.SetInvalid(InvalidType.RecallTypes);
     Recalls.SynchAllPatients();
     changed = false;
     Cursor  = Cursors.Default;
     MsgBox.Show(this, "Done.");
 }
Beispiel #5
0
 private void FormRecallTypes_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (changed)
     {
         DataValid.SetInvalid(InvalidType.RecallTypes);
         if (MessageBox.Show(Lan.g(this, "Recalls for all patients should be synchronized.  Synchronize now?"), "", MessageBoxButtons.YesNo)
             == DialogResult.Yes)
         {
             Cursor = Cursors.WaitCursor;
             Recalls.SynchAllPatients();
             Cursor = Cursors.Default;
         }
     }
 }
Beispiel #6
0
        private void butSynch_Click(object sender, EventArgs e)
        {
            Cursor = Cursors.WaitCursor;
            GC.Collect();            //free up resources since this could take a lot of memory
            DataValid.SetInvalid(InvalidType.RecallTypes);
            Action actionCloseRecallSyncProgress = ODProgress.Show(ODEventType.RecallSync, typeof(RecallSyncEvent), Lan.g(this, "Running Prep Queries") + "...", false, true);
            bool   isSyncCompleted = Recalls.SynchAllPatients();

            actionCloseRecallSyncProgress?.Invoke();
            GC.Collect();            //clean up resources, force the garbage collector to collect since resources may remain tied-up
            Cursor = Cursors.Default;
            if (isSyncCompleted)
            {
                changed = false;
                MsgBox.Show(this, "Done.");
            }
            else
            {
                MsgBox.Show(this, "Synch is currently running from a different workstation.");
            }
        }