Esempio n. 1
0
        private void butAdd_Click(object sender, EventArgs e)
        {
            FormEhrProvKeyEditCust formK = new FormEhrProvKeyEditCust();

            formK.KeyCur               = new EhrProvKey();
            formK.KeyCur.PatNum        = Guarantor;
            formK.KeyCur.FullTimeEquiv = 1;
            formK.KeyCur.IsNew         = true;
            formK.ShowDialog();
            SecurityLogs.MakeLogEntry(Permissions.EhrKeyAdd, Guarantor, "Added provider key.");
            FillGrid();
        }
Esempio n. 2
0
        private void menuItemOptions_Click(object sender, EventArgs e)
        {
            if (!Security.IsAuthorized(Permissions.Setup))
            {
                return;
            }
            FormSheetSetup formSS = new FormSheetSetup();

            formSS.ShowDialog();
            SecurityLogs.MakeLogEntry(Permissions.Setup, 0, "ShowForms");
            FillGrid();
        }
Esempio n. 3
0
        private void menuItemImageCats_Click(object sender, EventArgs e)
        {
            if (!Security.IsAuthorized(Permissions.Setup))
            {
                return;
            }
            FormDefinitions formD = new FormDefinitions(DefCat.ImageCats);

            formD.ShowDialog();
            SecurityLogs.MakeLogEntry(Permissions.Setup, 0, "Defs");
            FillGrid();
        }
Esempio n. 4
0
        private void butMerge_Click(object sender, EventArgs e)
        {
            string differentFields = "";

            if (textProvNumFrom.Text == textProvNumInto.Text)
            {
                //do not attempt a merge if the same provider was selected twice, or if one of the fields is blank.
                MsgBox.Show(this, "You must select two different providers to merge.");
                return;
            }
            if (textNpiFrom.Text != textNpiInto.Text)
            {
                differentFields += "\r\nNPI";
            }
            if (textFullNameFrom.Text != textFullNameInto.Text)
            {
                differentFields += "\r\nFull Name";
            }
            long numPats   = Providers.CountPats(PIn.Long(textProvNumFrom.Text));
            long numClaims = Providers.CountClaims(PIn.Long(textProvNumFrom.Text));

            if (!MsgBox.Show(this, MsgBoxButtons.YesNo, "Are you sure?  The results are permanent and cannot be undone."))
            {
                return;
            }
            string msgText = "";

            if (differentFields != "")
            {
                msgText = Lan.g(this, "The following provider fields do not match") + ": " + differentFields + "\r\n";
            }
            msgText += Lan.g(this, "This change is irreversible") + ".  " + Lan.g(this, "This provider is the primary or secondary provider for") + " " + numPats + " " + Lan.g(this, "active patients")
                       + ", " + Lan.g(this, "and the billing or treating provider for") + " " + numClaims + " " + Lan.g(this, "claims") + ".  "
                       + Lan.g(this, "Continue anyways?");
            if (MessageBox.Show(msgText, "", MessageBoxButtons.OKCancel) != DialogResult.OK)
            {
                return;
            }
            long   rowsChanged = Providers.Merge(PIn.Long(textProvNumFrom.Text), PIn.Long(textProvNumInto.Text));
            string logText     = Lan.g(this, "Providers merged") + ": " + textAbbrFrom.Text + " " + Lan.g(this, "merged into") + " " + textAbbrInto.Text + ".\r\n"
                                 + Lan.g(this, "Rows changed") + ": " + POut.Long(rowsChanged);

            SecurityLogs.MakeLogEntry(Permissions.ProviderMerge, 0, logText);
            textAbbrFrom.Clear();
            textProvNumFrom.Clear();
            textNpiFrom.Clear();
            textFullNameFrom.Clear();
            CheckUIState();
            MsgBox.Show(this, "Done.");
            DataValid.SetInvalid(InvalidType.Providers);
            _listActiveProvs = Providers.GetWhere(x => x.ProvStatus != ProviderStatus.Deleted, true);
        }
Esempio n. 5
0
        private void setupToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (!Security.IsAuthorized(Permissions.Setup))
            {
                return;
            }

            FormMapSetup FormMS = new FormMapSetup();

            FormMS.ShowDialog();
            FillMapAreaPanel();
            SecurityLogs.MakeLogEntry(Permissions.Setup, 0, "MapHQ layout changed");
        }
Esempio n. 6
0
        private void menuItemSheets_Click(object sender, EventArgs e)
        {
            if (!Security.IsAuthorized(Permissions.Setup))
            {
                return;
            }
            FormSheetDefs FormSD = new FormSheetDefs();

            FormSD.ShowDialog();
            SecurityLogs.MakeLogEntry(Permissions.Setup, 0, "Sheets");
            FillListExamTypes();
            FillGrid();
        }
        private void gridWebSchedRecallTypes_DoubleClick(object sender, EventArgs e)
        {
            if (!Security.IsAuthorized(Permissions.Setup))
            {
                return;
            }
            FormRecallTypes FormRT = new FormRecallTypes();

            FormRT.ShowDialog();
            FillGridWebSchedRecallTypes();
            FillGridWebSchedTimeSlotsThreaded();
            SecurityLogs.MakeLogEntry(Permissions.Setup, 0, "Recall Types accessed via EServices Setup window.");
        }
Esempio n. 8
0
 private void butOK_Click(object sender, EventArgs e)
 {
     if (!VerifyRequiredFields())
     {
         return;
     }
     if (!TryToSaveData())
     {
         return;
     }
     SecurityLogs.MakeLogEntry(Permissions.SheetEdit, SheetCur.PatNum, SheetCur.Description + " from " + SheetCur.DateTimeSheet.ToShortDateString());
     DialogResult = DialogResult.OK;
 }
Esempio n. 9
0
        private void butOK_Click(object sender, System.EventArgs e)
        {
            if (textDescription.Text == "")
            {
                MsgBox.Show(this, "Description cannot be blank.");
                return;
            }
            //We do not allow global fee schedules to be associated to FeeSchedGroups.
            //Prevent a fee sched that is associated to a group to be turned into a global fee schedule.
            if (PrefC.GetBool(PrefName.ShowFeeSchedGroups) && checkIsGlobal.Checked)
            {
                if (FeeSchedGroups.GetAllForFeeSched(FeeSchedCur.FeeSchedNum).Count() > 0)
                {
                    MsgBox.Show(this, "Not allowed to make Fee Schedule global, a Fee Schedule Group exists for this Fee Schedule.");
                    return;
                }
            }
            FeeSchedCur.Description  = textDescription.Text;
            FeeSchedCur.FeeSchedType = (FeeScheduleType)listType.SelectedIndex;
            FeeSchedCur.IsHidden     = checkIsHidden.Checked;
            bool isGlobalOld = FeeSchedCur.IsGlobal;

            FeeSchedCur.IsGlobal = checkIsGlobal.Checked;
            if (FeeSchedCur.IsNew)
            {
                FeeSchedCur.IsNew = false;
                ListFeeScheds.Add(FeeSchedCur);
            }
            if (isGlobalOld != FeeSchedCur.IsGlobal)
            {
                string log = "Edited Fee Schedule \"" + textDescription.Text + "\": Changed \"Use Headquarter's Fees\" from ";
                if (isGlobalOld)
                {
                    log += "Checked ";
                }
                else
                {
                    log += "Unchecked ";
                }
                if (FeeSchedCur.IsGlobal)
                {
                    log += "to Checked";
                }
                else
                {
                    log += "to Unchecked";
                }
                SecurityLogs.MakeLogEntry(Permissions.FeeSchedEdit, 0, log);
            }
            DialogResult = DialogResult.OK;
        }
Esempio n. 10
0
        private void butEditSchedule_Click(object sender, EventArgs e)
        {
            //allow user to edit this day's schedule
            FormScheduleDayEdit FormS = new FormScheduleDayEdit(DateEdit);

            FormS.ShowDialog();
            if (FormS.DialogResult != DialogResult.OK)
            {
                return;
            }
            //schedules may have changed to make a log entry
            SecurityLogs.MakeLogEntry(Permissions.Schedules, 0, "In 'FormPhoneGraphDateEdit', user edited daily schedule for " + DateEdit.ToShortDateString());
            FillGrid();
        }
Esempio n. 11
0
        /// <summary>Helper method to send given appt to the unscheduled list.
        /// Creates SecurityLogs and considers HL7.</summary>
        public static void SetApptUnschedHelper(Appointment appt, Patient pat = null, bool doFireApptEvent = true)
        {
            DateTime datePrevious = appt.DateTStamp;

            Appointments.SetAptStatus(appt, ApptStatus.UnschedList); //Appointments S-Class handles Signalods
            #region SecurityLogs
            if (appt.AptStatus != ApptStatus.Complete)               //seperate log entry for editing completed appts.
            {
                SecurityLogs.MakeLogEntry(Permissions.AppointmentMove, appt.PatNum,
                                          appt.ProcDescript + ", " + appt.AptDateTime.ToString() + ", Sent to Unscheduled List",
                                          appt.AptNum, datePrevious);
            }
            else
            {
                SecurityLogs.MakeLogEntry(Permissions.AppointmentCompleteEdit, appt.PatNum,
                                          appt.ProcDescript + ", " + appt.AptDateTime.ToString() + ", Sent to Unscheduled List",
                                          appt.AptNum, datePrevious);
            }
            #endregion
            #region HL7
            //If there is an existing HL7 def enabled, send a SIU message if there is an outbound SIU message defined
            if (HL7Defs.IsExistingHL7Enabled())
            {
                if (pat == null)
                {
                    pat = Patients.GetPat(appt.PatNum);
                }
                //S15 - Appt Cancellation event
                MessageHL7 messageHL7 = MessageConstructor.GenerateSIU(pat, Patients.GetPat(pat.Guarantor), EventTypeHL7.S15, appt);
                //Will be null if there is no outbound SIU message defined, so do nothing
                if (messageHL7 != null)
                {
                    HL7Msg hl7Msg = new HL7Msg();
                    hl7Msg.AptNum    = appt.AptNum;
                    hl7Msg.HL7Status = HL7MessageStatus.OutPending;                  //it will be marked outSent by the HL7 service.
                    hl7Msg.MsgText   = messageHL7.ToString();
                    hl7Msg.PatNum    = pat.PatNum;
                    HL7Msgs.Insert(hl7Msg);
#if DEBUG
                    MessageBox.Show("Appointments", messageHL7.ToString());
#endif
                }
            }
            #endregion
            if (doFireApptEvent)
            {
                AppointmentEvent.Fire(ODEventType.AppointmentEdited, appt);
            }
            Recalls.SynchScheduledApptFull(appt.PatNum);
        }
Esempio n. 12
0
        private void menuItemLock_Click(object sender, EventArgs e)
        {
            if (!Security.IsAuthorized(Permissions.SecurityAdmin))
            {
                return;
            }
            FormAccountingLock FormA = new FormAccountingLock();

            FormA.ShowDialog();
            if (FormA.DialogResult == DialogResult.OK)
            {
                SecurityLogs.MakeLogEntry(Permissions.SecurityAdmin, 0, "Accounting Lock Changed");
            }
        }
        private void butOK_Click(object sender, System.EventArgs e)
        {
            if (textDate.errorProvider1.GetError(textDate) != "")
            {
                MsgBox.Show(this, "Please fix data entry errors first.");
                return;
            }
            if (SplitList.Count == 0)
            {
                MsgBox.Show(this, "Please enter transfers first.");
                return;
            }
            double total = 0;

            for (int i = 0; i < SplitList.Count; i++)
            {
                total += SplitList[i].SplitAmt;
            }
            if (total != 0)
            {
                MsgBox.Show(this, "Total must equal zero.");
                return;
            }
            PaymentCur.PayNote = textNote.Text;
            PaymentCur.PayDate = PIn.PDate(textDate.Text);
            PaymentCur.IsSplit = true;
            try {
                Payments.Update(PaymentCur);
            }
            catch (ApplicationException ex) {           //this catches bad dates.
                MessageBox.Show(ex.Message);
                return;
            }
            //Set all DatePays the same.
            for (int i = 0; i < SplitList.Count; i++)
            {
                SplitList[i].DatePay  = PaymentCur.PayDate;
                SplitList[i].ProcDate = PaymentCur.PayDate;
            }
            PaySplits.UpdateList(SplitListOld, SplitList);
            if (IsNew)
            {
                SecurityLogs.MakeLogEntry(Permissions.PaymentCreate, 0, Lan.g(this, "Prov income transfer."));
            }
            else
            {
                SecurityLogs.MakeLogEntry(Permissions.PaymentEdit, 0, Lan.g(this, "Prov income transfer."));
            }
            DialogResult = DialogResult.OK;
        }
Esempio n. 14
0
 private void butDetach_Click(object sender, EventArgs e)
 {
     if (!Security.IsAuthorized(Permissions.RefAttachDelete))
     {
         return;
     }
     if (!MsgBox.Show(this, true, "Detach Referral?"))
     {
         return;
     }
     SecurityLogs.MakeLogEntry(Permissions.RefAttachDelete, RefAttachCur.PatNum, "Referral attachment deleted for " + Referrals.GetNameFL(RefAttachCur.ReferralNum));
     RefAttaches.Delete(RefAttachCur);
     DialogResult = DialogResult.OK;
 }
Esempio n. 15
0
 public void AutoSaveCommItem(Commlog commlog)
 {
     if (IsNew)
     {
         //Insert
         _view.SetCommlogNum(Commlogs.Insert(commlog));
         SecurityLogs.MakeLogEntry(Permissions.CommlogEdit, commlog.PatNum, "Autosave Insert");
         IsNew = false;
     }
     else
     {
         //Update
         Commlogs.Update(commlog);
     }
 }
Esempio n. 16
0
 private void butDelete_Click(object sender, System.EventArgs e)
 {
     if (IsNew)
     {
         DialogResult = DialogResult.Cancel;
         return;
     }
     if (MessageBox.Show(Lan.g(this, "Delete Prescription?"), "", MessageBoxButtons.OKCancel) != DialogResult.OK)
     {
         return;
     }
     SecurityLogs.MakeLogEntry(Permissions.RxEdit, RxPatCur.PatNum, "FROM(" + _rxPatOld.RxDate.ToShortDateString() + "," + _rxPatOld.Drug + "," + _rxPatOld.ProvNum + "," + _rxPatOld.Disp + "," + _rxPatOld.Refills + ")" + "\r\nTO('deleted')", RxPatCur.RxNum, _rxPatOld.DateTStamp);
     RxPats.Delete(RxPatCur.RxNum);
     DialogResult = DialogResult.OK;
 }
Esempio n. 17
0
        private void butTools_Click(object sender, System.EventArgs e)
        {
            FormFeeSchedTools FormF = new FormFeeSchedTools(DefB.Short[(int)DefCat.FeeSchedNames][listFeeSched.SelectedIndex].DefNum);

            FormF.ShowDialog();
            if (FormF.DialogResult == DialogResult.Cancel)
            {
                return;
            }
            Fees.Refresh();
            ProcedureCodes.Refresh();
            changed = true;
            FillGrid();
            SecurityLogs.MakeLogEntry(Permissions.Setup, 0, "Fee Schedule Tools");
        }
Esempio n. 18
0
 private void butDelete_Click(object sender, EventArgs e)
 {
     if (FamilyHealthCur.IsNew)
     {
         DialogResult = DialogResult.Cancel;
         return;
     }
     if (!MsgBox.Show(this, MsgBoxButtons.OKCancel, "Delete?"))
     {
         return;
     }
     FamilyHealths.Delete(FamilyHealthCur.FamilyHealthNum);
     SecurityLogs.MakeLogEntry(Permissions.PatFamilyHealthEdit, FamilyHealthCur.PatNum, FamilyHealthCur.PersonName + " " + FamilyHealthCur.Relationship + " deleted");
     DialogResult = DialogResult.OK;
 }
Esempio n. 19
0
        private void butDelete_Click(object sender, EventArgs e)
        {
            if (!MsgBox.Show(this, MsgBoxButtons.OKCancel, "Delete?"))
            {
                return;
            }
            string logEntry = Lan.g(this, "Ehr Measure Event was deleted.") + "  "
                              + Lan.g(this, "Date") + ": " + PIn.DateT(textDateTime.Text) + "  "
                              + Lan.g(this, "Type") + ": " + _measureEventCur.EventType.ToString() + "  "
                              + Lan.g(this, "Patient") + ": " + textPatient.Text;

            SecurityLogs.MakeLogEntry(Permissions.EhrMeasureEventEdit, _measureEventCur.PatNum, logEntry);
            EhrMeasureEvents.Delete(_measureEventCur.EhrMeasureEventNum);
            DialogResult = DialogResult.Cancel;
        }
Esempio n. 20
0
 private void menuItemSetup_Click(object sender, EventArgs e)
 {
     if (!Security.IsAuthorized(Permissions.Setup))
     {
         return;
     }
     try {
         FormWebFormSetup formW = new FormWebFormSetup();
         formW.ShowDialog();
         SecurityLogs.MakeLogEntry(Permissions.Setup, 0, "Web Forms Setup");
     }
     catch (Exception ex) {
         MessageBox.Show(ex.Message);
     }
 }
Esempio n. 21
0
 private void butReformat_Click(object sender, System.EventArgs e)
 {
     if (CultureInfo.CurrentCulture.Name != "en-US")
     {
         if (MessageBox.Show(Lan.g(this, "Are you sure?  The phone number formatting is only meant for the United States?"), "", MessageBoxButtons.OKCancel) != DialogResult.OK)
         {
             return;
         }
     }
     Patients.ReformatAllPhoneNumbers();
     //refresh carriers:
     DataValid.SetInvalid(InvalidType.Carriers);
     MessageBox.Show(Lan.g(this, "Telephone numbers reformatted."));
     SecurityLogs.MakeLogEntry(Permissions.Setup, 0, "Telephone");
 }
Esempio n. 22
0
        private void butOK_Click(object sender, EventArgs e)
        {
            Prefs.RefreshCache();            //Just to be sure we don't miss someone who has just started running repeating charges.
            if (PrefC.GetString(PrefName.RepeatingChargesBeginDateTime) != "")
            {
                MsgBox.Show(this, "Repeating charges already running on another workstation, you must wait for them to finish before continuing.");
                return;
            }
            RepeatChargeResult result = RepeatCharges.RunRepeatingCharges(MiscData.GetNowDateTime());

            SecurityLogs.MakeLogEntry(Permissions.RepeatChargeTool, 0, "Repeat Charge Tool ran.");
            MessageBox.Show(result.ProceduresAddedCount + " " + Lan.g(this, "procedures added.") + "\r\n" + result.ClaimsAddedCount + " "
                            + Lan.g(this, "claims added."));
            DialogResult = DialogResult.OK;
        }
Esempio n. 23
0
 private void butDelete_Click(object sender, EventArgs e)
 {
     if (AllergyCur.IsNew)
     {
         DialogResult = DialogResult.Cancel;
         return;
     }
     if (!MsgBox.Show(this, MsgBoxButtons.OKCancel, "Delete?"))
     {
         return;
     }
     Allergies.Delete(AllergyCur.AllergyNum);
     SecurityLogs.MakeLogEntry(Permissions.PatAllergyListEdit, AllergyCur.PatNum, AllergyDefs.GetDescription(AllergyCur.AllergyDefNum) + " deleted");
     DialogResult = DialogResult.OK;
 }
Esempio n. 24
0
 private void butDelete_Click(object sender, EventArgs e)
 {
     if (SheetCur.IsNew)
     {
         DialogResult = DialogResult.Cancel;
         return;
     }
     if (!MsgBox.Show(this, true, "Delete?"))
     {
         return;
     }
     Sheets.DeleteObject(SheetCur.SheetNum);
     SecurityLogs.MakeLogEntry(Permissions.SheetEdit, SheetCur.PatNum, SheetCur.Description + " deleted from " + SheetCur.DateTimeSheet.ToShortDateString());
     DialogResult = DialogResult.OK;
 }
Esempio n. 25
0
 private void butArchive_Click(object sender, EventArgs e)
 {
     #region Validation
     if (checkArchiveDoBackupFirst.Checked)              //We only need to validate the backup settings if the user wants to make a backup first
     {
         if (!MsgBox.Show(MsgBoxButtons.YesNo, "To make a backup of the database, ensure no other machines are currently using OpenDental. Proceed?"))
         {
             return;
         }
         //Validation
         if (string.IsNullOrWhiteSpace(textArchiveServerName.Text))
         {
             MsgBox.Show(this, "Please specify a Server Name.");
             return;
         }
         if (string.IsNullOrWhiteSpace(textArchiveUser.Text))
         {
             MsgBox.Show(this, "Please enter a User.");
             return;
         }
         if (string.IsNullOrWhiteSpace(PrefC.GetString(PrefName.ArchiveKey)))                 //If archive key isn't set, generate a new one.
         {
             string archiveKey = MiscUtils.CreateRandomAlphaNumericString(10);
             Prefs.UpdateString(PrefName.ArchiveKey, archiveKey);
         }
     }
     #endregion
     //Create an ODProgress
     ODProgress.ShowAction(() => {
         //Make a backup if needed
         if (checkArchiveDoBackupFirst.Checked)
         {
             try {
                 MiscData.MakeABackup(textArchiveServerName.Text, textArchiveUser.Text, textArchivePass.Text, doVerify: true);
             }
             catch (Exception ex) {
                 FriendlyException.Show("An error occurred backing up the old database. Old data was not removed from the database. " +
                                        "Ensure no other machines are currently using OpenDental and try again.", ex);
                 return;
             }
         }
         //Delete the unnecessary data
         SecurityLogs.DeleteBeforeDateInclusive(dateTimeArchive.Value);
         SecurityLogs.MakeLogEntry(Permissions.Backup, 0, $"SecurityLog and SecurityLogHashes on/before {dateTimeArchive.Value} deleted.");
     },
                           eventType: typeof(MiscDataEvent),
                           odEventType: ODEventType.MiscData);
 }
Esempio n. 26
0
 private void butDelete_Click(object sender, System.EventArgs e)
 {
     //button not enabled if no permission
     if (IsNew)
     {
         DialogResult = DialogResult.Cancel;
         return;
     }
     if (!MsgBox.Show(this, MsgBoxButtons.OKCancel, "Delete?"))
     {
         return;
     }
     SecurityLogs.MakeLogEntry(Permissions.CommlogEdit, CommlogCur.PatNum, "Delete");
     Commlogs.Delete(CommlogCur);
     DialogResult = DialogResult.OK;
 }
Esempio n. 27
0
 private void butDelete_Click(object sender, System.EventArgs e)
 {
     if (IsNew)
     {
         DialogResult = DialogResult.Cancel;
     }
     else
     {
         SecurityLogs.MakeLogEntry(Permissions.AdjustmentEdit, AdjustmentCur.PatNum,
                                   "Delete for patient: "
                                   + Patients.GetLim(AdjustmentCur.PatNum).GetNameLF() + ", "
                                   + AdjustmentCur.AdjAmt.ToString("c"));
         Adjustments.Delete(AdjustmentCur);
         DialogResult = DialogResult.OK;
     }
 }
Esempio n. 28
0
        private void butPDF_Click(object sender, EventArgs e)
        {
            if (!TryToSaveData())
            {
                return;
            }
            SheetCur = Sheets.GetSheet(SheetCur.SheetNum);
            string filePathAndName = Path.ChangeExtension(Path.GetTempFileName(), ".pdf");

            //Graphics g=this.CreateGraphics();
            SheetPrinting.CreatePdf(SheetCur, filePathAndName);
            //g.Dispose();
            Process.Start(filePathAndName);
            SecurityLogs.MakeLogEntry(Permissions.SheetEdit, SheetCur.PatNum, SheetCur.Description + " from " + SheetCur.DateTimeSheet.ToShortDateString() + " pdf was created");
            DialogResult = DialogResult.OK;
        }
Esempio n. 29
0
        private void butUserQuery_Click(object sender, EventArgs e)
        {
            if (!Security.IsAuthorized(Permissions.UserQuery))
            {
                return;
            }
            if (DataConnection.DBtype == DatabaseType.Oracle)
            {
                MsgBox.Show(this, "Not allowed while using Oracle.");
                return;
            }
            FormQuery FormQuery2 = new FormQuery(null);

            FormQuery2.ShowDialog();
            SecurityLogs.MakeLogEntry(Permissions.UserQuery, 0, "");
        }
Esempio n. 30
0
 private void buttonDelete_Click(object sender, EventArgs e)
 {
     if (IsNew)
     {
         DialogResult = DialogResult.Cancel;
         return;
     }
     try{
         DiseaseDefs.Delete(DiseaseDefCur);
         SecurityLogs.MakeLogEntry(Permissions.ProblemEdit, 0, DiseaseDefCur.DiseaseName + " deleted.");
         DialogResult = DialogResult.OK;
     }
     catch (ApplicationException ex) {
         MessageBox.Show(ex.Message);
     }
 }