コード例 #1
0
ファイル: Prefs.cs プロジェクト: nampn/ODental
        ///<summary>Used for prefs that are non-standard.  Especially by outside programmers. Returns true if a change was required, or false if no change needed.</summary>
        public static bool UpdateRaw(string prefName, string newValue)
        {
            //Very unusual.  Involves cache, so Meth is used further down instead of here at the top.
            if (!PrefC.Dict.ContainsKey(prefName))
            {
                throw new ApplicationException(prefName + " is an invalid pref name.");
            }
            if (PrefC.GetRaw(prefName) == newValue)
            {
                return(false);               //no change needed
            }
            string command = "UPDATE preference SET "
                             + "ValueString = '" + POut.String(newValue) + "' "
                             + "WHERE PrefName = '" + POut.String(prefName) + "'";
            bool retVal = true;

            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                retVal = Meth.GetBool(MethodBase.GetCurrentMethod(), prefName, newValue);
            }
            else
            {
                Db.NonQ(command);
            }
            Pref pref = new Pref();

            pref.PrefName        = prefName;
            pref.ValueString     = newValue;
            PrefC.Dict[prefName] = pref;
            return(retVal);
        }
コード例 #2
0
ファイル: Prefs.cs プロジェクト: nampn/ODental
        ///<summary>Updates a pref of type long.  Returns true if a change was required, or false if no change needed.</summary>
        public static bool UpdateLong(PrefName prefName, long newValue)
        {
            //Very unusual.  Involves cache, so Meth is used further down instead of here at the top.
            if (!PrefC.Dict.ContainsKey(prefName.ToString()))
            {
                throw new ApplicationException(prefName + " is an invalid pref name.");
            }
            if (PrefC.GetLong(prefName) == newValue)
            {
                return(false);               //no change needed
            }
            string command = "UPDATE preference SET "
                             + "ValueString = '" + POut.Long(newValue) + "' "
                             + "WHERE PrefName = '" + POut.String(prefName.ToString()) + "'";
            bool retVal = true;

            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                retVal = Meth.GetBool(MethodBase.GetCurrentMethod(), prefName, newValue);
            }
            else
            {
                Db.NonQ(command);
            }
            Pref pref = new Pref();

            pref.PrefName    = prefName.ToString();
            pref.ValueString = newValue.ToString();
            PrefC.Dict[prefName.ToString()] = pref;          //in some cases, we just want to change the pref in local memory instead of doing a refresh afterwards.
            return(retVal);
        }
コード例 #3
0
ファイル: InnoDb.cs プロジェクト: kjb7749/testImport
 public static bool IsInnodbAvail()
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         return(Meth.GetBool(MethodBase.GetCurrentMethod()));
     }
     try {
         string command  = "SELECT @@have_innodb";
         string innoDbOn = Db.GetScalar(command).ToString();
         return(innoDbOn == "YES");
     }
     catch (Exception ex) {           //MySQL 5.6 and higher
         ex.DoNothing();
         string    command = "SHOW ENGINES";
         DataTable table   = Db.GetTable(command);
         foreach (DataRow row in table.Rows)
         {
             if (row["Engine"].ToString().ToLower() == "innodb" &&
                 row["Support"].ToString().ToLower().In("yes", "default"))
             {
                 return(true);
             }
         }
         return(false);
     }
 }
コード例 #4
0
        ///<Summary>Checks bugIDs in list for incompletes. Returns false if incomplete exists.</Summary>
        public static bool CheckForCompletion(List <long> listBugIDs)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                return(Meth.GetBool(MethodBase.GetCurrentMethod(), listBugIDs));
            }
            //Create an ODThread so that we can safely change the database connection settings without affecting the calling method's connection.
            ODThread odThread = new ODThread(new ODThread.WorkerDelegate((ODThread o) => {
                //Always set the thread static database connection variables to set the serviceshq db conn.
#if DEBUG
                new DataConnection().SetDbT("localhost", "bugs", "root", "", "", "", DatabaseType.MySql, true);
#else
                new DataConnection().SetDbT("server", "bugs", "root", "", "", "", DatabaseType.MySql, true);
#endif
                string command = "SELECT COUNT(*) FROM bug "
                                 + "WHERE VersionsFixed='' "
                                 + "AND BugId IN (" + String.Join(",", listBugIDs) + ")";
                o.Tag = Db.GetCount(command);
            }));

            odThread.AddExceptionHandler(new ODThread.ExceptionDelegate((Exception e) => {
            }));            //Do nothing
            odThread.Name = "bugsCheckForCompletionThread";
            odThread.Start(true);
            if (!odThread.Join(THREAD_TIMEOUT))
            {
                return(true);
            }
            if (PIn.Int(odThread.Tag.ToString()) != 0)
            {
                return(false);
            }
            return(true);
        }
コード例 #5
0
ファイル: WikiLists.cs プロジェクト: steev90/opendental
        /// <summary>Shifts the column to the right, does nothing if trying to shift the rightmost column.</summary>
        public static void ShiftColumnRight(string listName, string colName)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                Meth.GetBool(MethodBase.GetCurrentMethod(), listName, colName);
                return;
            }
            DataTable columnNames = Db.GetTable("DESCRIBE wikilist_" + POut.String(listName));

            if (columnNames.Rows.Count < 3)
            {
                //not enough columns to reorder.
                return;
            }
            if (colName == columnNames.Rows[0][0].ToString() ||                        //don't shift the PK
                colName == columnNames.Rows[columnNames.Rows.Count - 1][0].ToString()) //don't shift the last column
            //No need to return here, but also no need to continue.
            {
                return;
            }
            string command = "";

            for (int i = 1; i < columnNames.Rows.Count - 1; i++)
            {
                if (columnNames.Rows[i][0].ToString() == colName)
                {
                    command = "ALTER TABLE wikilist_" + POut.String(listName) + " MODIFY " + POut.String(colName) + " TEXT NOT NULL AFTER " + POut.String(columnNames.Rows[i + 1][0].ToString());
                    Db.NonQ(command);
                    return;
                }
            }
            //no column found. Should never reach this location.
        }
コード例 #6
0
ファイル: Resellers.cs プロジェクト: ChemBrain/OpenDental
        ///<summary>Checks the database to see if the reseller has customers with active repeating charges.</summary>
        public static bool HasActiveResellerCustomers(Reseller reseller)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                return(Meth.GetBool(MethodBase.GetCurrentMethod(), reseller));
            }
            string command = @"SELECT COUNT(*) FROM patient
				INNER JOIN registrationkey ON patient.PatNum=registrationkey.PatNum AND IsResellerCustomer=1
				INNER JOIN repeatcharge ON patient.PatNum=repeatcharge.PatNum
				INNER JOIN procedurecode ON repeatcharge.ProcCode=procedurecode.ProcCode
				INNER JOIN resellerservice ON procedurecode.CodeNum=resellerservice.CodeNum 
				WHERE resellerservice.ResellerNum="                 + POut.Long(reseller.ResellerNum) + " "
                             + "AND (patient.Guarantor=" + POut.Long(reseller.PatNum) + " OR patient.SuperFamily=" + POut.Long(reseller.PatNum) + ") "
                             + "AND ("
                             + "(DATE(repeatcharge.DateStart)<=DATE(NOW()) "
                             + "AND "
                             + "((YEAR(repeatcharge.DateStop)<1880) OR (DATE(NOW()<DATE(repeatcharge.DateStop)))))"
                             + ") "
                             + "GROUP BY patient.PatNum";

            if (PIn.Int(Db.GetScalar(command)) > 0)
            {
                return(true);
            }
            return(false);
        }
コード例 #7
0
ファイル: Payments.cs プロジェクト: ChemBrain/OpenDental
        ///<summary>Called just before Allocate in FormPayment.butOK click.  If true, then it will prompt the user before allocating.</summary>
        public static bool AllocationRequired(double payAmt, long patNum)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                return(Meth.GetBool(MethodBase.GetCurrentMethod(), payAmt, patNum));
            }
            string command = "SELECT EstBalance FROM patient "
                             + "WHERE PatNum = " + POut.Long(patNum);
            DataTable table  = Db.GetTable(command);
            double    estBal = 0;

            if (table.Rows.Count > 0)
            {
                estBal = PIn.Double(table.Rows[0][0].ToString());
            }
            if (!PrefC.GetBool(PrefName.BalancesDontSubtractIns))
            {
                command = @"SELECT SUM(InsPayEst)+SUM(Writeoff) 
					FROM claimproc
					WHERE PatNum="                     + POut.Long(patNum) + " "
                          + "AND Status=0";              //NotReceived
                table = Db.GetTable(command);
                if (table.Rows.Count > 0)
                {
                    estBal -= PIn.Double(table.Rows[0][0].ToString());
                }
            }
            if (payAmt > estBal)
            {
                return(true);
            }
            return(false);
        }
コード例 #8
0
        ///<summary></summary>
        public static bool WasTaskAltered(Task task)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                return(Meth.GetBool(MethodBase.GetCurrentMethod(), task));
            }
            string command = "SELECT * FROM task WHERE TaskNum=" + POut.Long(task.TaskNum);
            Task   oldtask = Crud.TaskCrud.SelectOne(command);

            if (oldtask == null ||
                oldtask.DateTask != task.DateTask ||
                oldtask.DateType != task.DateType ||
                oldtask.Descript != task.Descript ||
                oldtask.FromNum != task.FromNum ||
                oldtask.IsRepeating != task.IsRepeating ||
                oldtask.KeyNum != task.KeyNum ||
                oldtask.ObjectType != task.ObjectType ||
                oldtask.TaskListNum != task.TaskListNum ||
                oldtask.TaskStatus != task.TaskStatus ||
                oldtask.UserNum != task.UserNum ||
                oldtask.DateTimeEntry != task.DateTimeEntry ||
                oldtask.DateTimeFinished != task.DateTimeFinished)
            {
                return(true);
            }
            return(false);
        }
コード例 #9
0
ファイル: ClinicPrefs.cs プロジェクト: kjb7749/testImport
        ///<summary>Updates a pref of type long for the specified clinic.  Returns true if a change was required, or false if no change needed.</summary>
        public static bool UpdateLong(PrefName prefName, long clinicNum, long newValue)
        {
            //Very unusual.  Involves cache, so Meth is used further down instead of here at the top.
            ClinicPref clinicPref = GetFirstOrDefault(x => x.ClinicNum == clinicNum && x.PrefName == prefName);

            if (clinicPref == null)
            {
                throw new ApplicationException("The PrefName " + prefName + " does not exist for ClinicNum: " + clinicNum);
            }
            if (PIn.Long(clinicPref.ValueString) == newValue)
            {
                return(false);               //no change needed
            }
            string command = "UPDATE clinicpref SET ValueString='" + POut.Long(newValue) + "' "
                             + "WHERE PrefName='" + POut.String(prefName.ToString()) + "' "
                             + "AND ClinicNum='" + POut.Long(clinicNum) + "'";
            bool retVal = true;

            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                retVal = Meth.GetBool(MethodBase.GetCurrentMethod(), prefName, newValue);
            }
            else
            {
                Db.NonQ(command);
            }
            //Update local cache even though we should be invalidating the cache outside of this method.
            ClinicPref cachedClinicPref = clinicPref;

            cachedClinicPref.PrefName    = prefName;
            cachedClinicPref.ValueString = newValue.ToString();
            cachedClinicPref.ClinicNum   = clinicNum;
            return(retVal);
        }
コード例 #10
0
        ///<summary>Helper method to determine if an index already exists with the given name.  Returns true if indexName matches the INDEX_NAME of any
        ///index in the table.  This will always return false for Oracle.</summary>
        public static bool IndexNameExists(string tableName, string indexName)
        {
            if (DataConnection.DBtype == DatabaseType.Oracle)           //Oracle will not allow the same column to be indexed more than once
            {
                return(false);
            }
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                return(Meth.GetBool(MethodBase.GetCurrentMethod(), tableName, indexName));
            }
            string command = "SELECT COUNT(DISTINCT INDEX_NAME) "
                             + "FROM INFORMATION_SCHEMA.STATISTICS "
                             + "WHERE TABLE_SCHEMA=SCHEMA() "
                             + "AND LOWER(TABLE_NAME)='" + POut.String(tableName.ToLower()) + "' "
                             + "AND LOWER(INDEX_NAME)='" + POut.String(indexName.ToLower()) + "'";

            try {
                if (Db.GetScalar(command) == "0")
                {
                    return(false);
                }
            }
            catch (Exception ex) {
                ex.DoNothing();
                return(false);               //might happen if user does not have permission to query information schema tables.
            }
            return(true);
        }
コード例 #11
0
ファイル: Prefs.cs プロジェクト: ChemBrain/OpenDental
        ///<summary>Returns true if a change was required, or false if no change needed.</summary>
        public static bool UpdateDateT(PrefName prefName, DateTime newValue)
        {
            //Very unusual.  Involves cache, so Meth is used further down instead of here at the top.
            DateTime curValue = PrefC.GetDateT(prefName);

            if (curValue == newValue)
            {
                return(false);               //no change needed
            }
            string command = "UPDATE preference SET "
                             + "ValueString = '" + POut.DateT(newValue, false) + "' "
                             + "WHERE PrefName = '" + POut.String(prefName.ToString()) + "'";
            bool retVal = true;

            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                retVal = Meth.GetBool(MethodBase.GetCurrentMethod(), prefName, newValue);
            }
            else
            {
                Db.NonQ(command);
            }
            Pref pref = new Pref();

            pref.PrefName    = prefName.ToString();
            pref.ValueString = POut.DateT(newValue, false);
            Prefs.UpdateValueForKey(pref);
            return(retVal);
        }
コード例 #12
0
        ///<summary>Gets a list of all future appointments for a given Operatory.  Ordered by dateTime</summary>
        public static bool HasFutureApts(long operatoryNum, params ApptStatus[] arrayIgnoreStatuses)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                return(Meth.GetBool(MethodBase.GetCurrentMethod(), operatoryNum, arrayIgnoreStatuses));
            }
            string command = "SELECT COUNT(*) FROM appointment "
                             + "WHERE Op = " + POut.Long(operatoryNum) + " ";

            if (arrayIgnoreStatuses.Length > 0)
            {
                command += "AND AptStatus NOT IN (";
                for (int i = 0; i < arrayIgnoreStatuses.Length; i++)
                {
                    if (i > 0)
                    {
                        command += ",";
                    }
                    command += POut.Int((int)arrayIgnoreStatuses[i]);
                }
                command += ") ";
            }
            command += "AND AptDateTime > " + DbHelper.Now();
            return(PIn.Int(Db.GetScalar(command)) > 0);
        }
コード例 #13
0
        ///<summary>Helper method to determine if an index already exists.
        ///Returns true if colNames matches the concatenation of all COLUMN_NAME(s) for the column(s) referenced by an index on the corresponding
        ///tableName.  If the index references multiple columns, colNames must have the column names in the exact order in which the index was created
        ///separated by commas, without spaces.
        ///Example: the claimproc table has the multi-column index on columns ClaimPaymentNum, Status, and InsPayAmt.
        ///To see if that index already exists, the parameters would be tableName="claimproc" and colNames="ClaimPaymentNum,Status,InsPayAmt".
        ///Not case sensitive.  This will always return false for Oracle.</summary>
        public static bool IndexExists(string tableName, string colNames)
        {
            if (DataConnection.DBtype == DatabaseType.Oracle)           //Oracle will not allow the same column to be indexed more than once
            {
                return(false);
            }
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                return(Meth.GetBool(MethodBase.GetCurrentMethod(), tableName, colNames));
            }
            string command = "SELECT COUNT(*) FROM ("
                             + "SELECT GROUP_CONCAT(LOWER(COLUMN_NAME) ORDER BY SEQ_IN_INDEX) ColNames "
                             + "FROM INFORMATION_SCHEMA.STATISTICS "
                             + "WHERE TABLE_SCHEMA=SCHEMA() "
                             + "AND LOWER(TABLE_NAME)='" + POut.String(tableName.ToLower()) + "' "
                             + "GROUP BY INDEX_NAME) cols "
                             + "WHERE cols.ColNames='" + POut.String(colNames.ToLower()) + "'";

            try {
                if (Db.GetCount(command) == "0")
                {
                    return(false);
                }
            }
            catch (Exception ex) {
                ex.DoNothing();
                return(false);               //might happen if user does not have permission to query information schema tables.
            }
            return(true);
        }
コード例 #14
0
ファイル: ClaimForms.cs プロジェクト: azzedinerise/OpenDental
        ///<summary> Called when cancelling out of creating a new claimform, and from the claimform window when clicking delete. Returns true if successful or false if dependencies found.</summary>
        public static bool Delete(ClaimForm cf)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                return(Meth.GetBool(MethodBase.GetCurrentMethod(), cf));
            }
            //first, do dependency testing
            string command = "SELECT * FROM insplan WHERE claimformnum = '"
                             + cf.ClaimFormNum.ToString() + "' ";

            command += DbHelper.LimitAnd(1);
            DataTable table = Db.GetTable(command);

            if (table.Rows.Count == 1)
            {
                return(false);
            }
            //Then, delete the claimform
            command = "DELETE FROM claimform "
                      + "WHERE ClaimFormNum = '" + POut.Long(cf.ClaimFormNum) + "'";
            Db.NonQ(command);
            command = "DELETE FROM claimformitem "
                      + "WHERE ClaimFormNum = '" + POut.Long(cf.ClaimFormNum) + "'";
            Db.NonQ(command);
            return(true);
        }
コード例 #15
0
        private static bool GetIsBroadcasterHeartbeatOk()
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                return(Meth.GetBool(MethodBase.GetCurrentMethod()));
            }
            //Reason categories are defined by enums: BroadcasterThreadDefs AND ProxyThreadDef.
            string command = @"
				SELECT * FROM (
				  SELECT 
					0 EServiceSignalNum,
					e.*
				  FROM eservicesignalhq e
					WHERE
					  e.RegistrationKeyNum=-1  -- HQ
					  AND (e.ServiceCode=2 OR e.ServiceCode=3) -- IntegratedTexting OR HQProxyService
					  AND 
					  (
						e.ReasonCode=1004 -- Heartbeat
						OR e.ReasonCode=1005 -- ThreadExit
					   ) 
					ORDER BY 
					  e.SigDateTime DESC
				) a
				GROUP BY a.ReasonCategory
				ORDER BY a.SigDateTime DESC;"                ;
            List <EServiceSignal> signals = Crud.EServiceSignalCrud.SelectMany(command);

            if (signals.Exists(x => x.Severity == eServiceSignalSeverity.Critical || DateTime.Now.Subtract(x.SigDateTime) > TimeSpan.FromMinutes(10)))
            {
                return(false);
            }
            //We got this far so all good.
            return(true);
        }
コード例 #16
0
ファイル: Prefs.cs プロジェクト: kjb7749/testImport
		///<summary>Gets a pref of type bool without using the cache.</summary>
		public static bool GetBoolNoCache(PrefName prefName) {
			if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) {
				return Meth.GetBool(MethodBase.GetCurrentMethod(),prefName);
			}
			string command="SELECT ValueString FROM preference WHERE PrefName = '"+POut.String(prefName.ToString())+"'";
			return PIn.Bool(Db.GetScalar(command));
		}
コード例 #17
0
ファイル: Userods.cs プロジェクト: steev90/opendental
        ///<summary>Supply 0 or -1 for the excludeUserNum to not exclude any.</summary>
        public static bool IsUserNameUnique(string username, long excludeUserNum, bool excludeHiddenUsers)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                return(Meth.GetBool(MethodBase.GetCurrentMethod(), username, excludeUserNum, excludeHiddenUsers));
            }
            if (username == "")
            {
                return(false);
            }
            string command = "SELECT COUNT(*) FROM userod WHERE ";

            //if(Programs.UsingEcwTight()){
            //	command+="BINARY ";//allows different usernames based on capitalization.//we no longer allow this
            //Does not need to be tested under Oracle because eCW users do not use Oracle.
            //}
            command += "UserName='******' "
                       + "AND UserNum !=" + POut.Long(excludeUserNum) + " ";
            if (excludeHiddenUsers)
            {
                command += "AND IsHidden=0";              //not hidden
            }
            DataTable table = Db.GetTable(command);

            if (table.Rows[0][0].ToString() == "0")
            {
                return(true);
            }
            return(false);
        }
コード例 #18
0
        ///<summary>Updates the database with computerPrefNew.  Returns true if changes were needed or if computerPrefOld is null.
        ///Automatically clears out class-wide variables if any changes were needed.</summary>
        public static bool Update(ComputerPref computerPrefNew, ComputerPref computerPrefOld)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                bool wasUpdateNeeded = Meth.GetBool(MethodBase.GetCurrentMethod(), computerPrefNew, computerPrefOld);
                if (wasUpdateNeeded)
                {
                    //If we are running Middle Tier, we need to make sure these variables are reset on the client.
                    _localComputer    = null;
                    _localComputerOld = null;
                }
                return(wasUpdateNeeded);
            }
            bool hadChanges = false;

            if (computerPrefOld == null)
            {
                Crud.ComputerPrefCrud.Update(computerPrefNew);
                hadChanges = true;              //Assume that there were database changes.
            }
            else
            {
                hadChanges = Crud.ComputerPrefCrud.Update(computerPrefNew, computerPrefOld);
            }
            if (hadChanges)
            {
                //DB was updated, may also contain other changes from other WS.
                //Set to null so that we can go to DB again when needed, ensures _localComputer is never stale.
                _localComputer    = null;
                _localComputerOld = null;
            }
            return(hadChanges);
        }
コード例 #19
0
        ///<summary>Surround with try/catch Combines all the given carriers into one. The carrier that will be used as the basis of the combination is specified in the pickedCarrier argument. Updates insplan, then deletes all the other carriers.</summary>
        public static void Combine(List <long> carrierNums, long pickedCarrierNum)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                Meth.GetBool(MethodBase.GetCurrentMethod(), carrierNums, pickedCarrierNum);
                return;
            }
            if (carrierNums.Count == 1)
            {
                return;                //nothing to do
            }
            //remove pickedCarrierNum from the carrierNums list to make the queries easier to construct.
            List <long> carrierNumList = new List <long>();

            for (int i = 0; i < carrierNums.Count; i++)
            {
                if (carrierNums[i] == pickedCarrierNum)
                {
                    continue;
                }
                carrierNumList.Add(carrierNums[i]);
            }
            //Make sure that none of the carrierNums are in use in the etrans table
            string command = "SELECT COUNT(*) FROM etrans WHERE";

            for (int i = 0; i < carrierNumList.Count; i++)
            {
                if (i > 0)
                {
                    command += " OR";
                }
                command += " (CarrierNum=" + carrierNumList[i].ToString() + " AND CarrierTransCounter>0)";
            }
            for (int i = 0; i < carrierNumList.Count; i++)
            {
                command += " OR (CarrierNum2=" + carrierNumList[i].ToString() + " AND CarrierTransCounter2>0)";
            }
            DataTable table  = Db.GetTable(command);
            string    ecount = table.Rows[0][0].ToString();

            if (ecount != "0")
            {
                throw new ApplicationException(Lans.g("Carriers", "Not allowed to combine carriers because some are in use in the etrans table.  Number of entries involved: ") + ecount);
            }
            //Now, do the actual combining----------------------------------------------------------------------------------
            for (int i = 0; i < carrierNums.Count; i++)
            {
                if (carrierNums[i] == pickedCarrierNum)
                {
                    continue;
                }
                command = "UPDATE insplan SET CarrierNum = '" + POut.Long(pickedCarrierNum)
                          + "' WHERE CarrierNum = " + POut.Long(carrierNums[i]);
                Db.NonQ(command);
                command = "DELETE FROM carrier"
                          + " WHERE CarrierNum = '" + carrierNums[i].ToString() + "'";
                Db.NonQ(command);
            }
        }
コード例 #20
0
ファイル: QuickPasteCats.cs プロジェクト: kjb7749/testImport
 ///<summary>This should not be passing in two lists. Consider rewriting to only pass in one list and an identifier to get list from DB.</summary>
 public static bool Sync(List <QuickPasteCat> listNew, List <QuickPasteCat> listOld)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         return(Meth.GetBool(MethodBase.GetCurrentMethod(), listNew, listOld));
     }
     return(Crud.QuickPasteCatCrud.Sync(listNew.Select(x => x.Copy()).ToList(), listOld.Select(x => x.Copy()).ToList()));
 }
コード例 #21
0
ファイル: ClinicPrefs.cs プロジェクト: kjb7749/testImport
 ///<summary>Inserts, updates, or deletes db rows to match listNew.  No need to pass in userNum, it's set before remoting role check and passed to
 ///the server if necessary.  Doesn't create ApptComm items, but will delete them.  If you use Sync, you must create new Apptcomm items.</summary>
 public static bool Sync(List <ClinicPref> listNew, List <ClinicPref> listOld)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         return(Meth.GetBool(MethodBase.GetCurrentMethod(), listNew, listOld));
     }
     return(Crud.ClinicPrefCrud.Sync(listNew, listOld));
 }
コード例 #22
0
ファイル: ScreenPats.cs プロジェクト: kjb7749/testImport
 ///<summary>Inserts, updates, or deletes rows to reflect changes between listScreenPats and stale listScreenPatsOld.</summary>
 public static bool Sync(List <ScreenPat> listScreenPats, List <ScreenPat> listScreenPatsOld)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         return(Meth.GetBool(MethodBase.GetCurrentMethod(), listScreenPats, listScreenPatsOld));
     }
     return(Crud.ScreenPatCrud.Sync(listScreenPats, listScreenPatsOld));
 }
コード例 #23
0
ファイル: PhoneComps.cs プロジェクト: ChemBrain/OpenDental
 public static bool Sync(List <PhoneComp> listNew, List <PhoneComp> listDB)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         return(Meth.GetBool(MethodBase.GetCurrentMethod(), listNew, listDB));
     }
     return(Crud.PhoneCompCrud.Sync(listNew, listDB));
 }
コード例 #24
0
 ///<summary></summary>
 public static bool Update(ProviderErx providerErx, ProviderErx oldProviderErx)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         return(Meth.GetBool(MethodBase.GetCurrentMethod(), providerErx, oldProviderErx));
     }
     return(Crud.ProviderErxCrud.Update(providerErx, oldProviderErx));
 }
コード例 #25
0
 ///<summary></summary>
 public static bool Update(ClinicErx clinicErx, ClinicErx oldClinicErx)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         return(Meth.GetBool(MethodBase.GetCurrentMethod(), clinicErx, oldClinicErx));
     }
     return(Crud.ClinicErxCrud.Update(clinicErx, oldClinicErx));
 }
コード例 #26
0
 public static bool Sync(List <GroupPermission> listNew, List <GroupPermission> listOld)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         return(Meth.GetBool(MethodBase.GetCurrentMethod(), listNew, listOld));
     }
     return(Crud.GroupPermissionCrud.Sync(listNew, listOld));
 }
コード例 #27
0
 ///<summary></summary>
 public static bool Update(Statement statement, Statement statementOld)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         return(Meth.GetBool(MethodBase.GetCurrentMethod(), statement, statementOld));
     }
     return(Crud.StatementCrud.Update(statement, statementOld));
 }
コード例 #28
0
 public static bool GetBool()
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         return(Meth.GetBool(MethodBase.GetCurrentMethod()));
     }
     return(true);
 }
コード例 #29
0
 ///<summary>Must pass in a list of all current display reports, even hidden ones.</summary>
 public static bool Sync(List <DisplayReport> listDisplayReport)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         return(Meth.GetBool(MethodBase.GetCurrentMethod(), listDisplayReport));
     }
     return(Crud.DisplayReportCrud.Sync(listDisplayReport, GetAll(true)));
 }
コード例 #30
0
 ///<summary></summary>
 public static bool Update(ProgramProperty programProp, ProgramProperty programPropOld)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         return(Meth.GetBool(MethodBase.GetCurrentMethod(), programProp, programPropOld));
     }
     return(Crud.ProgramPropertyCrud.Update(programProp, programPropOld));
 }