示例#1
0
        ///<summary></summary>
        public static void Insert(Account acct)
        {
            if (PrefB.RandomKeys)
            {
                acct.AccountNum = MiscData.GetKey("account", "AccountNum");
            }
            string command = "INSERT INTO account (";

            if (PrefB.RandomKeys)
            {
                command += "AccountNum,";
            }
            command += "Description,AcctType,BankNumber,Inactive,AccountColor) VALUES(";
            if (PrefB.RandomKeys)
            {
                command += "'" + POut.PInt(acct.AccountNum) + "', ";
            }
            command +=
                "'" + POut.PString(acct.Description) + "', "
                + "'" + POut.PInt((int)acct.AcctType) + "', "
                + "'" + POut.PString(acct.BankNumber) + "', "
                + "'" + POut.PBool(acct.Inactive) + "', "
                + "'" + POut.PInt(acct.AccountColor.ToArgb()) + "')";
            if (PrefB.RandomKeys)
            {
                General.NonQ(command);
            }
            else
            {
                acct.AccountNum = General.NonQ(command, true);
            }
        }
示例#2
0
        private void ShowProgressForm(DateTime changedSince)
        {
            if (checkTroubleshooting.Checked)
            {
                IsTroubleshootMode = true;
            }
            else
            {
                IsTroubleshootMode = false;
            }
            DateTime timeSynchStarted = MiscData.GetNowDateTime();

            FormP        = new FormProgress();
            FormP.MaxVal = 100;          //to keep the form from closing until the real MaxVal is set.
            FormP.NumberMultiplication = 1;
            FormP.DisplayText          = "Preparing records for upload.";
            FormP.NumberFormat         = "F0";
            //start the thread that will perform the upload
            ThreadStart uploadDelegate = delegate { UploadWorker(changedSince, timeSynchStarted); };
            Thread      workerThread   = new Thread(uploadDelegate);

            workerThread.Start();
            //display the progress dialog to the user:
            FormP.ShowDialog();
            if (FormP.DialogResult == DialogResult.Cancel)
            {
                workerThread.Abort();
            }
            changed = true;
            textDateTimeLastRun.Text = PrefC.GetDateT(PrefName.MobileSyncDateTimeLastRun).ToShortDateString() + " " + PrefC.GetDateT(PrefName.MobileSyncDateTimeLastRun).ToShortTimeString();
        }
示例#3
0
        private void butHideUnused_Click(object sender, EventArgs e)
        {
            if (!MsgBox.Show(this, MsgBoxButtons.OKCancel, "Hide fee schedules that are not in use by insurance plans, patients, or providers?\r\n"
                             + "A backup of the database will be made first."))
            {
                return;
            }
            bool   hasChanged     = FeeScheds.Sync(_listFeeScheds, _listFeeSchedsOld);
            Action actionProgress = ODProgress.Show(ODEventType.HideUnusedFeeSchedules, startingMessage: Lans.g(this, "Backing up database..."));

            try {
                MiscData.MakeABackup();
            }
            catch (Exception ex) {
                actionProgress?.Invoke();
                FriendlyException.Show(Lans.g(this, "Unable to make a backup. No fee schedules have been altered."), ex);
                return;
            }
            ODEvent.Fire(ODEventType.HideUnusedFeeSchedules, Lans.g(this, "Hiding unused fee schedules..."));
            long countChanged = FeeScheds.HideUnusedScheds();

            if (hasChanged || countChanged > 0)
            {
                DataValid.SetInvalid(InvalidType.FeeScheds);
            }
            actionProgress?.Invoke();
            MessageBox.Show(countChanged.ToString() + " " + Lans.g(this, "unused fee schedules hidden."));
            _listFeeScheds    = FeeScheds.GetDeepCopy(_isSelectionMode);
            _listFeeSchedsOld = _listFeeScheds.Select(x => x.Copy()).ToList();
            FillGrid();
        }
示例#4
0
        ///<summary></summary>
        public static void Insert(PerioExam Cur)
        {
            if (PrefB.RandomKeys)
            {
                Cur.PerioExamNum = MiscData.GetKey("perioexam", "PerioExamNum");
            }
            string command = "INSERT INTO perioexam (";

            if (PrefB.RandomKeys)
            {
                command += "PerioExamNum,";
            }
            command += "PatNum,ExamDate,ProvNum"
                       + ") VALUES(";
            if (PrefB.RandomKeys)
            {
                command += "'" + POut.PInt(Cur.PerioExamNum) + "', ";
            }
            command +=
                "'" + POut.PInt(Cur.PatNum) + "', "
                + POut.PDate(Cur.ExamDate) + ", "
                + "'" + POut.PInt(Cur.ProvNum) + "')";
            if (PrefB.RandomKeys)
            {
                General.NonQ(command);
            }
            else
            {
                Cur.PerioExamNum = General.NonQ(command, true);
            }
        }
示例#5
0
        ///<summary>Updates local time and Refreshes all time variables.  Saves NIST server URL as preference.</summary>
        private void SynchTimes()
        {
            this.Cursor = Cursors.WaitCursor;
            //Get NistTime Offset
            double nistOffset = GetNistOffset();

            if (nistOffset == double.MaxValue)            //Timed out
            {
                MsgBox.Show(this, "No response received from NIST time server.  Click synch time after four seconds.");
                this.Cursor = Cursors.Default;
                return;
            }
            if (nistOffset == double.MinValue)            //Invalid Nist Server Address
            {
                this.Cursor = Cursors.Default;
                return;
            }
            double serverOffset = (MiscData.GetNowDateTimeWithMilli() - DateTime.Now).TotalMilliseconds;

            //Get current times from offsets
            _timeLocal  = DateTime.Now;
            _timeServer = _timeLocal.AddMilliseconds(serverOffset);
            _timeNist   = _timeLocal.AddMilliseconds(nistOffset);
            try {
                WindowsTime.SetTime(_timeNist);                 //Sets local machine time
            }
            catch {
                MsgBox.Show(this, "Error setting local machine time.");
            }
            _timeLocal  = DateTime.Now;          //Update time since it has now been set
            this.Cursor = Cursors.Default;
            refreshDisplays();
        }
示例#6
0
        ///<summary></summary>
        public static void Insert(QuickPasteCat cat)
        {
            if (PrefB.RandomKeys)
            {
                cat.QuickPasteCatNum = MiscData.GetKey("quickpastecat", "QuickPasteCatNum");
            }
            string command = "INSERT INTO quickpastecat (";

            if (PrefB.RandomKeys)
            {
                command += "QuickPasteCatNum,";
            }
            command += "Description,ItemOrder,DefaultForTypes) VALUES(";
            if (PrefB.RandomKeys)
            {
                command += "'" + POut.PInt(cat.QuickPasteCatNum) + "', ";
            }
            command +=
                "'" + POut.PString(cat.Description) + "', "
                + "'" + POut.PInt(cat.ItemOrder) + "', "
                + "'" + POut.PString(cat.DefaultForTypes) + "')";
            //MessageBox.Show(string command);
            if (PrefB.RandomKeys)
            {
                General.NonQ(command);
            }
            else
            {
                cat.QuickPasteCatNum = General.NonQ(command, true);
            }
        }
示例#7
0
 private void FormPhoneTiles_Load(object sender, EventArgs e)
 {
                 #if !DEBUG
     if (Environment.MachineName.ToLower() != "jordans")
     {
         checkBoxAll.Visible = false;                      //so this will also be visible in debug
     }
                 #endif
     timeDelta = MiscData.GetNowDateTime() - DateTime.Now;
     PhoneTile tile;
     int       x = 0;
     int       y = 0;
     for (int i = 0; i < 26; i++)
     {
         tile                  = new PhoneTile();
         tile.Name             = "phoneTile" + (i + 1).ToString();
         tile.LayoutHorizontal = true;
         tile.Location         = new Point(tile.Width * x, 26 + (tile.Height * y));
         //((PhoneTile)Controls.Find("phoneTile"+(i+1).ToString(),false)[0]);
         tile.GoToChanged         += new System.EventHandler(this.phoneTile_GoToChanged);
         tile.SelectedTileChanged += new System.EventHandler(this.phoneTile_SelectedTileChanged);
         tile.ScreenshotClick     += new EventHandler(this.phoneTile_ScreenshotClick);
         tile.MenuNumbers          = menuNumbers;
         tile.MenuStatus           = menuStatus;
         this.Controls.Add(tile);
         y++;
         if (y == 13)
         {
             y = 0;
             x++;
         }
     }
     FillTiles(true);            //initial fast load and anytime data changes.  After this, pumped in from main form.
 }
        ///<summary></summary>
        private static void Insert(CanadianExtract cur)
        {
            if (PrefB.RandomKeys)
            {
                cur.CanadianExtractNum = MiscData.GetKey("canadianextract", "CanadianExtractNum");
            }
            string command = "INSERT INTO canadianextract (";

            if (PrefB.RandomKeys)
            {
                command += "CanadianExtractNum,";
            }
            command += "ClaimNum,ToothNum,DateExtraction) VALUES(";
            if (PrefB.RandomKeys)
            {
                command += "'" + POut.PInt(cur.CanadianExtractNum) + "', ";
            }
            command +=
                "'" + POut.PInt(cur.ClaimNum) + "', "
                + "'" + POut.PString(cur.ToothNum) + "', "
                + POut.PDate(cur.DateExtraction) + ")";
            if (PrefB.RandomKeys)
            {
                General.NonQ(command);
            }
            else
            {
                cur.CanadianExtractNum = General.NonQ(command, true);
            }
        }
示例#9
0
        ///<summary></summary>
        public static void Insert(ClockEvent ce)
        {
            if (PrefB.RandomKeys)
            {
                ce.ClockEventNum = MiscData.GetKey("clockevent", "ClockEventNum");
            }
            string command = "INSERT INTO clockevent (";

            if (PrefB.RandomKeys)
            {
                command += "ClockEventNum,";
            }
            command += "EmployeeNum,TimeEntered,TimeDisplayed,ClockIn"
                       + ",ClockStatus,Note) VALUES(";
            if (PrefB.RandomKeys)
            {
                command += "'" + POut.PInt(ce.ClockEventNum) + "', ";
            }
            command +=
                "'" + POut.PInt(ce.EmployeeNum) + "', "
                + POut.PDateT(ce.TimeEntered) + ", "
                + POut.PDateT(ce.TimeDisplayed) + ", "
                + "'" + POut.PBool(ce.ClockIn) + "', "
                + "'" + POut.PInt((int)ce.ClockStatus) + "', "
                + "'" + POut.PString(ce.Note) + "')";
            if (PrefB.RandomKeys)
            {
                General.NonQ(command);
            }
            else
            {
                ce.ClockEventNum = General.NonQ(command, true);
            }
        }
示例#10
0
        ///<summary></summary>
        public static void Insert(Deposit dep)
        {
            if (PrefB.RandomKeys)
            {
                dep.DepositNum = MiscData.GetKey("deposit", "DepositNum");
            }
            string command = "INSERT INTO deposit (";

            if (PrefB.RandomKeys)
            {
                command += "DepositNum,";
            }
            command += "DateDeposit,BankAccountInfo,Amount) VALUES(";
            if (PrefB.RandomKeys)
            {
                command += "'" + POut.PInt(dep.DepositNum) + "', ";
            }
            command +=
                POut.PDate(dep.DateDeposit) + ", "
                + "'" + POut.PString(dep.BankAccountInfo) + "', "
                + "'" + POut.PDouble(dep.Amount) + "')";
            if (PrefB.RandomKeys)
            {
                General.NonQ(command);
            }
            else
            {
                dep.DepositNum = General.NonQ(command, true);
            }
        }
示例#11
0
        ///<summary></summary>
        public static void Insert(ReqNeeded req)
        {
            if (PrefB.RandomKeys)
            {
                req.ReqNeededNum = MiscData.GetKey("reqneeded", "ReqNeededNum");
            }
            string command = "INSERT INTO reqneeded (";

            if (PrefB.RandomKeys)
            {
                command += "ReqNeededNum,";
            }
            command += "Descript,SchoolCourseNum,SchoolClassNum) VALUES(";
            if (PrefB.RandomKeys)
            {
                command += "'" + POut.PInt(req.ReqNeededNum) + "', ";
            }
            command +=
                "'" + POut.PString(req.Descript) + "', "
                + "'" + POut.PInt(req.SchoolCourseNum) + "', "
                + "'" + POut.PInt(req.SchoolClassNum) + "')";
            if (PrefB.RandomKeys)
            {
                General.NonQ(command);
            }
            else
            {
                req.ReqNeededNum = General.NonQ(command, true);
            }
        }
示例#12
0
        ///<summary></summary>
        public static void Insert(Employer Cur)
        {
            if (PrefB.RandomKeys)
            {
                Cur.EmployerNum = MiscData.GetKey("employer", "EmployerNum");
            }
            string command = "INSERT INTO employer (";

            if (PrefB.RandomKeys)
            {
                command += "EmployerNum,";
            }
            command += "EmpName,Address,Address2,City,State,Zip,Phone) VALUES(";
            if (PrefB.RandomKeys)
            {
                command += "'" + POut.PInt(Cur.EmployerNum) + "', ";
            }
            command +=
                "'" + POut.PString(Cur.EmpName) + "', "
                + "'" + POut.PString(Cur.Address) + "', "
                + "'" + POut.PString(Cur.Address2) + "', "
                + "'" + POut.PString(Cur.City) + "', "
                + "'" + POut.PString(Cur.State) + "', "
                + "'" + POut.PString(Cur.Zip) + "', "
                + "'" + POut.PString(Cur.Phone) + "')";
            if (PrefB.RandomKeys)
            {
                General.NonQ(command);
            }
            else
            {
                Cur.EmployerNum = General.NonQ(command, true);
            }
        }
示例#13
0
        ///<summary></summary>
        public static void Insert(LabTurnaround lab)
        {
            if (PrefB.RandomKeys)
            {
                lab.LabTurnaroundNum = MiscData.GetKey("labturnaround", "LabTurnaroundNum");
            }
            string command = "INSERT INTO labturnaround (";

            if (PrefB.RandomKeys)
            {
                command += "LabTurnaroundNum,";
            }
            command += "LaboratoryNum,Description,DaysPublished,DaysActual) VALUES(";
            if (PrefB.RandomKeys)
            {
                command += "'" + POut.PInt(lab.LabTurnaroundNum) + "', ";
            }
            command +=
                "'" + POut.PInt(lab.LaboratoryNum) + "', "
                + "'" + POut.PString(lab.Description) + "', "
                + "'" + POut.PInt(lab.DaysPublished) + "', "
                + "'" + POut.PInt(lab.DaysActual) + "')";
            if (PrefB.RandomKeys)
            {
                General.NonQ(command);
            }
            else
            {
                lab.LabTurnaroundNum = General.NonQ(command, true);
            }
        }
示例#14
0
        ///<summary></summary>
        public static void Insert(PatField pf)
        {
            if (PrefB.RandomKeys)
            {
                pf.PatFieldNum = MiscData.GetKey("patfield", "PatFieldNum");
            }
            string command = "INSERT INTO patfield (";

            if (PrefB.RandomKeys)
            {
                command += "PatFieldNum,";
            }
            command += "PatNum,FieldName,FieldValue) VALUES(";
            if (PrefB.RandomKeys)
            {
                command += "'" + POut.PInt(pf.PatFieldNum) + "', ";
            }
            command +=
                "'" + POut.PInt(pf.PatNum) + "', "
                + "'" + POut.PString(pf.FieldName) + "', "
                + "'" + POut.PString(pf.FieldValue) + "')";
            if (PrefB.RandomKeys)
            {
                General.NonQ(command);
            }
            else
            {
                pf.PatFieldNum = General.NonQ(command, true);
            }
        }
示例#15
0
        ///<summary>Checks if Repeating Charges are already running on another workstation or by the OpenDental Service.  If less than 24 hours have
        ///passed since the tool was started, user will be blocked from running Repeating Charges.  Otherwise, SecurityAdmin users can restart the tool.
        ///</summary>
        private bool CheckBeginDateTime()
        {
            Prefs.RefreshCache();            //Just to be sure we don't miss someone who has just started running repeating charges.
            if (PrefC.GetString(PrefName.RepeatingChargesBeginDateTime) == "")
            {
                return(true);
            }
            DateTime repeatingChargesBeginDateTime = PrefC.GetDateT(PrefName.RepeatingChargesBeginDateTime);

            if ((MiscData.GetNowDateTime() - repeatingChargesBeginDateTime).TotalHours < 24)
            {
                MsgBox.Show(this, "Repeating charges already running on another workstation, you must wait for them to finish before continuing.");
                return(false);
            }
            //It's been more than 24 hours since repeat charges started.
            if (Security.IsAuthorized(Permissions.SecurityAdmin, true))
            {
                string message = Lans.g(this, "Repeating Charges last started on") + " " + repeatingChargesBeginDateTime.ToString()
                                 + Lans.g(this, ".  Restart repeating charges?");
                if (MsgBox.Show(MsgBoxButtons.OKCancel, message))
                {
                    SecurityLogs.MakeLogEntry(Permissions.SecurityAdmin, 0, "Restarted repeating charges. Previous Repeating Charges Begin DateTime was "
                                              + repeatingChargesBeginDateTime.ToString() + ".");
                    return(true);
                }
                return(false);               //Security admin doesn't want to restart repeat charges.
            }
            //User isn't a security admin.
            MsgBox.Show(Lans.g(this, "Repeating Charges last started on") + " " + repeatingChargesBeginDateTime.ToString()
                        + Lans.g(this, ".  Contact a user with SecurityAdmin permission to restart repeating charges."));
            return(false);
        }
示例#16
0
        ///<summary></summary>
        private static void Insert(Instructor instr)
        {
            if (PrefB.RandomKeys)
            {
                instr.InstructorNum = MiscData.GetKey("instructor", "InstructorNum");
            }
            string command = "INSERT INTO instructor (";

            if (PrefB.RandomKeys)
            {
                command += "InstructorNum,";
            }
            command += "LName,FName,Suffix) VALUES(";
            if (PrefB.RandomKeys)
            {
                command += "'" + POut.PInt(instr.InstructorNum) + "', ";
            }
            command +=
                "'" + POut.PString(instr.LName) + "', "
                + "'" + POut.PString(instr.FName) + "', "
                + "'" + POut.PString(instr.Suffix) + "')";
            if (PrefB.RandomKeys)
            {
                General.NonQ(command);
            }
            else
            {
                instr.InstructorNum = General.NonQ(command, true);
            }
        }
示例#17
0
        private void butOK_Click(object sender, EventArgs e)
        {
            if (!CheckBeginDateTime())
            {
                return;
            }
            //If the AvaTax API is not available at HQ show popup and return.
            if (AvaTax.IsEnabled() && !AvaTax.PingAvaTax())
            {
                MsgBox.Show(this, "Unable to connect to AvaTax API.");
                return;
            }
            Cursor = Cursors.WaitCursor;
            RepeatChargeResult result  = RepeatCharges.RunRepeatingCharges(MiscData.GetNowDateTime(), checkRunAging.Checked);
            string             metrics = result.ProceduresAddedCount + " " + Lan.g(this, "procedures added.") + "\r\n" + result.ClaimsAddedCount + " "
                                         + Lan.g(this, "claims added.");

            SecurityLogs.MakeLogEntry(Permissions.RepeatChargeTool, 0, "Repeat Charge Tool ran.\r\n" + metrics);
            Cursor = Cursors.Default;
            MessageBox.Show(metrics);
            if (!string.IsNullOrEmpty(result.ErrorMsg))
            {
                SecurityLogs.MakeLogEntry(Permissions.RepeatChargeTool, 0, "Repeat Charge Tool Error: " + result.ErrorMsg);
                MessageBox.Show(result.ErrorMsg);
            }
            DialogResult = DialogResult.OK;
        }
示例#18
0
        ///<summary>Inserts the given preference and ensures that the primary key is properly set.</summary>
        public static void Insert(ComputerPref computerPref)
        {
            if (PrefB.RandomKeys)
            {
                computerPref.ComputerPrefNum = MiscData.GetKey("computerpref", "ComputerPrefNum");
            }
            string command = "INSERT INTO computerpref (";

            if (PrefB.RandomKeys)
            {
                command += "ComputerPrefNum,";
            }
            command += "ComputerName,GraphicsUseHardware,GraphicsSimple,SensorType,SensorPort,SensorExposure,SensorBinned,GraphicsDoubleBuffering,PreferredPixelFormatNum) VALUES(";
            if (PrefB.RandomKeys)
            {
                command += "'" + POut.PInt(computerPref.ComputerPrefNum) + "',";
            }
            command += "'" + POut.PString(computerPref.ComputerName) + "',"
                       + "'" + POut.PBool(computerPref.GraphicsUseHardware) + "',"
                       + "'" + POut.PBool(computerPref.GraphicsSimple) + "',"
                       + "'" + POut.PString(computerPref.SensorType) + "',"
                       + "'" + POut.PBool(computerPref.SensorBinned) + "',"
                       + "'" + POut.PInt(computerPref.SensorPort) + "',"
                       + "'" + POut.PInt(computerPref.SensorExposure) + "',"
                       + "'" + POut.PBool(computerPref.GraphicsDoubleBuffering) + "',"
                       + "'" + POut.PInt(computerPref.PreferredPixelFormatNum) + "')";
            if (PrefB.RandomKeys)
            {
                General.NonQ(command);
            }
            else
            {
                computerPref.ComputerPrefNum = General.NonQ(command, true);
            }
        }
示例#19
0
        ///<summary>ONLY use this if compname is not already present</summary>
        public static void Insert(Computer comp)
        {
            if (PrefB.RandomKeys)
            {
                comp.ComputerNum = MiscData.GetKey("computer", "ComputerNum");
            }
            string command = "INSERT INTO computer (";

            if (PrefB.RandomKeys)
            {
                command += "ComputerNum,";
            }
            command += "CompName"
                       + ") VALUES(";
            if (PrefB.RandomKeys)
            {
                command += "'" + POut.PInt(comp.ComputerNum) + "', ";
            }
            command +=
                "'" + POut.PString(comp.CompName) + "')";
            //+"'"+POut.PString(PrinterName)+"')";
            if (PrefB.RandomKeys)
            {
                General.NonQ(command);
            }
            else
            {
                comp.ComputerNum = General.NonQ(command, true);
            }
        }
示例#20
0
        ///<summary></summary>
        public static void Insert(Question quest)
        {
            if (PrefB.RandomKeys)
            {
                quest.QuestionNum = MiscData.GetKey("question", "QuestionNum");
            }
            string command = "INSERT INTO question (";

            if (PrefB.RandomKeys)
            {
                command += "QuestionNum,";
            }
            command += "PatNum,ItemOrder,Description,Answer,FormPatNum) VALUES(";
            if (PrefB.RandomKeys)
            {
                command += "'" + POut.PInt(quest.QuestionNum) + "', ";
            }
            command +=
                "'" + POut.PInt(quest.PatNum) + "', "
                + "'" + POut.PInt(quest.ItemOrder) + "', "
                + "'" + POut.PString(quest.Description) + "', "
                + "'" + POut.PString(quest.Answer) + "', "
                + "'" + POut.PInt(quest.FormPatNum) + "')";
            if (PrefB.RandomKeys)
            {
                General.NonQ(command);
            }
            else
            {
                quest.QuestionNum = General.NonQ(command, true);
            }
        }
示例#21
0
        ///<summary></summary>
        private static void Insert(SchoolCourse sc)
        {
            if (PrefB.RandomKeys)
            {
                sc.SchoolCourseNum = MiscData.GetKey("schoolcourse", "SchoolCourseNum");
            }
            string command = "INSERT INTO schoolcourse (";

            if (PrefB.RandomKeys)
            {
                command += "SchoolCourseNum,";
            }
            command += "CourseID,Descript) VALUES(";
            if (PrefB.RandomKeys)
            {
                command += "'" + POut.PInt(sc.SchoolCourseNum) + "', ";
            }
            command +=
                "'" + POut.PString(sc.CourseID) + "', "
                + "'" + POut.PString(sc.Descript) + "')";
            if (PrefB.RandomKeys)
            {
                General.NonQ(command);
            }
            else
            {
                sc.SchoolCourseNum = General.NonQ(command, true);
            }
        }
示例#22
0
        private static DateTime GetDateLimit(Permissions permType, int userGroupNum)
        {
            DateTime nowDate = MiscData.GetNowDateTime().Date;
            DateTime retVal  = DateTime.MinValue;

            for (int i = 0; i < GroupPermissions.List.Length; i++)
            {
                if (GroupPermissions.List[i].UserGroupNum != userGroupNum || GroupPermissions.List[i].PermType != permType)
                {
                    continue;
                }
                //this should only happen once.  One match.
                if (GroupPermissions.List[i].NewerDate.Year > 1880)
                {
                    retVal = GroupPermissions.List[i].NewerDate;
                }
                if (GroupPermissions.List[i].NewerDays == 0)              //do not restrict by days
                //do not change retVal
                {
                }
                else if (nowDate.AddDays(-GroupPermissions.List[i].NewerDays) > retVal)
                {
                    retVal = nowDate.AddDays(-GroupPermissions.List[i].NewerDays);
                }
            }
            return(retVal);
        }
示例#23
0
        ///<summary></summary>
        public static void Insert(Disease disease)
        {
            if (PrefB.RandomKeys)
            {
                disease.DiseaseNum = MiscData.GetKey("disease", "DiseaseNum");
            }
            string command = "INSERT INTO disease (";

            if (PrefB.RandomKeys)
            {
                command += "DiseaseNum,";
            }
            command += "PatNum,DiseaseDefNum,PatNote) VALUES(";
            if (PrefB.RandomKeys)
            {
                command += "'" + POut.PInt(disease.DiseaseNum) + "', ";
            }
            command +=
                "'" + POut.PInt(disease.PatNum) + "', "
                + "'" + POut.PInt(disease.DiseaseDefNum) + "', "
                + "'" + POut.PString(disease.PatNote) + "')";
            if (PrefB.RandomKeys)
            {
                General.NonQ(command);
            }
            else
            {
                disease.DiseaseNum = General.NonQ(command, true);
            }
        }
示例#24
0
        ///<summary></summary>
        public static void Insert(Contact Cur)
        {
            if (PrefB.RandomKeys)
            {
                Cur.ContactNum = MiscData.GetKey("contact", "ContactNum");
            }
            string command = "INSERT INTO contact (";

            if (PrefB.RandomKeys)
            {
                command += "ContactNum,";
            }
            command += "LName,FName,WkPhone,Fax,Category,"
                       + "Notes) VALUES(";
            if (PrefB.RandomKeys)
            {
                command += "'" + POut.PInt(Cur.ContactNum) + "', ";
            }
            command +=
                "'" + POut.PString(Cur.LName) + "', "
                + "'" + POut.PString(Cur.FName) + "', "
                + "'" + POut.PString(Cur.WkPhone) + "', "
                + "'" + POut.PString(Cur.Fax) + "', "
                + "'" + POut.PInt(Cur.Category) + "', "
                + "'" + POut.PString(Cur.Notes) + "')";
            if (PrefB.RandomKeys)
            {
                General.NonQ(command);
            }
            else
            {
                Cur.ContactNum = General.NonQ(command, true);
            }
        }
示例#25
0
        ///<summary></summary>
        public static void Insert(EmailTemplate template)
        {
            if (PrefB.RandomKeys)
            {
                template.EmailTemplateNum = MiscData.GetKey("emailtemplate", "EmailTemplateNum");
            }
            string command = "INSERT INTO emailtemplate (";

            if (PrefB.RandomKeys)
            {
                command += "EmailTemplateNum,";
            }
            command += "Subject,BodyText"
                       + ") VALUES(";
            if (PrefB.RandomKeys)
            {
                command += "'" + POut.PInt(template.EmailTemplateNum) + "', ";
            }
            command +=
                "'" + POut.PString(template.Subject) + "', "
                + "'" + POut.PString(template.BodyText) + "')";
            //MessageBox.Show(string command);
            if (PrefB.RandomKeys)
            {
                General.NonQ(command);
            }
            else
            {
                template.EmailTemplateNum = General.NonQ(command, true);
            }
        }
示例#26
0
        ///<summary></summary>
        private static void Insert(PayPlanCharge charge)
        {
            if (PrefB.RandomKeys)
            {
                charge.PayPlanChargeNum = MiscData.GetKey("payplancharge", "PayPlanChargeNum");
            }
            string command = "INSERT INTO payplancharge (";

            if (PrefB.RandomKeys)
            {
                command += "PayPlanChargeNum,";
            }
            command += "PayPlanNum,Guarantor,PatNum,ChargeDate,Principal,Interest,Note) VALUES(";
            if (PrefB.RandomKeys)
            {
                command += "'" + POut.PInt(charge.PayPlanChargeNum) + "', ";
            }
            command +=
                "'" + POut.PInt(charge.PayPlanNum) + "', "
                + "'" + POut.PInt(charge.Guarantor) + "', "
                + "'" + POut.PInt(charge.PatNum) + "', "
                + POut.PDate(charge.ChargeDate) + ", "
                + "'" + POut.PDouble(charge.Principal) + "', "
                + "'" + POut.PDouble(charge.Interest) + "', "
                + "'" + POut.PString(charge.Note) + "')";
            if (PrefB.RandomKeys)
            {
                General.NonQ(command);
            }
            else
            {
                charge.PayPlanChargeNum = General.NonQ(command, true);
            }
        }
示例#27
0
        ///<summary></summary>
        public static void Insert(CanadianNetwork network)
        {
            if (PrefB.RandomKeys)
            {
                network.CanadianNetworkNum = MiscData.GetKey("canadiannetwork", "CanadianNetworkNum");
            }
            string command = "INSERT INTO canadiannetwork (";

            if (PrefB.RandomKeys)
            {
                command += "CanadianNetworkNum,";
            }
            command += "Abbrev, Descript) VALUES(";
            if (PrefB.RandomKeys)
            {
                command += "'" + POut.PInt(network.CanadianNetworkNum) + "', ";
            }
            command +=
                "'" + POut.PString(network.Abbrev) + "', "
                + "'" + POut.PString(network.Descript) + "')";
            if (PrefB.RandomKeys)
            {
                General.NonQ(command);
            }
            else
            {
                network.CanadianNetworkNum = General.NonQ(command, true);
            }
        }
示例#28
0
        ///<summary></summary>
        private static void Insert(Printer cur)
        {
            if (PrefB.RandomKeys)
            {
                cur.PrinterNum = MiscData.GetKey("printer", "PrinterNum");
            }
            string command = "INSERT INTO printer (";

            if (PrefB.RandomKeys)
            {
                command += "PrinterNum,";
            }
            command += "ComputerNum,PrintSit,PrinterName,"
                       + "DisplayPrompt) VALUES(";
            if (PrefB.RandomKeys)
            {
                command += "'" + POut.PInt(cur.PrinterNum) + "', ";
            }
            command +=
                "'" + POut.PInt(cur.ComputerNum) + "', "
                + "'" + POut.PInt((int)cur.PrintSit) + "', "
                + "'" + POut.PString(cur.PrinterName) + "', "
                + "'" + POut.PBool(cur.DisplayPrompt) + "')";
            //MessageBox.Show(string command);
            if (PrefB.RandomKeys)
            {
                General.NonQ(command);
            }
            else
            {
                cur.PrinterNum = General.NonQ(command, true);
            }
        }
示例#29
0
        ///<summary></summary>
        public static void Insert(TimeAdjust adj)
        {
            if (PrefB.RandomKeys)
            {
                adj.TimeAdjustNum = MiscData.GetKey("timeadjust", "TimeAdjustNum");
            }
            string command = "INSERT INTO timeadjust (";

            if (PrefB.RandomKeys)
            {
                command += "TimeAdjustNum,";
            }
            command += "EmployeeNum,TimeEntry,RegHours,OTimeHours,Note) VALUES(";
            if (PrefB.RandomKeys)
            {
                command += "'" + POut.PInt(adj.TimeAdjustNum) + "', ";
            }
            command +=
                "'" + POut.PInt(adj.EmployeeNum) + "', "
                + POut.PDateT(adj.TimeEntry) + ", "
                + "'" + POut.PDouble(adj.RegHours.TotalHours) + "', "
                + "'" + POut.PDouble(adj.OTimeHours.TotalHours) + "', "
                + "'" + POut.PString(adj.Note) + "')";
            if (PrefB.RandomKeys)
            {
                General.NonQ(command);
            }
            else
            {
                adj.TimeAdjustNum = General.NonQ(command, true);
            }
        }
示例#30
0
        ///<summary></summary>
        public static void InsertCur()
        {
            if (PrefB.RandomKeys)
            {
                Cur.ScreenGroupNum = MiscData.GetKey("screengroup", "ScreenGroupNum");
            }
            string command = "INSERT INTO screengroup (";

            if (PrefB.RandomKeys)
            {
                command += "ScreenGroupNum,";
            }
            command += "Description,SGDate) VALUES(";
            if (PrefB.RandomKeys)
            {
                command += "'" + POut.PInt(Cur.ScreenGroupNum) + "', ";
            }
            command +=
                "'" + POut.PString(Cur.Description) + "', "
                + "'" + POut.PDate(Cur.SGDate) + "')";
            if (PrefB.RandomKeys)
            {
                General.NonQ(command);
            }
            else
            {
                Cur.ScreenGroupNum = General.NonQ(command, true);
            }
        }