Exemple #1
0
        private void butExport_Click(object sender, System.EventArgs e)
        {
            if (listClaimForms.SelectedIndex == -1)
            {
                MessageBox.Show(Lan.g(this, "Please select an item first."));
                return;
            }
            ClaimForm      ClaimFormCur = ClaimForms.ListLong[listClaimForms.SelectedIndex];
            SaveFileDialog saveDlg      = new SaveFileDialog();
            string         filename     = "ClaimForm" + ClaimFormCur.Description + ".xml";

            saveDlg.InitialDirectory = PrefB.GetString("ExportPath");
            saveDlg.FileName         = filename;
            if (saveDlg.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            //MessageBox.Show(saveDlg.FileName);
            XmlSerializer serializer = new XmlSerializer(typeof(ClaimForm));
            TextWriter    writer     = new StreamWriter(saveDlg.FileName);

            serializer.Serialize(writer, ClaimFormCur);
            writer.Close();
            MessageBox.Show("Exported");
        }
Exemple #2
0
 private void FormFinanceCharges_Load(object sender, System.EventArgs e)
 {
     if (PIn.PDate(PrefB.GetString("DateLastAging")) < DateTime.Today)
     {
         if (MsgBox.Show(this, true, "You must update aging first."))              //OK
         {
             FormAging FormA = new FormAging();
             FormA.ShowDialog();
         }
         else
         {
             DialogResult = DialogResult.Cancel;
             return;
         }
     }
     if (PIn.PDate(PrefB.GetString("FinanceChargeLastRun")).AddDays(25) > DateTime.Today)
     {
         MessageBox.Show(Lan.g(this, "You cannot run finance charges again this month."));
         DialogResult = DialogResult.Cancel;
         return;
     }
     textAPR.MaxVal = 100;
     textAPR.MinVal = 0;
     FillList();
     textAPR.Text  = PrefB.GetString("FinanceChargeAPR");
     textDate.Text = DateTime.Today.ToShortDateString();
 }
 private void FormRecallSetup_Load(object sender, System.EventArgs e)
 {
     textPatternAdult.Text      = PrefB.GetString("RecallPattern");
     textProcsAdult.Text        = ((Pref)PrefB.HList["RecallProcedures"]).ValueString;
     textPatternChild.Text      = PrefB.GetString("RecallPatternChild");
     textProcsChild.Text        = ((Pref)PrefB.HList["RecallProceduresChild"]).ValueString;
     textPatternPerio.Text      = PrefB.GetString("RecallPatternPerio");
     textProcsPerio.Text        = ((Pref)PrefB.HList["RecallProceduresPerio"]).ValueString;
     textPerioTriggerProcs.Text = ((Pref)PrefB.HList["RecallPerioTriggerProcs"]).ValueString;
     textBW.Text                     = ((Pref)PrefB.HList["RecallBW"]).ValueString;
     textFMXPanoProc.Text            = ((Pref)PrefB.HList["RecallFMXPanoProc"]).ValueString;
     checkDisableAutoFilms.Checked   = PrefB.GetBool("RecallDisableAutoFilms");
     checkDisablePerioAlt.Checked    = PrefB.GetBool("RecallDisablePerioAlt");
     textFMXPanoYrInterval.Text      = PrefB.GetInt("RecallFMXPanoYrInterval").ToString();
     checkGroupFamilies.Checked      = PrefB.GetBool("RecallGroupByFamily");
     textPostcardMessage.Text        = PrefB.GetString("RecallPostcardMessage");
     textPostcardFamMsg.Text         = PrefB.GetString("RecallPostcardFamMsg");
     textConfirmPostcardMessage.Text = PrefB.GetString("ConfirmPostcardMessage");
     textPostcardsPerSheet.Text      = PrefB.GetInt("RecallPostcardsPerSheet").ToString();
     checkReturnAdd.Checked          = PrefB.GetBool("RecallCardsShowReturnAdd");
     checkGroupFamilies.Checked      = PrefB.GetBool("RecallGroupByFamily");
     textDaysPast.Text               = PrefB.GetInt("RecallDaysPast").ToString();
     textDaysFuture.Text             = PrefB.GetInt("RecallDaysFuture").ToString();
     textRight.Text                  = PrefB.GetDouble("RecallAdjustRight").ToString();
     textDown.Text                   = PrefB.GetDouble("RecallAdjustDown").ToString();
     listProcs.Items.Clear();
     for (int i = 0; i < ProcedureCodes.RecallAL.Count; i++)
     {
         listProcs.Items.Add(((ProcedureCode)ProcedureCodes.RecallAL[i]).Descript);
     }
 }
        private void butImport_Click(object sender, EventArgs e)
        {
            OpenFileDialog openDlg = new OpenFileDialog();

            openDlg.InitialDirectory = PrefB.GetString("ExportPath");
            if (openDlg.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            int rowsInserted = 0;

            try {
                rowsInserted = ImportProcCodes(openDlg.FileName, true);
            }
            catch (ApplicationException ex) {
                MessageBox.Show(ex.Message);
                FillGrid();
                return;
            }
            MessageBox.Show("Procedure codes inserted: " + rowsInserted);
            DataValid.SetInvalid(InvalidTypes.Defs);
            changed = true;
            FillCats();
            FillGrid();
            SecurityLogs.MakeLogEntry(Permissions.Setup, 0, "Imported Procedure Codes");
        }
Exemple #5
0
 ///<summary></summary>
 public void FormDocInfo_Load(object sender, System.EventArgs e)
 {
     //if (Docs.Cur.FileName.Equals(null))
     listCategory.Items.Clear();
     for (int i = 0; i < DefB.Short[(int)DefCat.ImageCats].Length; i++)
     {
         listCategory.Items.Add(DefB.Short[(int)DefCat.ImageCats][i].ItemName);
         if (DefB.Short[(int)DefCat.ImageCats][i].DefNum == DocCur.DocCategory)
         {
             listCategory.SelectedIndex = i;
         }
     }
     if (DocCur.DocCategory == 0)
     {
         listCategory.SelectedIndex = 0;
     }
     listType.Items.Clear();
     listType.Items.AddRange(Enum.GetNames(typeof(ImageType)));
     listType.SelectedIndex = (int)DocCur.ImgType;
     textDate.Text          = DocCur.DateCreated.ToString("d");
     textDescript.Text      = DocCur.Description;
     textFileName.Text      = PrefB.GetString("DocPath") + PatCur.ImageFolder.Substring(0, 1) + @"\"
                              + PatCur.ImageFolder + @"\" + DocCur.FileName;
     if (File.Exists(textFileName.Text))
     {
         FileInfo fileInfo = new FileInfo(textFileName.Text);
         textSize.Text = fileInfo.Length.ToString("n0");
     }
     textToothNumbers.Text = Tooth.FormatRangeForDisplay(DocCur.ToothNumbers);
     //textNote.Text=DocCur.Note;
 }
Exemple #6
0
 ///<summary>Returns the most preferred fully qualified network path or null if no valid paths were found.</summary>
 public static string GetPreferredImagePath()
 {
     if (!PrefB.UsingAtoZfolder)
     {
         return(null);
     }
     return(GetPreferredImagePath(PrefB.GetString("DocPath")));
 }
Exemple #7
0
 private void FormEmailSetup_Load(object sender, System.EventArgs e)
 {
     textSMTPserver.Text = ((Pref)PrefB.HList["EmailSMTPserver"]).ValueString;
     textUsername.Text   = PrefB.GetString("EmailUsername");
     textPassword.Text   = PrefB.GetString("EmailPassword");
     textPort.Text       = PrefB.GetString("EmailPort");
     textSender.Text     = ((Pref)PrefB.HList["EmailSenderAddress"]).ValueString;
 }
Exemple #8
0
        private void butEditPaths_Click(object sender, System.EventArgs e)
        {
            FormPath FormP = new FormPath();

            FormP.ShowDialog();
            mergePath     = PrefB.GetString("LetterMergePath");
            textPath.Text = mergePath;
        }
Exemple #9
0
        ///<summary>Called in two places.  Once from RefreshLocalData, and also from FormBackups after a restore.</summary>
        public static bool CheckProgramVersion()
        {
            Version storedVersion  = new Version(PrefB.GetString("ProgramVersion"));
            Version currentVersion = new Version(Application.ProductVersion);
            string  database       = "";
            string  command        = "";

            if (FormChooseDatabase.DBtype == DatabaseType.MySql)
            {
                command = "SELECT database()";
                DataTable table = General.GetTable(command);
                database = PIn.PString(table.Rows[0][0].ToString());
            }
            if (storedVersion < currentVersion)
            {
                UpdateString("ProgramVersion", currentVersion.ToString());
                Prefs.Refresh();
            }
            if (storedVersion > currentVersion)
            {
                if (File.Exists(PrefB.GetString("DocPath") + "Setup.exe"))
                {
                    if (MessageBox.Show("You are attempting to run version " + currentVersion.ToString(3) + ",\r\n"
                                        + "But the database " + database + "\r\n"
                                        + "is already using version " + storedVersion.ToString(3) + ".\r\n"
                                        + "A newer version must have already been installed on at least one computer.\r\n"
                                        + "The setup program stored in your A to Z folder will now be launched.\r\n"
                                        + "Or, if you hit Cancel, then you will have the option to download again."
                                        , "", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
                    {
                        if (MessageBox.Show("Download again?", "", MessageBoxButtons.OKCancel)
                            == DialogResult.OK)
                        {
                            FormUpdate FormU = new FormUpdate();
                            FormU.ShowDialog();
                        }
                        Application.Exit();
                        return(false);
                    }
                    try {
                        Process.Start(PrefB.GetString("DocPath") + "Setup.exe");
                    }
                    catch {
                        MessageBox.Show("Could not launch Setup.exe");
                    }
                }
                else if (MessageBox.Show("A newer version has been installed on at least one computer, but Setup.exe could not be found in " + PrefB.GetString("DocPath") + ".  Download again?", "", MessageBoxButtons.OKCancel) == DialogResult.OK)
                {
                    FormUpdate FormU = new FormUpdate();
                    FormU.ShowDialog();
                }
                Application.Exit();                //always exits, whether launch of setup worked or no
                return(false);
            }
            return(true);
        }
Exemple #10
0
        ///<summary></summary>
        private void butSend_Click(object sender, System.EventArgs e)
        {
            //this will not be available if already sent.
            if (textFromAddress.Text == "" ||
                textToAddress.Text == "")
            {
                MessageBox.Show("Addresses not allowed to be blank.");
                return;
            }
            if (((Pref)PrefB.HList["EmailSMTPserver"]).ValueString == "")
            {
                MsgBox.Show(this, "You need to enter an SMTP server name in e-mail setup before you can send e-mail.");
                return;
            }
            Cursor = Cursors.WaitCursor;
            SmtpClient client = new SmtpClient(PrefB.GetString("EmailSMTPserver"), PrefB.GetInt("EmailPort"));

            //The default credentials are not used by default, according to:
            //http://msdn2.microsoft.com/en-us/library/system.net.mail.smtpclient.usedefaultcredentials.aspx
            client.Credentials    = new NetworkCredential(PrefB.GetString("EmailUsername"), PrefB.GetString("EmailPassword"));
            client.DeliveryMethod = SmtpDeliveryMethod.Network;
            MailMessage message = new MailMessage();
            Attachment  attach;

            try{
                message.From = new MailAddress(textFromAddress.Text);
                message.To.Add(textToAddress.Text);                //this might fail
                message.Subject    = textSubject.Text;
                message.Body       = textBodyText.Text;
                message.IsBodyHtml = false;
                string attachPath = GetAttachPath();
                for (int i = 0; i < MessageCur.Attachments.Count; i++)
                {
                    attach = new Attachment(ODFileUtils.CombinePaths(attachPath, MessageCur.Attachments[i].ActualFileName));
                    //@"C:\OpenDentalData\EmailAttachments\1");
                    attach.Name = MessageCur.Attachments[i].DisplayedFileName;
                    //"canadian.gif";
                    message.Attachments.Add(attach);
                }
                client.Send(message);
            }
            catch (System.Exception ex) {
                Cursor = Cursors.Default;
                MessageBox.Show(ex.Message);
                return;
            }
            MsgBox.Show(this, "Sent");
            Cursor = Cursors.Default;
            //MessageCur.MsgDateTime=DateTime.Now;
            MessageCur.SentOrReceived = CommSentOrReceived.Sent;
            SaveMsg();
            DialogResult = DialogResult.OK;
        }
Exemple #11
0
 private void FormMisc_Load(object sender, System.EventArgs e)
 {
     textTreatNote.Text = PrefB.GetString("TreatmentPlanNote");
     checkTreatPlanShowGraphics.Checked      = PrefB.GetBool("TreatPlanShowGraphics");
     checkTreatPlanShowCompleted.Checked     = PrefB.GetBool("TreatPlanShowCompleted");
     checkTreatPlanShowIns.Checked           = PrefB.GetBool("TreatPlanShowIns");
     checkStatementShowReturnAddress.Checked = PrefB.GetBool("StatementShowReturnAddress");
     checkShowCC.Checked = PrefB.GetBool("StatementShowCreditCard");
     if (PrefB.GetBool("StatementAccountsUseChartNumber"))
     {
         radioUseChartNumber.Checked = true;
     }
     else
     {
         radioUsePatNum.Checked = true;
     }
     if (PrefB.GetInt("StatementsCalcDueDate") != -1)
     {
         textStatementsCalcDueDate.Text = PrefB.GetInt("StatementsCalcDueDate").ToString();
     }
     checkBalancesDontSubtractIns.Checked = PrefB.GetBool("BalancesDontSubtractIns");
     if (PrefB.GetInt("ProcessSigsIntervalInSecs") == 0)
     {
         textSigInterval.Text = "";
     }
     else
     {
         textSigInterval.Text = PrefB.GetInt("ProcessSigsIntervalInSecs").ToString();
     }
     checkRandomPrimaryKeys.Checked = PrefB.GetBool("RandomPrimaryKeys");
     if (checkRandomPrimaryKeys.Checked)
     {
         //not allowed to uncheck it
         checkRandomPrimaryKeys.Enabled = false;
     }
     textMainWindowTitle.Text = PrefB.GetString("MainWindowTitle");
     if (PrefB.GetInt("ShowIDinTitleBar") == 0)
     {
         radioShowIDnone.Checked = true;
     }
     else if (PrefB.GetInt("ShowIDinTitleBar") == 1)
     {
         radioShowIDpatNum.Checked = true;
     }
     else if (PrefB.GetInt("ShowIDinTitleBar") == 2)
     {
         radioShowIDchartNum.Checked = true;
     }
     checkEclaimsSeparateTreatProv.Checked = PrefB.GetBool("EclaimsSeparateTreatProv");
     checkMedicalEclaimsEnabled.Checked    = PrefB.GetBool("MedicalEclaimsEnabled");
     checkITooth.Checked = PrefB.GetBool("UseInternationalToothNumbers");
     checkInsurancePlansShared.Checked = PrefB.GetBool("InsurancePlansShared");
 }
        private void FormRegistrationKey_Load(object sender, EventArgs e)
        {
            string key = PrefB.GetString("RegistrationKey");

            if (key != null && key.Length == 16)
            {
                textKey1.Text = key.Substring(0, 4);
                textKey2.Text = key.Substring(4, 4);
                textKey3.Text = key.Substring(8, 4);
                textKey4.Text = key.Substring(12, 4);
            }
            richTextAgreement.Rtf = Properties.Resources.CDT_Content_End_User_License;            //LoadFile(
        }
Exemple #13
0
        private void ExecuteIndividual()
        {
            ReportOld2 report = new ReportOld2();

            report.AddTitle(Lan.g(this, "PPO WRITEOFFS"));
            report.AddSubTitle(PrefB.GetString("PracticeTitle"));
            report.AddSubTitle(date1.SelectionStart.ToShortDateString() + " - " + date2.SelectionStart.ToShortDateString());
            report.AddSubTitle(Lan.g(this, "Individual Claims"));
            if (textCarrier.Text != "")
            {
                report.AddSubTitle(Lan.g(this, "Carrier like: ") + textCarrier.Text);
            }
            report.Query = "SET @DateFrom=" + POut.PDate(date1.SelectionStart) + ", @DateTo=" + POut.PDate(date2.SelectionStart)
                           + ", @CarrierName='%" + POut.PString(textCarrier.Text) + "%';"
                           + @"SELECT claimproc.DateCP,
				CONCAT(CONCAT(CONCAT(CONCAT(patient.LName,', '),patient.FName),' '),patient.MiddleI),
				carrier.CarrierName,
				provider.Abbr,
				SUM(claimproc.FeeBilled),
				SUM(claimproc.FeeBilled-claimproc.WriteOff),
				SUM(claimproc.WriteOff),
				claimproc.ClaimNum
				FROM claimproc,insplan,patient,carrier,provider
				WHERE provider.ProvNum = claimproc.ProvNum
				AND claimproc.PlanNum = insplan.PlanNum
				AND claimproc.PatNum = patient.PatNum
				AND carrier.CarrierNum = insplan.CarrierNum
				AND (claimproc.Status=1 OR claimproc.Status=4) /*received or supplemental*/
				AND claimproc.DateCP >= @DateFrom
				AND claimproc.DateCP <= @DateTo
				AND insplan.PlanType='p'
				AND carrier.CarrierName LIKE @CarrierName
				GROUP BY claimproc.ClaimNum 
				ORDER BY claimproc.DateCP"                ;
            report.AddColumn("Date", 80, FieldValueType.Date);
            report.AddColumn("Patient", 120, FieldValueType.String);
            report.AddColumn("Carrier", 150, FieldValueType.String);
            report.AddColumn("Provider", 60, FieldValueType.String);
            report.AddColumn("Stand Fee", 80, FieldValueType.Number);
            report.AddColumn("PPO Fee", 80, FieldValueType.Number);
            report.AddColumn("Writeoff", 80, FieldValueType.Number);
            if (!report.SubmitQuery())
            {
                DialogResult = DialogResult.Cancel;
                return;
            }
            FormReportOld2 FormR = new FormReportOld2(report);

            FormR.ShowDialog();
            DialogResult = DialogResult.OK;
        }
Exemple #14
0
        private void FormAging_Load(object sender, System.EventArgs e)
        {
            textDateCalc.Text = DateTime.Today.ToShortDateString();
            DateTime dateLastAging = PIn.PDate(PrefB.GetString("DateLastAging"));

            if (dateLastAging.Year < 1880)
            {
                textDateLast.Text = "";
            }
            else
            {
                textDateLast.Text = dateLastAging.ToShortDateString();
            }
        }
 private void FormLetterMerges_Load(object sender, System.EventArgs e)
 {
     mergePath = PrefB.GetString("LetterMergePath");
     FillCats();
     if (listCategories.Items.Count > 0)
     {
         listCategories.SelectedIndex = 0;
     }
     FillLetters();
     if (listLetters.Items.Count > 0)
     {
         listLetters.SelectedIndex = 0;
     }
 }
 private void FormUpdate_Load(object sender, System.EventArgs e)
 {
     labelVersion.Text = Lan.g(this, "Using Version:") + " " + Application.ProductVersion;
     textRegMain.Text  = PrefB.GetString("RegistrationNumber");
     //textRegClaimform.Text=PrefB.GetString("RegistrationNumberClaim");
     textWebsitePath.Text = PrefB.GetString("UpdateWebsitePath");          //should include trailing /
     butDownload.Enabled  = false;
     //butDownloadClaimform.Enabled=false;
     if (!Security.IsAuthorized(Permissions.Setup))
     {
         butCheck.Enabled = false;
         butOK.Enabled    = false;
     }
 }
Exemple #17
0
 private void butBrowse_Click(object sender, System.EventArgs e)
 {
     if (!Directory.Exists(PrefB.GetString("LetterMergePath")))
     {
         MsgBox.Show(this, "Letter merge path invalid");
         return;
     }
     openFileDlg.InitialDirectory = PrefB.GetString("LetterMergePath");
     if (openFileDlg.ShowDialog() != DialogResult.OK)
     {
         return;
     }
     textTemplateName.Text = Path.GetFileName(openFileDlg.FileName);
 }
Exemple #18
0
        private void butImport_Click(object sender, EventArgs e)
        {
            if (!MsgBox.Show(this, true, "If you want a clean slate, the current fee schedule should be cleared first.  When imported, any fees that are found in the text file will overwrite values of the current fee schedule showing in the main window.  Are you sure you want to continue?"))
            {
                return;
            }
            Cursor = Cursors.WaitCursor;
            OpenFileDialog Dlg = new OpenFileDialog();

            if (Directory.Exists(PrefB.GetString("ExportPath")))
            {
                Dlg.InitialDirectory = PrefB.GetString("ExportPath");
            }
            else if (Directory.Exists("C:\\"))
            {
                Dlg.InitialDirectory = "C:\\";
            }
            if (Dlg.ShowDialog() != DialogResult.OK)
            {
                Cursor = Cursors.Default;
                return;
            }
            if (!File.Exists(Dlg.FileName))
            {
                Cursor = Cursors.Default;
                MsgBox.Show(this, "File not found");
                return;
            }
            string[] fields;
            double   fee;
            int      schedI = DefB.GetOrder(DefCat.FeeSchedNames, SchedNum);

            using (StreamReader sr = new StreamReader(Dlg.FileName)){
                string line = sr.ReadLine();
                while (line != null)
                {
                    fields = line.Split(new string[1] {
                        "\t"
                    }, StringSplitOptions.None);
                    if (fields.Length > 1 && fields[1] != "")                //skips blank fees
                    {
                        fee = PIn.PDouble(fields[1]);
                        Fees.Import(fields[0], fee, schedI);
                    }
                    line = sr.ReadLine();
                }
            }
            Cursor       = Cursors.Default;
            DialogResult = DialogResult.OK;
        }
        private void FormTrojanCollectSetup_Load(object sender, EventArgs e)
        {
            textExportFolder.Text = PrefB.GetString("TrojanExpressCollectPath");
            int billtype = PrefB.GetInt("TrojanExpressCollectBillingType");

            for (int i = 0; i < DefB.Short[(int)DefCat.BillingTypes].Length; i++)
            {
                comboBillType.Items.Add(DefB.Short[(int)DefCat.BillingTypes][i].ItemName);
                if (DefB.Short[(int)DefCat.BillingTypes][i].DefNum == billtype)
                {
                    comboBillType.SelectedIndex = i;
                }
            }
        }
        private void butReport_Click(object sender, System.EventArgs e)
        {
            if (errorProvider1.GetError(textDateFrom) != "" ||
                errorProvider1.GetError(textDateTo) != "")
            {
                MsgBox.Show(this, "Please fix data entry errors first.");
                return;
            }
            DateTime dateFrom = PIn.PDate(textDateFrom.Text);
            DateTime dateTo   = PIn.PDate(textDateTo.Text);

            if (dateTo < dateFrom)
            {
                MsgBox.Show(this, "To date cannot be before From date.");
                return;
            }
            ReportOld2 report = new ReportOld2();

            report.ReportName = Lan.g(this, "Birthdays");
            report.AddTitle(Lan.g(this, "Birthdays"));
            report.AddSubTitle(PrefB.GetString("PracticeTitle"));
            report.AddSubTitle(dateFrom.ToString("MM/dd") + " - " + dateTo.ToString("MM/dd"));

            /*report.Query=@"SELECT LName,FName,Address,Address2,City,State,Zip,Birthdate,Birthdate
             *      FROM patient
             *      WHERE SUBSTRING(Birthdate,6,5) >= '"+dateFrom.ToString("MM-dd")+"' "
             +"AND SUBSTRING(Birthdate,6,5) <= '"+dateTo.ToString("MM-dd")+"' "
             +"AND PatStatus=0	ORDER BY LName,FName";*/
            report.AddColumn("LName", 90, FieldValueType.String);
            report.AddColumn("FName", 90, FieldValueType.String);
            report.AddColumn("Preferred", 90, FieldValueType.String);
            report.AddColumn("Address", 90, FieldValueType.String);
            report.AddColumn("Address2", 90, FieldValueType.String);
            report.AddColumn("City", 75, FieldValueType.String);
            report.AddColumn("State", 60, FieldValueType.String);
            report.AddColumn("Zip", 75, FieldValueType.String);
            report.AddColumn("Birthdate", 75, FieldValueType.Date);
            report.GetLastRO(ReportObjectKind.FieldObject).FormatString = "d";
            report.AddColumn("Age", 45, FieldValueType.Integer);
            report.AddPageNum();
            report.ReportTable = Patients.GetBirthdayList(dateFrom, dateTo);
            //if(!report.SubmitQuery()){
            //	return;
            //}
            FormReportOld2 FormR = new FormReportOld2(report);

            FormR.ShowDialog();
            DialogResult = DialogResult.OK;
        }
Exemple #21
0
 private void OpenFile()
 {
     //we have to create a copy of the file because the name is different
     try{
         File.Copy(
             PrefB.GetString("DocPath") + @"EmailAttachments\" + MessageCur.Attachments[listAttachments.SelectedIndex].ActualFileName,
             Path.GetTempPath() + @"\" + MessageCur.Attachments[listAttachments.SelectedIndex].DisplayedFileName,
             true);
         Process.Start(
             Path.GetTempPath() + @"\" + MessageCur.Attachments[listAttachments.SelectedIndex].DisplayedFileName);
     }
     catch (Exception ex) {
         MessageBox.Show(ex.Message);
     }
 }
Exemple #22
0
        ///<summary>Checks the loaded prefs to see if user has setup deposit linking.  Returns true if so.</summary>
        public static bool DepositsLinked()
        {
            string depAccounts = PrefB.GetString("AccountingDepositAccounts");

            if (depAccounts == "")
            {
                return(false);
            }
            if (PrefB.GetInt("AccountingIncomeAccount") == 0)
            {
                return(false);
            }
            //might add a few more checks later.
            return(true);
        }
        private void butEmail_Click(object sender, EventArgs e)
        {
            EmailMessage message = new EmailMessage();

            message.PatNum      = PatCur.PatNum;
            message.ToAddress   = PatCur.Email;
            message.FromAddress = PrefB.GetString("EmailSenderAddress");
            FormEmailMessageEdit FormE = new FormEmailMessageEdit(message);

            FormE.IsNew = true;
            FormE.ShowDialog();
            if (FormE.DialogResult == DialogResult.OK)
            {
                DialogResult = DialogResult.OK;
            }
        }
        ///<summary>Not available in selection mode.</summary>
        private void butAdd_Click(object sender, System.EventArgs e)
        {
            Deposit deposit = new Deposit();

            deposit.DateDeposit     = DateTime.Today;
            deposit.BankAccountInfo = PrefB.GetString("PracticeBankNumber");
            FormDepositEdit FormD = new FormDepositEdit(deposit);

            FormD.IsNew = true;
            FormD.ShowDialog();
            if (FormD.DialogResult == DialogResult.Cancel)
            {
                return;
            }
            FillGrid();
        }
Exemple #25
0
        private void butNew_Click(object sender, System.EventArgs e)
        {
            if (!Directory.Exists(PrefB.GetString("LetterMergePath")))
            {
                MsgBox.Show(this, "Letter merge path invalid");
                return;
            }
            if (textTemplateName.Text == "")
            {
                MsgBox.Show(this, "Please enter a template file name first.");
                return;
            }
            string templateFile = PrefB.GetString("LetterMergePath") + textTemplateName.Text;

            if (File.Exists(templateFile))
            {
                MsgBox.Show(this, "A file with that name already exists.  Choose a different name, or close this window to edit the template.");
                return;
            }
            Object oMissing = System.Reflection.Missing.Value;
            Object oFalse   = false;

            //Create an instance of Word.
            Word.Application WrdApp;
            try{
                WrdApp = LetterMerges.WordApp;
            }
            catch {
                MsgBox.Show(this, "Error.  Is MS Word installed?");
                return;
            }
            //Create a new document.
            Object oName = templateFile;

            Word._Document wrdDoc;
            wrdDoc = WrdApp.Documents.Add(ref oMissing, ref oMissing, ref oMissing,
                                          ref oMissing);
            wrdDoc.SaveAs(ref oName, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
                          ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
                          ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing);
            wrdDoc.Saved = true;
            wrdDoc.Close(ref oFalse, ref oMissing, ref oMissing);
            WrdApp.WindowState = Word.WdWindowState.wdWindowStateMinimize;
            wrdDoc             = null;
            MsgBox.Show(this, "Done. You can edit the new template after closing this window.");
        }
Exemple #26
0
        ///<summary>This ONLY runs when first opening the program</summary>
        public static bool ConvertDB()
        {
            ClassConvertDatabase ClassConvertDatabase2 = new ClassConvertDatabase();
            string pref = PrefB.GetString("DataBaseVersion");

            //(Pref)PrefB.HList["DataBaseVersion"];
            //Debug.WriteLine(pref.PrefName+","+pref.ValueString);
            if (ClassConvertDatabase2.Convert(pref))
            {
                //((Pref)PrefB.HList["DataBaseVersion"]).ValueString)) {
                return(true);
            }
            else
            {
                Application.Exit();
                return(false);
            }
        }
Exemple #27
0
        ///<summary>Returns true if a change was required, or false if no change needed.</summary>
        public static bool UpdateString(string prefName, string newValue)
        {
            if (!PrefB.HList.ContainsKey(prefName))
            {
                MessageBox.Show(prefName + " is an invalid pref name.");
                return(false);
            }
            if (PrefB.GetString(prefName) == newValue)
            {
                return(false);               //no change needed
            }
            string command = "UPDATE preference SET "
                             + "ValueString = '" + POut.PString(newValue) + "' "
                             + "WHERE PrefName = '" + POut.PString(prefName) + "'";

            General.NonQ(command);
            return(true);
        }
Exemple #28
0
 private void FormLetterMergeEdit_Load(object sender, System.EventArgs e)
 {
     textDescription.Text  = LetterMergeCur.Description;
     mergePath             = PrefB.GetString("LetterMergePath");
     textPath.Text         = mergePath;
     textTemplateName.Text = LetterMergeCur.TemplateName;
     textDataFileName.Text = LetterMergeCur.DataFileName;
     for (int i = 0; i < DefB.Short[(int)DefCat.LetterMergeCats].Length; i++)
     {
         comboCategory.Items.Add(DefB.Short[(int)DefCat.LetterMergeCats][i].ItemName);
         if (LetterMergeCur.Category == DefB.Short[(int)DefCat.LetterMergeCats][i].DefNum)
         {
             comboCategory.SelectedIndex = i;
         }
     }
     FillPatSelect();
     FillListReferral();
 }
 private void butStationary_Click(object sender, EventArgs e)
 {
     if (PrefB.GetString("StationaryDocument") == "")
     {
         MsgBox.Show(this, "You must setup your stationary document and word processor path in Setup | Misc");
         return;
     }
     Cursor = Cursors.AppStarting;
     PtLetter_ToClipboard();
     try {
         this.Cursor = Cursors.AppStarting;
         string patFolder = ODFileUtils.CombinePaths(
             FormPath.GetPreferredImagePath(),
             PatCur.ImageFolder.Substring(0, 1),
             PatCur.ImageFolder);
         //string ProgName = @"C:\Program Files\OpenOffice.org 2.0\program\swriter.exe";
         //string ProgName = PrefB.GetString("WordProcessorPath");
         string TheFile = ODFileUtils.CombinePaths(patFolder, "Letter_" + DateTime.Now.ToFileTime() + ".doc");
         try{
             File.Copy(
                 ODFileUtils.CombinePaths(FormPath.GetPreferredImagePath(), PrefB.GetString("StationaryDocument")),
                 TheFile);
             DialogResult = DialogResult.OK;
         }
         catch {
         }
         try {
             Process.Start(TheFile);
         }
         catch {
         }
         this.Cursor = Cursors.Default;
         Commlog CommlogCur = new Commlog();
         CommlogCur.CommDateTime = DateTime.Now;
         CommlogCur.CommType     = Commlogs.GetTypeAuto(CommItemTypeAuto.MISC);
         CommlogCur.PatNum       = PatCur.PatNum;
         CommlogCur.Note         = Lan.g(this, "Letter sent: See Images for this date.");
         Commlogs.Insert(CommlogCur);
     }
     catch {
         Cursor = Cursors.Default;
         MsgBox.Show(this, "Cannot find stationary document. Or another problem exists.");
     }
 }
Exemple #30
0
        ///<summary></summary>
        public static int[] GetDepositAccounts()
        {
            string depStr = PrefB.GetString("AccountingDepositAccounts");

            string[]  depStrArray = depStr.Split(new char[] { ',' });
            ArrayList depAL       = new ArrayList();

            for (int i = 0; i < depStrArray.Length; i++)
            {
                if (depStrArray[i] == "")
                {
                    continue;
                }
                depAL.Add(PIn.PInt(depStrArray[i]));
            }
            int[] retVal = new int[depAL.Count];
            depAL.CopyTo(retVal);
            return(retVal);
        }