Пример #1
0
        private void gridMain_CellDoubleClick(object sender, ODGridClickEventArgs e)
        {
            PrefName prefName           = (PrefName)gridMain.Rows[e.Row].Tag;
            FormRecallMessageEdit FormR = new FormRecallMessageEdit(prefName);

            if (_selectedClinicNum == 0)
            {
                FormR.MessageVal = PrefC.GetString(prefName);
            }
            else
            {
                ClinicPref clinicPref = ClinicPrefs.GetPref(prefName, _selectedClinicNum);
                if (clinicPref == null || string.IsNullOrEmpty(clinicPref.ValueString))
                {
                    FormR.MessageVal = PrefC.GetString(prefName);
                }
                else
                {
                    FormR.MessageVal = clinicPref.ValueString;
                }
            }
            FormR.ShowDialog();
            if (FormR.DialogResult != DialogResult.OK)
            {
                return;
            }
            if (_selectedClinicNum == 0)
            {
                if (Prefs.UpdateString(prefName, FormR.MessageVal))
                {
                    DataValid.SetInvalid(InvalidType.Prefs);
                }
            }
            else
            {
                if (ClinicPrefs.Upsert(prefName, _selectedClinicNum, FormR.MessageVal))
                {
                    DataValid.SetInvalid(InvalidType.ClinicPrefs);
                }
            }
            FillPrefs();
        }
Пример #2
0
        public static void Add(PhoneTile tile)
        {
            //if(selectedTile.PhoneCur==null) {//already validated
            if (tile.PhoneCur.CustomerNumber == "")
            {
                MsgBox.Show(langThis, "No phone number present.");
                return;
            }
            long patNum = tile.PhoneCur.PatNum;

            if (FormOpenDental.CurPatNum == 0)
            {
                MsgBox.Show(langThis, "Please select a patient in the main window first.");
                return;
            }
            if (patNum != 0)
            {
                MsgBox.Show(langThis, "The current number is already attached to a different customer.");
                return;
                //if(!MsgBox.Show(langThis,MsgBoxButtons.OKCancel,"The current number is already attached to a patient. Attach it to this patient instead?")) {
                //	return;
                //}
                //This crashes because we don't actually know what the number is.  Enhance later by storing actual number in phone grid.
                //PhoneNumber ph=PhoneNumbers.GetByVal(tile.PhoneCur.CustomerNumber);
                //ph.PatNum=FormOpenDental.CurPatNum;
                //PhoneNumbers.Update(ph);
            }
            else
            {
                string patName = Patients.GetLim(FormOpenDental.CurPatNum).GetNameLF();
                if (MessageBox.Show("Attach this phone number to " + patName + "?", "", MessageBoxButtons.OKCancel) != DialogResult.OK)
                {
                    return;
                }
                PhoneNumber ph = new PhoneNumber();
                ph.PatNum         = FormOpenDental.CurPatNum;
                ph.PhoneNumberVal = tile.PhoneCur.CustomerNumber;
                PhoneNumbers.Insert(ph);
            }
            //tell the phone server to refresh this row with the patient name and patnum
            DataValid.SetInvalid(InvalidType.PhoneNumbers);
        }
Пример #3
0
 private void butOK_Click(object sender, EventArgs e)
 {
     if (textYear.Text == "")
     {
         MessageBox.Show("Please enter a year.");
         return;
     }
     if (textYear.errorProvider1.GetError(textYear) != "")
     {
         MessageBox.Show("Invalid year, must be two digits.");
         return;
     }
     if (!FormEHR.ProvKeyIsValid(textLName.Text, textFName.Text, PIn.Int(textYear.Text), textKey.Text))
     {
         MsgBox.Show(this, "Invalid provider key");
         return;
     }
     _keyCur.LName     = textLName.Text;
     _keyCur.FName     = textFName.Text;
     _keyCur.YearValue = PIn.Int(textYear.Text);
     _keyCur.ProvKey   = textKey.Text;
     if (_keyCur.IsNew)
     {
         bool isFirstKey = false;
         if (!PrefC.GetBool(PrefName.IsAlertRadiologyProcsEnabled))
         {
             isFirstKey = !EhrProvKeys.HasEhrKeys();
         }
         EhrProvKeys.Insert(_keyCur);
         //if radiology procs alert is disabled and this is the first ehrprovkey, enable the alert (alert handled by the OpenDentalService)
         if (!PrefC.GetBool(PrefName.IsAlertRadiologyProcsEnabled) && isFirstKey)
         {
             Prefs.UpdateBool(PrefName.IsAlertRadiologyProcsEnabled, true);
             DataValid.SetInvalid(InvalidType.Prefs);
         }
     }
     else
     {
         EhrProvKeys.Update(_keyCur);
     }
     DialogResult = DialogResult.OK;
 }
Пример #4
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (textScanDocQuality.errorProvider1.GetError(textScanDocQuality) != "" ||
         textScanDocResolution.errorProvider1.GetError(textScanDocResolution) != "")
     {
         MessageBox.Show(Lan.g(this, "Please fix data entry errors first."));
         return;
     }
     if (textScanDocQuality.Text == "100" ||
         (radioScanDocUseOptionsBelow.Checked && PIn.Int(textScanDocResolution.Text) > 300))
     {
         if (!MsgBox.Show(this, MsgBoxButtons.YesNo, "With the provided settings the file created may be extremely large.  Would you like to continue?"))
         {
             return;
         }
     }
     ComputerPrefs.LocalComputer.ScanDocSelectSource = checkScanDocSelectSource.Checked;
     ComputerPrefs.LocalComputer.ScanDocShowOptions  = radioScanDocShowOptions.Checked;
     ComputerPrefs.LocalComputer.ScanDocDuplex       = checkScanDocDuplex.Checked;
     ComputerPrefs.LocalComputer.ScanDocGrayscale    = checkScanDocGrayscale.Checked;
     ComputerPrefs.LocalComputer.ScanDocResolution   = PIn.Int(textScanDocResolution.Text);
     ComputerPrefs.LocalComputer.ScanDocQuality      = PIn.Byte(textScanDocQuality.Text);
     //Prefs.UpdateLong(PrefName.ScannerCompression,PIn.Long(textScanDocQuality.Text));
     Prefs.UpdateLong(PrefName.ImageWindowingMin, slider.MinVal);
     Prefs.UpdateLong(PrefName.ImageWindowingMax, slider.MaxVal);
     //Prefs.UpdateBool(PrefName.ScannerSuppressDialog,checkScanDocShowOptions.Checked);
     //Prefs.UpdateLong(PrefName.ScannerResolution,PIn.Long(textScanDocResolution.Text));
     ComputerPrefs.LocalComputer.SensorType     = comboType.Text;
     ComputerPrefs.LocalComputer.SensorPort     = (int)upDownPort.Value;
     ComputerPrefs.LocalComputer.SensorExposure = (int)upDownExposure.Value;
     ComputerPrefs.LocalComputer.SensorBinned   = checkBinned.Checked;
     ComputerPrefs.Update(ComputerPrefs.LocalComputer);
     DataValid.SetInvalid(InvalidType.Prefs);
     if (_scanDocSelectSourceOld != checkScanDocSelectSource.Checked)
     {
         SecurityLogs.MakeLogEntry(Permissions.Setup, 0
                                   , Lan.g(this, "Show Select Scanner Window option changed from") + " "
                                   + (_scanDocSelectSourceOld?Lan.g(this, "true"):Lan.g(this, "false")) + " "
                                   + Lan.g(this, "to") + " " + (checkScanDocSelectSource.Checked?Lan.g(this, "true"):Lan.g(this, "false")));
     }
     DialogResult = DialogResult.OK;
 }
Пример #5
0
        /*
         * private void butDownloadClaimform_Click(object sender,EventArgs e) {
         *      Cursor=Cursors.WaitCursor;
         *      FormP=new FormProgress();//just so the InstanceMethod won't crash.  We won't be telling user about progress.
         *      FormP.DisplayText="";
         *      //Application.DoEvents();
         *      string remoteUri=textWebsitePath.Text+textRegClaimform.Text+"/";
         *      WebRequest wr;
         *      WebResponse webResp;
         *      //int fileSize;
         *      //copy image file if one is specified-------------------------------------------------------------------------------
         *      if(BackgroundImg!=""){
         *              myStringWebResource=remoteUri+BackgroundImg;
         *              WriteToFile=ODFileUtils.CombinePaths(FormPath.GetPreferredImagePath(),BackgroundImg);
         *              if(File.Exists(WriteToFile)){
         *                      File.Delete(WriteToFile);
         *              }
         *              wr= WebRequest.Create(myStringWebResource);
         *              int fileSize;
         *              try{
         *                      webResp= wr.GetResponse();
         *                      fileSize=(int)webResp.ContentLength/1024;
         *              }
         *              catch(Exception ex){
         *                      Cursor=Cursors.Default;
         *                      MessageBox.Show("Error downloading "+BackgroundImg+". "+ex.Message);
         *                      return;
         *                      //fileSize=0;
         *              }
         *              if(fileSize>0){
         *                      //start the thread that will perform the download
         *                      System.Threading.ThreadStart downloadDelegate=
         *                              delegate { DownloadInstallPatchWorker(myStringWebResource,WriteToFile,ref FormP); };
         *                      Thread workerThread=new System.Threading.Thread(downloadDelegate);
         *                      workerThread.Start();
         *                      //display the progress dialog to the user:
         *                      FormP.MaxVal=(double)fileSize/1024;
         *                      FormP.NumberMultiplication=100;
         *                      FormP.DisplayText="?currentVal MB of ?maxVal MB copied";
         *                      FormP.NumberFormat="F";
         *                      FormP.ShowDialog();
         *                      if(FormP.DialogResult==DialogResult.Cancel) {
         *                              workerThread.Abort();
         *                              Cursor=Cursors.Default;
         *                              return;
         *                      }
         *                      MsgBox.Show(this,"Image file downloaded successfully.");
         *              }
         *      }
         *      Cursor=Cursors.WaitCursor;//have to do this again for some reason.
         *      //Import ClaimForm.xml----------------------------------------------------------------------------------
         *      myStringWebResource=remoteUri+"ClaimForm.xml";
         *      WriteToFile=ODFileUtils.CombinePaths(FormPath.GetPreferredImagePath(),"ClaimForm.xml");
         *      if(File.Exists(WriteToFile)){
         *              File.Delete(WriteToFile);
         *      }
         *      try{
         *              DownloadInstallPatchWorker(myStringWebResource,WriteToFile,ref FormP);
         *      }
         *      catch{
         *      }
         *      int rowsAffected;
         *      if(File.Exists(WriteToFile)){
         *              int newclaimformnum=0;
         *              try{
         *                      newclaimformnum=FormClaimForms.ImportForm(WriteToFile,true);
         *              }
         *              catch(ApplicationException ex){
         *                      Cursor=Cursors.Default;
         *                      MessageBox.Show(ex.Message);
         *                      return;
         *              }
         *              finally{
         *                      File.Delete(WriteToFile);
         *              }
         *              if(newclaimformnum!=0){
         *                      Prefs.UpdateInt("DefaultClaimForm",newclaimformnum);
         *              }
         *              //switch all insplans over to new claimform
         *              ClaimForm oldform=null;
         *              for(int i=0;i<ClaimForms.ListLong.Length;i++){
         *                      if(ClaimForms.ListLong[i].UniqueID==OldClaimFormID){
         *                              oldform=ClaimForms.ListLong[i];
         *                      }
         *              }
         *              if(oldform!=null){
         *                      rowsAffected=InsPlans.ConvertToNewClaimform(oldform.ClaimFormNum,newclaimformnum);
         *                      MessageBox.Show("Number of insurance plans changed to new form: "+rowsAffected.ToString());
         *              }
         *              DataValid.SetInvalid(InvalidTypes.ClaimForms | InvalidTypes.Prefs);
         *      }
         *      //Import ProcCodes.xml------------------------------------------------------------------------------------
         *      myStringWebResource=remoteUri+"ProcCodes.xml";
         *      WriteToFile=ODFileUtils.CombinePaths(FormPath.GetPreferredImagePath(),"ProcCodes.xml");
         *      if(File.Exists(WriteToFile)) {
         *              File.Delete(WriteToFile);
         *      }
         *      try {
         *              DownloadInstallPatchWorker(myStringWebResource,WriteToFile,ref FormP);
         *      }
         *      catch {
         *      }
         *      if(File.Exists(WriteToFile)){
         *              //move T codes over to a new "Obsolete" category which is hidden
         *              ProcedureCodes.TcodesMove();
         *              rowsAffected=0;
         *              try {
         *                      rowsAffected=FormProcCodes.ImportProcCodes(WriteToFile,false);
         *              }
         *              catch(ApplicationException ex) {
         *                      Cursor=Cursors.Default;
         *                      MessageBox.Show(ex.Message);
         *                      return;
         *              }
         *              finally {
         *                      File.Delete(WriteToFile);
         *              }
         *              ProcedureCodes.Refresh();//?
         *              MessageBox.Show("Procedure codes inserted: "+rowsAffected.ToString());
         *              //Change all procbuttons and autocodes from T to D.
         *              ProcedureCodes.TcodesAlter();
         *              DataValid.SetInvalid(InvalidTypes.AutoCodes | InvalidTypes.Defs | InvalidTypes.ProcCodes | InvalidTypes.ProcButtons);
         *      }
         *      MsgBox.Show(this,"Done");
         *      Cursor=Cursors.Default;
         * }*/

        private void SavePrefs()
        {
            bool changed = false;

            if (Prefs.UpdateString("RegistrationNumber", textRegMain.Text))
            {
                changed = true;
            }
            //if(Prefs.UpdateString("RegistrationNumberClaim",textRegClaimform.Text)) {
            //	changed=true;
            //}
            if (Prefs.UpdateString("UpdateWebsitePath", textWebsitePath.Text))
            {
                changed = true;
            }
            if (changed)
            {
                DataValid.SetInvalid(InvalidTypes.Prefs);
            }
        }
Пример #6
0
 private void FormApptTypes_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (!IsSelectionMode)
     {
         if (_isChanged)
         {
             Prefs.UpdateBool(PrefName.AppointmentTypeShowPrompt, checkPrompt.Checked);
             Prefs.UpdateBool(PrefName.AppointmentTypeShowWarning, checkWarn.Checked);
             for (int i = 0; i < _listApptTypes.Count; i++)
             {
                 _listApptTypes[i].ItemOrder = i;
             }
             AppointmentTypes.Sync(_listApptTypes, _listApptTypesOld);
             //LogEntry(_listApptTypes,_listApptTypesOld);//no longer needed, originally used to diagnose a bugin the middle teir.
             DataValid.SetInvalid(InvalidType.AppointmentTypes);
             DataValid.SetInvalid(InvalidType.Prefs);
         }
         DialogResult = DialogResult.OK;
     }
 }
Пример #7
0
 private void butDelete_Click(object sender, EventArgs e)
 {
     if (_keyCur.IsNew)
     {
         DialogResult = DialogResult.Cancel;
         return;
     }
     if (!MsgBox.Show(this, MsgBoxButtons.OKCancel, "Delete?"))
     {
         return;
     }
     EhrProvKeys.Delete(_keyCur.EhrProvKeyNum);
     //if the radiology proc alert is enabled and they just deleted the last ehrprovkey, disable the alert (OpenDentalService will stop alerting)
     if (PrefC.GetBool(PrefName.IsAlertRadiologyProcsEnabled) && !EhrProvKeys.HasEhrKeys())
     {
         Prefs.UpdateBool(PrefName.IsAlertRadiologyProcsEnabled, false);
         DataValid.SetInvalid(InvalidType.Prefs);
     }
     DialogResult = DialogResult.OK;
 }
Пример #8
0
 private void butOK_Click(object sender, EventArgs e)
 {
     if (textRedCalls.errorProvider1.GetError(textRedCalls) != "" ||
         textVMCalls.errorProvider1.GetError(textVMCalls) != "" ||
         textCallsWarning.errorProvider1.GetError(textCallsWarning) != "" ||
         textCalls.errorProvider1.GetError(textCalls) != "" ||
         textRedTime.errorProvider1.GetError(textRedTime) != "" ||
         textVMTime.errorProvider1.GetError(textVMTime) != "" ||
         textTimeWarning.errorProvider1.GetError(textTimeWarning) != "" ||
         textTime.errorProvider1.GetError(textTime) != "")
     {
         MsgBox.Show(this, "All fields must be whole numbers.  Please fix data entry errors first.");
         return;
     }
     if (SavePrefs())
     {
         DataValid.SetInvalid(InvalidType.Prefs);
     }
     DialogResult = DialogResult.OK;
 }
Пример #9
0
        ///<summary>If the named fee schedule does not exist, then it will be created.  It always returns the defnum for the feesched used, regardless of whether it already existed.  procCode must have already been tested for valid code, and feeSchedName must not be blank.</summary>
        public static long ImportTrojan(string procCode, double amt, string feeSchedName)
        {
            FeeSched feeSched = FeeScheds.GetByExactName(feeSchedName);

            //if isManaged, then this should be done differently from here on out.
            if (feeSched == null)
            {
                //add the new fee schedule
                feeSched              = new FeeSched();
                feeSched.ItemOrder    = FeeSchedC.ListLong.Count;
                feeSched.Description  = feeSchedName;
                feeSched.FeeSchedType = FeeScheduleType.Normal;
                //feeSched.IsNew=true;
                FeeScheds.Insert(feeSched);
                //Cache.Refresh(InvalidType.FeeScheds);
                //Fees.Refresh();
                DataValid.SetInvalid(InvalidType.FeeScheds, InvalidType.Fees);
            }
            if (feeSched.IsHidden)
            {
                feeSched.IsHidden = false;              //unhide it
                FeeScheds.Update(feeSched);
                DataValid.SetInvalid(InvalidType.FeeScheds);
            }
            Fee fee = Fees.GetFee(ProcedureCodes.GetCodeNum(procCode), feeSched.FeeSchedNum);

            if (fee == null)
            {
                fee          = new Fee();
                fee.Amount   = amt;
                fee.FeeSched = feeSched.FeeSchedNum;
                fee.CodeNum  = ProcedureCodes.GetCodeNum(procCode);
                Fees.Insert(fee);
            }
            else
            {
                fee.Amount = amt;
                Fees.Update(fee);
            }
            return(feeSched.FeeSchedNum);
        }
Пример #10
0
        private void butOK_Click(object sender, System.EventArgs e)
        {
            if (prog == null)
            {
                MsgBox.Show(this, "X-Charge entry is missing from the database.");               //should never happen
                return;
            }
            if (textOverride.Text != "")
            {
                if (!File.Exists(textOverride.Text))
                {
                    MsgBox.Show(this, "Local override path is not valid.");
                    return;
                }
            }
            else if (!File.Exists(textPath.Text))
            {
                MsgBox.Show(this, "Path is not valid.");
                return;
            }
            if (comboPaymentType.SelectedIndex == -1)
            {
                MsgBox.Show(this, "Please select a payment type first.");
                return;
            }
            prog.Enabled = checkEnabled.Checked;
            prog.Path    = textPath.Text;
            if (pathOverrideOld != textOverride.Text)
            {
                ProgramProperties.InsertOrUpdateLocalOverridePath(prog.ProgramNum, textOverride.Text);
                ProgramProperties.RefreshCache();
            }
            Programs.Update(prog);
            string paymentType = DefC.Short[(int)DefCat.PaymentTypes][comboPaymentType.SelectedIndex].DefNum.ToString();

            ProgramProperties.SetProperty(prog.ProgramNum, "PaymentType", paymentType);
            ProgramProperties.SetProperty(prog.ProgramNum, "Username", textUser.Text);
            ProgramProperties.SetProperty(prog.ProgramNum, "Password", textPassword.Text);
            DataValid.SetInvalid(InvalidType.Programs);
            DialogResult = DialogResult.OK;
        }
Пример #11
0
 private void butDelete_Click(object sender, System.EventArgs e)
 {
     if (IsNew)
     {
         DialogResult = DialogResult.Cancel;
         return;
     }
     if (PrefC.GetLong(PrefName.DefaultUserGroup) == CurGroup.UserGroupNum)
     {
         MsgBox.Show(this, "Cannot delete user group that is set as the default user group.");
         return;
     }
     try{
         UserGroups.Delete(CurGroup);
         DataValid.SetInvalid(InvalidType.Security);
         DialogResult = DialogResult.OK;
     }
     catch (Exception ex) {
         MessageBox.Show(ex.Message);
     }
 }
Пример #12
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.");
            }
        }
Пример #13
0
 private void butDelete_Click(object sender, EventArgs e)
 {
     if (RepServ.IsNew)
     {
         DialogResult = DialogResult.Cancel;
         return;
     }
     if (!MsgBox.Show(this, MsgBoxButtons.OKCancel, "Delete?"))
     {
         return;
     }
     if (RepServ.ReplicationServerNum == PrefC.GetLong(PrefName.ReplicationUserQueryServer))           //Current report server.
     {
         if (Prefs.UpdateLong(PrefName.ReplicationUserQueryServer, 0))
         {
             DataValid.SetInvalid(InvalidType.Prefs);
         }
     }
     ReplicationServers.DeleteObject(RepServ.ReplicationServerNum);
     DialogResult = DialogResult.OK;
 }
Пример #14
0
 private void textWebSchedPerDay_Leave(object sender, EventArgs e)
 {
     if (!textWebSchedPerDay.IsValid)
     {
         return;
     }
     if (_selectedClinicNum == 0)
     {
         if (Prefs.UpdateString(PrefName.WebSchedAsapTextLimit, textWebSchedPerDay.Text))
         {
             DataValid.SetInvalid(InvalidType.Prefs);
         }
     }
     else
     {
         if (ClinicPrefs.Upsert(PrefName.WebSchedAsapTextLimit, _selectedClinicNum, textWebSchedPerDay.Text))
         {
             DataValid.SetInvalid(InvalidType.ClinicPrefs);
         }
     }
 }
Пример #15
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (textDoc.errorProvider1.GetError(textDoc) != "" ||
         textScanningResolution.errorProvider1.GetError(textScanningResolution) != "")
     {
         MessageBox.Show(Lan.g(this, "Please fix data entry errors first."));
         return;
     }
     Prefs.UpdateLong(PrefName.ScannerCompression, PIn.Long(textDoc.Text));
     Prefs.UpdateLong(PrefName.ImageWindowingMin, slider.MinVal);
     Prefs.UpdateLong(PrefName.ImageWindowingMax, slider.MaxVal);
     Prefs.UpdateBool(PrefName.ScannerSuppressDialog, checkBoxSuppressScanDialog.Checked);
     Prefs.UpdateLong(PrefName.ScannerResolution, PIn.Long(textScanningResolution.Text));
     ComputerPrefs.LocalComputer.SensorType     = comboType.Text;
     ComputerPrefs.LocalComputer.SensorPort     = (int)upDownPort.Value;
     ComputerPrefs.LocalComputer.SensorExposure = (int)upDownExposure.Value;
     ComputerPrefs.LocalComputer.SensorBinned   = checkBinned.Checked;
     ComputerPrefs.Update(ComputerPrefs.LocalComputer);
     DataValid.SetInvalid(InvalidType.Prefs);
     DialogResult = DialogResult.OK;
 }
Пример #16
0
        private void FormApptViews_FormClosing(object sender, FormClosingEventArgs e)
        {
            int newIncrement = 15;

            if (radioFive.Checked)
            {
                newIncrement = 5;
            }
            if (radioTen.Checked)
            {
                newIncrement = 10;
            }
            if (Prefs.UpdateInt(PrefName.AppointmentTimeIncrement, newIncrement))
            {
                DataValid.SetInvalid(InvalidType.Prefs);
            }
            if (viewChanged)
            {
                DataValid.SetInvalid(InvalidType.Views);
            }
        }
Пример #17
0
        private void gridMain_CellDoubleClick(object sender, ODGridClickEventArgs e)
        {
            Carrier carrier = Carriers.GetCarrier(PIn.Long(table.Rows[e.Row]["CarrierNum"].ToString()));

            if (IsSelectMode)
            {
                SelectedCarrier = carrier;
                DialogResult    = DialogResult.OK;
                return;
            }
            FormCarrierEdit FormCE = new FormCarrierEdit();

            FormCE.CarrierCur = carrier;
            FormCE.ShowDialog();
            if (FormCE.DialogResult != DialogResult.OK)
            {
                return;
            }
            FillGrid();
            DataValid.SetInvalid(InvalidType.Carriers);
        }
Пример #18
0
        private void gridAllMedications_CellClick(object sender, ODGridClickEventArgs e)
        {
            Medication med = (Medication)gridAllMedications.Rows[e.Row].Tag;

            if (CultureInfo.CurrentCulture.Name.EndsWith("US") && e.Col == 3)           //United States RxNorm Column
            {
                FormRxNorms formRxNorm = new FormRxNorms();
                formRxNorm.IsSelectionMode          = true;
                formRxNorm.InitSearchCodeOrDescript = med.MedName;
                formRxNorm.ShowDialog();
                if (formRxNorm.DialogResult == DialogResult.OK)
                {
                    med.RxCui = PIn.Long(formRxNorm.SelectedRxNorm.RxCui);
                    //The following behavior mimics FormMedicationEdit OK click.
                    Medications.Update(med);
                    MedicationPats.UpdateRxCuiForMedication(med.MedicationNum, med.RxCui);
                    DataValid.SetInvalid(InvalidType.Medications);
                }
                FillTab();
            }
        }
Пример #19
0
 private void checkPasswordsMustBeStrong_Click(object sender, EventArgs e)
 {
     if (checkPasswordsMustBeStrong.Checked)
     {
         Prefs.UpdateBool(PrefName.PasswordsMustBeStrong, true);
         DataValid.SetInvalid(InvalidType.Prefs);
     }
     else             //unchecking the box
     {
         if (!MsgBox.Show(this, MsgBoxButtons.OKCancel, "Warning.  If this box is unchecked, the strong password flag on all users will be reset.  If strong passwords are again turned on later, then each users will have to edit their password in order to cause the strong password flag to be set again."))
         {
             checkPasswordsMustBeStrong.Checked = true;                  //recheck it.
             return;
         }
         Userods.ResetStrongPasswordFlags();
         Prefs.UpdateBool(PrefName.PasswordsMustBeStrong, false);
         DataValid.SetInvalid(InvalidType.Security, InvalidType.Prefs);
         FillUsers();
         FillTreePerm();
     }
 }
Пример #20
0
        private void butOK_Click(object sender, EventArgs e)
        {
            bool isVisible = false;

            for (int i = 0; i < _listNewOrthoChartTabs.Count; i++)
            {
                _listNewOrthoChartTabs[i].ItemOrder = i;
                if (!_listNewOrthoChartTabs[i].IsHidden)
                {
                    isVisible = true;
                }
            }
            if (!isVisible)
            {
                MsgBox.Show(this, "At least one tab must not be hidden.");
                return;
            }
            OrthoChartTabs.Sync(_listNewOrthoChartTabs, _listDbOrthoChartTabs);
            DataValid.SetInvalid(InvalidType.OrthoChartTabs);
            DialogResult = DialogResult.OK;
        }
Пример #21
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     /*string remoteUri = "http://www.open-dent.com/languages/";
      * string fileName = CultureInfo.CurrentCulture.TwoLetterISOLanguageName+".sql";//eg. es.sql for spanish
      * //string fileName="bogus.sql";
      * string myStringWebResource = null;
      * WebClient myWebClient = new WebClient();
      * myStringWebResource = remoteUri + fileName;
      * try{
      *      //myWebClient.Credentials=new NetworkCredential("username","password","www.open-dent.com");
      *      myWebClient.DownloadFile(myStringWebResource,fileName);
      * }
      * catch{
      *      MessageBox.Show("Either you do not have internet access, or no translations are available for "+CultureInfo.CurrentCulture.Parent.DisplayName);
      *      return;
      * }
      * ClassConvertDatabase ConvertDB=new ClassConvertDatabase();
      * if(!ConvertDB.ExecuteFile(fileName)){
      *      MessageBox.Show("Translations not installed properly.");
      *      return;
      * }
      * LanguageForeigns.Refresh();
      * MessageBox.Show("Done");*/
     //remember that user might be using a website or a linux box to store images, therefore must allow forward slashes.
     if (optUseFolder.Checked && GetPreferredImagePath(textDocPath.Text) == null)
     {
         MsgBox.Show(this, "Please enter a valid path in the first box.");
         return;
     }
     if (
         Prefs.UpdateBool("AtoZfolderNotRequired", optDisableFolders.Checked)
         | Prefs.UpdateString("DocPath", textDocPath.Text)
         | Prefs.UpdateString("ExportPath", textExportPath.Text)
         | Prefs.UpdateString("LetterMergePath", textLetterMergePath.Text)
         | Prefs.UpdateString("ImageStore", optUseDatabase.Checked ? typeof(SqlStore).FullName : typeof(FileStore).FullName))
     {
         DataValid.SetInvalid(InvalidTypes.Prefs);
     }
     DialogResult = DialogResult.OK;
 }
Пример #22
0
        private void butEditZip_Click(object sender, EventArgs e)
        {
            if (textZip.Text.Length == 0)
            {
                MessageBox.Show(Lan.g(this, "Please enter a zipcode first."));
                return;
            }
            List <ZipCode> listZipCodes = ZipCodes.GetALMatches(textZip.Text);

            if (listZipCodes.Count == 0)
            {
                FormZipCodeEdit FormZE = new FormZipCodeEdit();
                FormZE.ZipCodeCur = new ZipCode();
                FormZE.ZipCodeCur.ZipCodeDigits = textZip.Text;
                FormZE.IsNew = true;
                FormZE.ShowDialog();
                FillComboZip();
                if (FormZE.DialogResult != DialogResult.OK)
                {
                    return;
                }
                DataValid.SetInvalid(InvalidType.ZipCodes);
                textCity.Text  = FormZE.ZipCodeCur.City;
                textState.Text = FormZE.ZipCodeCur.State;
                textZip.Text   = FormZE.ZipCodeCur.ZipCodeDigits;
            }
            else
            {
                FormZipSelect FormZS = new FormZipSelect();
                FormZS.ShowDialog();
                FillComboZip();
                if (FormZS.DialogResult != DialogResult.OK)
                {
                    return;
                }
                textCity.Text  = FormZS.ZipSelected.City;
                textState.Text = FormZS.ZipSelected.State;
                textZip.Text   = FormZS.ZipSelected.ZipCodeDigits;
            }
        }
Пример #23
0
        private void butOK_Click(object sender, EventArgs e)
        {
            Cursor = Cursors.WaitCursor;
            if (!Directory.Exists(textExportFolder.Text))
            {
                Cursor = Cursors.Default;
                MsgBox.Show(this, "Export folder does not exist.");
                return;
            }
            if (comboBillType.SelectedIndex == -1)
            {
                Cursor = Cursors.Default;
                MsgBox.Show(this, "Please select a billing type.");
                return;
            }
            if (!Regex.IsMatch(textPassword.Text, @"^[A-Z]{2}\d{4}$"))
            {
                Cursor = Cursors.Default;
                MsgBox.Show(this, "Password is not in correct format. Must be like this: AB1234");
                return;
            }
            long billtype   = _listBillingTypeDefs[comboBillType.SelectedIndex].DefNum;
            bool hasChanges = false;

            if (_progCur.Enabled != checkEnabled.Checked)
            {
                _progCur.Enabled = checkEnabled.Checked;
                Programs.Update(_progCur);
                hasChanges = true;
            }
            if (hasChanges
                | ProgramProperties.SetProperty(_progCur.ProgramNum, "FolderPath", textExportFolder.Text) > 0
                | ProgramProperties.SetProperty(_progCur.ProgramNum, "BillingType", billtype.ToString()) > 0
                | ProgramProperties.SetProperty(_progCur.ProgramNum, "Password", textPassword.Text) > 0)
            {
                DataValid.SetInvalid(InvalidType.Programs);
            }
            Cursor       = Cursors.Default;
            DialogResult = DialogResult.OK;
        }
Пример #24
0
        private void butOK_Click(object sender, System.EventArgs e)
        {
            if (textRegKey.Text != "" &&
                !Regex.IsMatch(textRegKey.Text, @"^[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}$") &&
                !Regex.IsMatch(textRegKey.Text, @"^[A-Z0-9]{16}$"))
            {
                MsgBox.Show(this, "Invalid registration key format.");
                return;
            }
            if (textMultiple.Text.Contains(" "))
            {
                MsgBox.Show(this, "No spaces allowed in the database list.");
                return;
            }
            string regkey = "";

            if (Regex.IsMatch(textRegKey.Text, @"^[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}$"))
            {
                regkey = textRegKey.Text.Substring(0, 4) + textRegKey.Text.Substring(5, 4)
                         + textRegKey.Text.Substring(10, 4) + textRegKey.Text.Substring(15, 4);
            }
            else if (Regex.IsMatch(textRegKey.Text, @"^[A-Z0-9]{16}$"))
            {
                regkey = textRegKey.Text;
            }
            if (Prefs.UpdateString(PrefName.UpdateServerAddress, textUpdateServerAddress.Text)
                | Prefs.UpdateBool(PrefName.UpdateShowMsiButtons, checkShowMsi.Checked)
                | Prefs.UpdateString(PrefName.UpdateWebsitePath, textWebsitePath.Text)
                | Prefs.UpdateString(PrefName.UpdateWebProxyAddress, textWebProxyAddress.Text)
                | Prefs.UpdateString(PrefName.UpdateWebProxyUserName, textWebProxyUserName.Text)
                | Prefs.UpdateString(PrefName.UpdateWebProxyPassword, textWebProxyPassword.Text)
                | Prefs.UpdateString(PrefName.RegistrationKey, regkey)
                | Prefs.UpdateString(PrefName.UpdateMultipleDatabases, textMultiple.Text))
            {
                Cursor = Cursors.WaitCursor;
                DataValid.SetInvalid(InvalidType.Prefs);
                Cursor = Cursors.Default;
            }
            DialogResult = DialogResult.OK;
        }
Пример #25
0
        private void butOK_Click(object sender, EventArgs e)
        {
            bool changed = false;
            Dictionary <string, List <Userod> > dictFailedUserUpdates = new Dictionary <string, List <Userod> >();

            for (int i = 0; i < UserList.Count; i++)
            {
                if (UserList[i].TaskListInBox != UserListOld[i].TaskListInBox)
                {
                    try {
                        Userods.Update(UserList[i]);
                        changed = true;
                    }
                    catch (Exception ex) {
                        if (!dictFailedUserUpdates.ContainsKey(ex.Message))
                        {
                            dictFailedUserUpdates.Add(ex.Message, new List <Userod>());
                        }
                        dictFailedUserUpdates[ex.Message].Add(UserList[i]);
                    }
                }
            }
            if (dictFailedUserUpdates.Count > 0)           //Inform user that user inboxes could not be updated.
            {
                StringBuilder sb = new StringBuilder();
                foreach (string exceptionMsgKey in dictFailedUserUpdates.Keys)
                {
                    foreach (Userod user in dictFailedUserUpdates[exceptionMsgKey])
                    {
                        sb.AppendLine("  " + user.UserName + " - " + exceptionMsgKey);
                    }
                }
                MessageBox.Show(this, Lans.g(this, "The following users could not be updated:\r\n") + sb.ToString());
            }
            if (changed)
            {
                DataValid.SetInvalid(InvalidType.Security);
            }
            DialogResult = DialogResult.OK;
        }
Пример #26
0
 private void FormDiseaseDefs_Load(object sender, System.EventArgs e)
 {
     if (DiseaseDefs.FixItemOrders())
     {
         DataValid.SetInvalid(InvalidType.Diseases);
     }
     _listSecurityLogMsgs = new List <string>();
     if (IsSelectionMode)
     {
         //Hide and change UI buttons
         butClose.Text            = Lan.g(this, "Cancel");
         butDown.Visible          = false;
         butUp.Visible            = false;
         labelAlphabetize.Visible = false;
         butAlphabetize.Visible   = false;
         checkShowHidden.Visible  = false;
         if (IsMultiSelect)
         {
             gridMain.SelectionMode = GridSelectionMode.MultiExtended;
         }
         //show only non-hidden items.
         _listDiseaseDefs = DiseaseDefs.GetDeepCopy(true);
     }
     else
     {
         //change UI
         butOK.Visible = false;
         //show all items, including hidden.
         _listDiseaseDefs = DiseaseDefs.GetDeepCopy();
     }
     //If the user has passed in DiseaseDefs, those should be highlighted. Otherwise, initialize a new List<DiseaseDef>.
     if (ListSelectedDiseaseDefs == null)
     {
         ListSelectedDiseaseDefs = new List <DiseaseDef>();
     }
     _listDiseaseDefsOld              = _listDiseaseDefs.Select(x => x.Copy()).ToList();
     _listDiseaseDefsShowing          = new List <DiseaseDef>();//fillGrid takes care of filling this.
     _listDiseaseDefsNumsNotDeletable = DiseaseDefs.ValidateDeleteList(_listDiseaseDefs.Select(x => x.DiseaseDefNum).ToList());
     FillGrid();
 }
Пример #27
0
        private void butSiteLink_Click(object sender, EventArgs e)
        {
            SiteLink siteLink = SiteLinks.GetFirstOrDefault(x => x.SiteNum == SiteCur.SiteNum);

            if (siteLink == null)
            {
                siteLink = new SiteLink()
                {
                    SiteNum    = SiteCur.SiteNum,
                    ForeColor  = Color.Black,
                    InnerColor = Color.LightCyan,
                    OuterColor = Color.Blue
                };
            }
            FormSiteLinkEdit FormSE = new FormSiteLinkEdit(siteLink);

            FormSE.ShowDialog();
            if (FormSE.DialogResult == DialogResult.OK)
            {
                DataValid.SetInvalid(InvalidType.Sites);
            }
        }
Пример #28
0
        private void butOK_Click(object sender, EventArgs e)
        {
            _categoryCur.Description = textDesc.Text;
            List <AlertType> listSelectedTypes = listBoxAlertTypes.SelectedIndices
                                                 .OfType <int>()
                                                 .Select(x => (AlertType)listShownAlertTypes[x])
                                                 .ToList();
            List <AlertCategoryLink> listNewAlertCategoryType = listOldAlertCategoryLinks.Select(x => x.Copy()).ToList();

            listNewAlertCategoryType.RemoveAll(x => !listSelectedTypes.Contains(x.AlertType));            //Remove unselected AlertTypes
            foreach (AlertType type in listSelectedTypes)
            {
                if (!listOldAlertCategoryLinks.Exists(x => x.AlertType == type))               //Add newly selected AlertTypes.
                {
                    listNewAlertCategoryType.Add(new AlertCategoryLink(_categoryCur.AlertCategoryNum, type));
                }
            }
            AlertCategoryLinks.Sync(listNewAlertCategoryType, listOldAlertCategoryLinks);
            AlertCategories.Update(_categoryCur);
            DataValid.SetInvalid(InvalidType.AlertCategoryLinks, InvalidType.AlertCategories);
            DialogResult = DialogResult.OK;
        }
Пример #29
0
        private void butChangeTime_Click(object sender, EventArgs e)
        {
            FormTimePick FormTP = new FormTimePick(true);

            if (_updateTime != DateTime.MinValue)
            {
                FormTP.SelectedDTime = _updateTime;
            }
            FormTP.ShowDialog();
            if (FormTP.DialogResult == DialogResult.OK)
            {
                _updateTime         = FormTP.SelectedDTime;
                textUpdateTime.Text = _updateTime.ToString();
                if (Prefs.UpdateDateT(PrefName.UpdateDateTime, _updateTime))
                {
                    //Updating to db now in case the user does not have enough permission to click the OK button on this form.
                    Cursor = Cursors.WaitCursor;
                    DataValid.SetInvalid(InvalidType.Prefs);
                    Cursor = Cursors.Default;
                }
            }
        }
Пример #30
0
        private void FormDefinitions_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            //Correct the item orders of all definition categories.
            List <Def> listDefUpdates = new List <Def>();

            foreach (KeyValuePair <DefCat, List <Def> > kvp in Defs.GetDeepCopy())
            {
                for (int i = 0; i < kvp.Value.Count; i++)
                {
                    if (kvp.Value[i].ItemOrder != i)
                    {
                        kvp.Value[i].ItemOrder = i;
                        listDefUpdates.Add(kvp.Value[i]);
                    }
                }
            }
            listDefUpdates.ForEach(x => Defs.Update(x));
            if (_isDefChanged || listDefUpdates.Count > 0)
            {
                DataValid.SetInvalid(InvalidType.Defs);
            }
        }