示例#1
0
        public static List <int> GetVersionsAfter(int majorVersion, int minorVersion)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                return(Meth.GetObject <List <int> >(MethodBase.GetCurrentMethod(), majorVersion, minorVersion));
            }
            string command = $@" SELECT *
				FROM versionrelease
				WHERE DateRelease < '1880-01-01'
				AND IsForeign = 0 "                ;

            //Exclude black listed versions.
            for (int i = 0; i < _versionsBlackList.Count; i++)
            {
                command += "AND (MajorNum,MinorNum) != (" + POut.Int(_versionsBlackList[i].Major) + "," + POut.Int(_versionsBlackList[i].Minor) + ") ";
            }
            command += $@"AND MajorNum>={majorVersion}
				ORDER BY MajorNum DESC,MinorNum DESC,BuildNum DESC"                ;
            List <VersionRelease> listVersions = new List <VersionRelease>();

            DataAction.RunBugsHQ(() => listVersions = RefreshAndFill(command), false);
            List <int> retVal = new List <int>();

            foreach (VersionRelease version in listVersions)
            {
                if (version.MajorNum <= majorVersion && version.MinorNum <= minorVersion)
                {
                    continue;
                }
                retVal.Add(PIn.Int(version.MajorNum.ToString() + version.MinorNum.ToString()));
            }
            return(retVal);
        }
示例#2
0
        ///<summary>Wrapper method to call the passed-in func in a seperate thread connected to the reporting server.
        ///This method should only be used for SELECT, with the exception DashboardAR. Using this for create/update/delete may cause duplicates.
        ///The return type of this function is whatever the return type of the method you passed in is.
        ///Throws an exception if anything went wrong executing func within the thread.</summary>
        ///<param name="doRunOnReportServer">If this false, the func will run against the currently connected server.</param>
        public static T RunFuncOnReportServer <T>(Func <T> func, bool doRunOnReportServer = true)
        {
            if (!doRunOnReportServer)
            {
                return(func());
            }
            Exception ex             = null;
            ODThread  threadGetTable = new ODThread(new ODThread.WorkerDelegate((ODThread o) => {
                DataAction.Run(() => { o.Tag = func(); }                    //set the tag to the func's output.
                               , ConnectionNames.DentalOfficeReportServer); //run on the report server. if not set up, automatically runs on the current server.
            }));

            threadGetTable.AddExceptionHandler(new ODThread.ExceptionDelegate((Exception e) => {
                ex = e;
            }));
            threadGetTable.Name = "ReportComplexGetTableThread";
            threadGetTable.Start(true);
            threadGetTable.Join(Timeout.Infinite);
            //Now that we are back on the main thread, it is now safe to throw exceptions.
            if (ex != null)
            {
                ExceptionDispatchInfo.Capture(ex.InnerException ?? ex).Throw();              //This preserves the stack trace of the InnerException.
            }
            return((T)threadGetTable.Tag);
        }
示例#3
0
        ///<summary>Returns a list of all versions ordered by MajorNum, MinorNum, BuildNum, and IsForeign.</summary>
        public static List <VersionRelease> Refresh(bool useConnectionStore = false)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                return(Meth.GetObject <List <VersionRelease> >(MethodBase.GetCurrentMethod(), useConnectionStore));
            }
            List <VersionRelease> listVersionReleases = new List <VersionRelease>();

            DataAction.RunBugsHQ(() => {
                string command = "SELECT * FROM versionrelease ";
                //Exclude black listed versions.
                for (int i = 0; i < _versionsBlackList.Count; i++)
                {
                    if (i == 0)
                    {
                        command += "WHERE ";
                    }
                    else
                    {
                        command += "AND ";
                    }
                    command += "(MajorNum,MinorNum) != (" + POut.Int(_versionsBlackList[i].Major) + "," + POut.Int(_versionsBlackList[i].Minor) + ") ";
                }
                //The order is very important to other entites calling this method.
                command            += "ORDER BY MajorNum DESC,MinorNum DESC,BuildNum DESC,IsForeign";
                listVersionReleases = RefreshAndFill(command);
            }, useConnectionStore);
            return(listVersionReleases);
        }
示例#4
0
        ///<summary></summary>
        public static List <BugSubmission> GetAllInRange(DateTime dateFrom, DateTime dateTo, List <string> listVersionFilters = null, bool useConnectionStore = false)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                return(Meth.GetObject <List <BugSubmission> >(MethodBase.GetCurrentMethod(), dateFrom, dateTo, listVersionFilters, useConnectionStore));
            }
            bool hasSelections = (!listVersionFilters.IsNullOrEmpty());
            List <BugSubmission> listBugSubs = new List <BugSubmission>();

            DataAction.RunBugsHQ(() => {
                string command = $@"SELECT * FROM bugsubmission WHERE {DbHelper.BetweenDates("SubmissionDateTime",dateFrom,dateTo)} 
					{(hasSelections 
						? $@" AND ({string.Join(" OR ",listVersionFilters.Select(x => 
								(x=="Mobile"
									? "DbInfoJson like '%\"DeviceId\":%' and DbInfoJson NOT LIKE '%\"DeviceId\":null%'" 
									: "DbVersion LIKE '"+POut.String(x)+"%'"
								)))
							})" 
						: ""
					)}
				"                ;
                listBugSubs    = Crud.BugSubmissionCrud.SelectMany(command);
            }, useConnectionStore);
            return(listBugSubs);
        }
示例#5
0
        public static DateTime GetBetaReleaseDate()
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                return(Meth.GetObject <DateTime>(MethodBase.GetCurrentMethod()));
            }
            DateTime releaseDate = DateTime.Now;

            DataAction.RunBugsHQ(() => {
                string command = "SELECT * FROM versionrelease "
                                 + "WHERE IsForeign=0 "
                                 + "AND BuildNum=1 ";
                //Exclude black listed versions.
                for (int i = 0; i < _versionsBlackList.Count; i++)
                {
                    command += "AND (MajorNum,MinorNum) != (" + POut.Int(_versionsBlackList[i].Major) + "," + POut.Int(_versionsBlackList[i].Minor) + ") ";
                }
                command += "ORDER BY MajorNum DESC,MinorNum DESC,BuildNum DESC "
                           + "LIMIT 3";            //Might not be 3.
                List <VersionRelease> listVersionReleases = RefreshAndFill(command);
                if (!listVersionReleases.IsNullOrEmpty())
                {
                    releaseDate = listVersionReleases[0].DateRelease;
                }
            }, false);
            return(releaseDate);
        }
示例#6
0
 ///<summary></summary>
 public static void Update(Bug bug)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         Meth.GetVoid(MethodBase.GetCurrentMethod(), bug);
         return;
     }
     DataAction.RunBugsHQ(() => Crud.BugCrud.Update(bug), false);
 }
示例#7
0
 ///<summary></summary>
 public static long Insert(Bug bug)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         bug.BugId = Meth.GetLong(MethodBase.GetCurrentMethod(), bug);
         return(bug.BugId);
     }
     DataAction.RunBugsHQ(() => Crud.BugCrud.Insert(bug), false);
     return(bug.BugId);
 }
示例#8
0
 ///<summary></summary>
 public static void Delete(long bugId)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         Meth.GetVoid(MethodBase.GetCurrentMethod(), bugId);
         return;
     }
     JobLinks.DeleteForType(JobLinkType.Bug, bugId);
     DataAction.RunBugsHQ(() => Crud.BugCrud.Delete(bugId), false);
 }
示例#9
0
        ///<summary>Gets one Bug from the db.</summary>
        public static Bug GetOne(long bugId)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                return(Meth.GetObject <Bug>(MethodBase.GetCurrentMethod(), bugId));
            }
            Bug bug = null;

            DataAction.RunBugsHQ(() => bug = Crud.BugCrud.SelectOne(bugId), false);
            return(bug);
        }
示例#10
0
 ///<summary></summary>
 public static void InsertMany(List <BugSubmissionHash> listBugSubmissionHash, bool useConnectionStore = true)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         Meth.GetVoid(MethodBase.GetCurrentMethod(), listBugSubmissionHash, useConnectionStore);
         return;
     }
     DataAction.RunBugsHQ(() => {
         Crud.BugSubmissionHashCrud.InsertMany(listBugSubmissionHash);
     }, useConnectionStore);
 }
示例#11
0
 ///<summary></summary>
 public static void Delete(long bugSubmissionHashNum, bool useConnectionStore)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         Meth.GetVoid(MethodBase.GetCurrentMethod(), bugSubmissionHashNum, useConnectionStore);
         return;
     }
     DataAction.RunBugsHQ(() => {
         Crud.BugSubmissionHashCrud.Delete(bugSubmissionHashNum);
     }, useConnectionStore);
 }
示例#12
0
 ///<summary></summary>
 public static void Delete(long bugSubmissionId)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         Meth.GetVoid(MethodBase.GetCurrentMethod(), bugSubmissionId);
         return;
     }
     DataAction.RunBugsHQ(() => {
         Crud.BugSubmissionCrud.Delete(bugSubmissionId);
     }, false);
 }
示例#13
0
 ///<summary></summary>
 public static void Update(BugSubmission subNew, BugSubmission subOld, bool useConnectionStore = false)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         Meth.GetVoid(MethodBase.GetCurrentMethod(), subNew, subOld, useConnectionStore);
         return;
     }
     DataAction.RunBugsHQ(() => {
         Crud.BugSubmissionCrud.Update(subNew, subOld);
     }, useConnectionStore);
 }
示例#14
0
 ///<summary></summary>
 public static void Delete(long faqNum)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         Meth.GetVoid(MethodBase.GetCurrentMethod(), faqNum);
         return;
     }
     DataAction.RunManualPublisherHQ(() => {
         Crud.FaqCrud.Delete(faqNum);
     });
 }
示例#15
0
        /// <summary>
        /// Returns the BugSubmissionResult result for a given bug submission hash check.
        /// </summary>
        /// <param name="sub"></param>
        /// <param name="matchedBugId"></param>
        /// <param name="matchedFixedVersions"></param>
        /// <param name="matchedBugSubmissionHashNum"></param>
        /// <param name="submissionVersionOverride"></param>
        /// <returns></returns>
        public static BugSubmissionResult ProcessSubmission(BugSubmission sub, out long matchedBugId, out string matchedFixedVersions
                                                            , out long matchedBugSubmissionHashNum, Version submissionVersionOverride = null, bool useConnectionStore = true)
        {
            matchedBugId                = -1;
            matchedFixedVersions        = null;
            matchedBugSubmissionHashNum = -1;
            if (sub.ListMatchedBugInfos == null)          //Not already defined (like in unit test) so query for it.
            {
                DataAction.RunBugsHQ(() => {
                    DataTable table = Db.GetTable($@"
						SELECT bugSubmissionHashNum, COALESCE(bug.BugId,0) _bugId,COALESCE(bug.VersionsFixed,'') _versionsFixed
						FROM bugsubmissionhash 
						LEFT JOIN bug on bug.BugId=bugsubmissionhash.BugId
						WHERE FullHash='{sub.HashedStackTrace}'
						AND PartialHash='{sub.HashedSimpleStackTrace}'"
                                                  );
                    sub.ListMatchedBugInfos = table.Select().Select(x =>
                                                                    new BugSubmission.MatchedBugInfo(x.GetLong("bugSubmissionHashNum"), x.GetLong("_bugId"), x.GetString("_versionsFixed")
                                                                                                     )).ToList();
                }, useConnectionStore);
            }
            if (sub.ListPendingFixBugInfos.Count > 1)           //There are too many pending bugs and a developer will have to decide which to associate with.
            {
                return(BugSubmissionResult.Failed);
            }
            else if (sub.ListPendingFixBugInfos.Count == 1)
            {
                matchedBugId = sub.ListPendingFixBugInfos.First().BugId;
                matchedBugSubmissionHashNum = sub.ListPendingFixBugInfos.First().BugSubmissionHashNum;
                return(BugSubmissionResult.SuccessMatched);
            }
            //At this point, there are no pending fixes.  Decide if a new bug submission hash should be inserted or find a pertinent fix.
            BugSubmission.MatchedBugInfo bugInfo = sub.GetPertinentFixedVersion(submissionVersionOverride);
            if (bugInfo == null)           //No previously fixed bugs apply to this submission version.
            {
                if (sub.ListMatchedBugInfos.Any(x => x.BugSubmissionHashNum > 0 && x.BugId == 0 && string.IsNullOrEmpty(x.VersionsFixed)))
                {
                    //We have seen this submission/hash before but it has not been associated to an internal bug yet.
                    matchedBugSubmissionHashNum = sub.ListMatchedBugInfos.First(x => x.BugSubmissionHashNum > 0 && x.BugId == 0 && string.IsNullOrEmpty(x.VersionsFixed)).BugSubmissionHashNum;
                    return(BugSubmissionResult.SuccessHashFound);
                }
                //Insert new hash for submission that indicates that a previous fix did not work as intended or we have not seen this submission yet.
                return(BugSubmissionResult.SuccessHashNeeded);
            }
            if (!sub.ListMatchedBugInfos.Any(x => x.BugSubmissionHashNum > 0 && x.BugId == 0 && string.IsNullOrEmpty(x.VersionsFixed)))
            {
                //Even though we found a pertinent fix for the inbound submission there appears to be another hash that was created due to the bug resurfacing again.
                matchedFixedVersions = bugInfo.VersionsFixed;
            }
            matchedBugId = bugInfo.BugId;
            matchedBugSubmissionHashNum = bugInfo.BugSubmissionHashNum;
            return(BugSubmissionResult.SuccessMatchedFixed);
        }
示例#16
0
        ///<summary>Gets one BugSubmission from the db.</summary>
        public static BugSubmission GetOne(long bugSubmissionId)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                return(Meth.GetObject <BugSubmission>(MethodBase.GetCurrentMethod(), bugSubmissionId));
            }
            BugSubmission bugSub = null;

            DataAction.RunBugsHQ(() => {
                bugSub = Crud.BugSubmissionCrud.SelectOne(bugSubmissionId);
            }, false);
            return(bugSub);
        }
示例#17
0
        ///<summary>Gets one BugSubmissionHash from the db.</summary>
        public static BugSubmissionHash GetOne(long bugSubmissionHashNum, bool useConnectionStore = true)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                return(Meth.GetObject <BugSubmissionHash>(MethodBase.GetCurrentMethod(), bugSubmissionHashNum, useConnectionStore));
            }
            BugSubmissionHash bugHash = null;

            DataAction.RunBugsHQ(() => {
                bugHash = Crud.BugSubmissionHashCrud.SelectOne(bugSubmissionHashNum);
            }, useConnectionStore);
            return(bugHash);
        }
示例#18
0
        ///<summary>Returns a list of bugs for given bugIds.</summary>
        public static List <Bug> GetMany(List <long> listBugIds)
        {
            if (listBugIds == null || listBugIds.Count == 0)
            {
                return(new List <Bug>());
            }
            List <Bug> listBugs = new List <Bug>();

            DataAction.RunBugsHQ(() => {
                listBugs = Crud.BugCrud.TableToList(DataCore.GetTable("SELECT * FROM bug WHERE BugID IN (" + string.Join(",", listBugIds) + ")"));
            }, false);
            return(listBugs);
        }
示例#19
0
        ///<summary>Gets one Faq from the db.</summary>
        public static Faq GetOne(long faqNum)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                return(Meth.GetObject <Faq>(MethodBase.GetCurrentMethod(), faqNum));
            }
            Faq retVal = null;

            DataAction.RunManualPublisherHQ(() => {
                retVal = Crud.FaqCrud.SelectOne(faqNum);
            });
            return(retVal);
        }
示例#20
0
        ///<summary>Deletes all faqmanualpagelink rows that have the given faqNum</summary>
        public static void DeleteManualPageLinkForFaqNum(long faqNum)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                Meth.GetVoid(MethodBase.GetCurrentMethod(), faqNum);
                return;
            }
            string command = $@"DELETE FROM faqmanualpagelink WHERE FaqNum={faqNum}";

            DataAction.RunManualPublisherHQ(() => {
                Db.NonQ(command);
            });
        }
示例#21
0
        ///<summary>Returns a list of bug submissions and their corresponding bugs.
        ///If a bugsubmission is not associated to a bug then the BugObj field on the bugsubmission object will be null.
        ///Performs grouping logic in order to minimize the amount of bugsubmissions in the return results.</summary>
        public static List <BugSubmission> GetBugSubsForRegKeys(List <string> listRegKeys, DateTime dateFrom, DateTime dateTo)
        {
            if (listRegKeys == null || listRegKeys.Count == 0)
            {
                return(new List <BugSubmission>());              //No point in going through middle tier.
            }
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                return(Meth.GetObject <List <BugSubmission> >(MethodBase.GetCurrentMethod(), listRegKeys, dateFrom, dateTo));
            }
            List <BugSubmission> listRetVals = new List <BugSubmission>();

            DataAction.RunBugsHQ(() => {
                string command = "SELECT * FROM bugsubmission "
                                 + "LEFT JOIN bug ON bug.BugId=bugsubmission.BugId "
                                 + "WHERE bugsubmission.RegKey IN(" + string.Join(",", listRegKeys.Select(x => "'" + POut.String(x) + "'")) + ") "
                                 + "AND " + DbHelper.BetweenDates("SubmissionDateTime", dateFrom, dateTo) + " "
                                 + "ORDER BY bug.CreationDate DESC, bugsubmission.SubmissionDateTime DESC";
                //The query selects all columns for the bugsubmission and bug tables in one query.  Hopefully we never have conflicting columns that differ.
                DataTable table = Db.GetTable(command);
                //Make a clone of the table structure for the bug objects and only fill it with entries where the BugId row is valid.
                DataTable tableBugs = table.Clone();
                foreach (DataRow row in table.Select().Where(x => PIn.Long(x["BugId"].ToString(), false) != 0))
                {
                    tableBugs.ImportRow(row);
                }
                //Extract all of the bug objects from the subset table.
                List <Bug> listBugs = Crud.BugCrud.TableToList(tableBugs);
                //Extract all of the bugsubmission objects from the results.
                List <BugSubmission> listBugSubs = Crud.BugSubmissionCrud.TableToList(table);
                //Associate any bug object with its corresponding bugsubmission object.
                listBugSubs.ForEach(x => x.BugObj = listBugs.FirstOrDefault(y => y.BugId == x.BugId));
                //Group the bug submissions by RegKey, ExceptionStackTrace, and BugId.
                //Each grouping will be ordered by ProgramVersion individually.
                //Take the first bugsubmission from each group and add it to listGroupedBugSubs for the return value.
                foreach (BugSubmission bugSub in listBugSubs)
                {
                    if (bugSub.TagCustom != null)                   //Used to skip already considered bug submissions via grouping logic.
                    {
                        continue;
                    }
                    List <BugSubmission> listGroupedSubs = listBugSubs.FindAll(x => x.RegKey == bugSub.RegKey &&
                                                                               x.ExceptionStackTrace == bugSub.ExceptionStackTrace &&
                                                                               x.BugId == bugSub.BugId);
                    listGroupedSubs.ForEach(x => x.TagCustom = true);                  //Flag all bugsubmissions in this group as handled.
                    //Only add the most pertinent item from the group to our return value.
                    listRetVals.Add(listGroupedSubs.OrderByDescending(x => new Version(x.TryGetPrefValue(PrefName.ProgramVersion, "0.0.0.0"))).First());
                }
            }, false);
            return(listRetVals);
        }
示例#22
0
        ///<summary></summary>
        public static List <BugSubmission> GetAll(bool useConnectionStore = false)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                return(Meth.GetObject <List <BugSubmission> >(MethodBase.GetCurrentMethod(), useConnectionStore));
            }
            List <BugSubmission> listBugSubs = new List <BugSubmission>();

            DataAction.RunBugsHQ(() => {
                string command = "SELECT * FROM bugsubmission";
                listBugSubs    = Crud.BugSubmissionCrud.SelectMany(command);
            }, useConnectionStore);
            return(listBugSubs);
        }
示例#23
0
        ///<summary></summary>
        public static long Insert(BugSubmission bugSubmission)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                return(Meth.GetLong(MethodBase.GetCurrentMethod(), bugSubmission));
            }
            long retVal = 0;

            //Always use the connection store config file because creating BugSubmissions should always happen via OpenDentalWebServiceHQ.
            DataAction.RunBugsHQ(() => {
                retVal = Crud.BugSubmissionCrud.Insert(bugSubmission);
            });
            return(retVal);
        }
示例#24
0
        public static List <BugSubmission> GetAllAttached()
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                return(Meth.GetObject <List <BugSubmission> >(MethodBase.GetCurrentMethod()));
            }
            List <BugSubmission> listBugSubs = new List <BugSubmission>();

            DataAction.RunBugsHQ(() => {
                string command = "SELECT * FROM bugsubmission WHERE BugId!=0";
                listBugSubs    = Crud.BugSubmissionCrud.SelectMany(command);
            }, false);
            return(listBugSubs);
        }
示例#25
0
        ///<summary></summary>
        public static List <BugSubmission> GetAll()
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                return(Meth.GetObject <List <BugSubmission> >(MethodBase.GetCurrentMethod()));
            }
            List <BugSubmission> listBugSubs = new List <BugSubmission>();

            DataAction.RunBugsHQ(() => {
                string command = "SELECT * FROM bugsubmission";
                listBugSubs    = Crud.BugSubmissionCrud.TableToList(DataCore.GetTable(command));
            }, false);
            return(listBugSubs);
        }
示例#26
0
        ///<summary></summary>
        public static List <BugSubmission> GetAllInRange(DateTime dateFrom, DateTime dateTo)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                return(Meth.GetObject <List <BugSubmission> >(MethodBase.GetCurrentMethod(), dateFrom, dateTo));
            }
            List <BugSubmission> listBugSubs = new List <BugSubmission>();

            DataAction.RunBugsHQ(() => {
                string command = "SELECT * FROM bugsubmission WHERE " + DbHelper.BetweenDates("SubmissionDateTime", dateFrom, dateTo);
                listBugSubs    = Crud.BugSubmissionCrud.TableToList(DataCore.GetTable(command));
            }, false);
            return(listBugSubs);
        }
示例#27
0
        ///<summary></summary>
        public static List <string> GetFilterPhrases()
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                return(Meth.GetObject <List <string> >(MethodBase.GetCurrentMethod()));
            }
            List <string> listPhrases = null;

            //Query the database for all phrases that we don't accept and see if the exception text passed in contains any of the phrases from the database.
            DataAction.RunBugsHQ(() => {
                listPhrases = Db.GetListString("SELECT Phrase FROM bugsubmissionfilter WHERE Phrase!=''");
            });
            return(listPhrases);
        }
示例#28
0
        ///<summary></summary>
        public static long Insert(Faq faq)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                faq.FaqNum = Meth.GetLong(MethodBase.GetCurrentMethod(), faq);
                return(faq.FaqNum);
            }
            long faqNum = 0;

            DataAction.RunManualPublisherHQ(() => {
                faqNum = Crud.FaqCrud.Insert(faq);
            });
            return(faqNum);
        }
示例#29
0
        ///<summary>Checks the manual publisher database to see if the manual pages for a given version exists.
        ///Used when releasing a new version of the OD FAQ system.</summary>
        public static bool PageForVersionExists(int manualVersion)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                return(Meth.GetBool(MethodBase.GetCurrentMethod(), manualVersion));
            }
            string command = $"SELECT COUNT(*)>0 FROM manualpage WHERE VersionOd={manualVersion.ToString()}";
            bool   retVal  = false;

            DataAction.RunManualPublisherHQ(() => {
                retVal = PIn.Bool(Db.GetScalar(command));
            });
            return(retVal);
        }
示例#30
0
        ///<summary>Gets all faq from the database for a given version. Please note the manual publisher treats version as major+minor.
        ///For example, to get all faq's for version 19.1.45 version should be "191".</summary>
        public static List <Faq> GetAllForVersion(int version)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                return(Meth.GetObject <List <Faq> >(MethodBase.GetCurrentMethod(), version));
            }
            string     command = $"SELECT * FROM faq WHERE ManualVersion={version.ToString()}";
            List <Faq> retVal  = new List <Faq>();

            DataAction.RunManualPublisherHQ(() => {
                retVal = Crud.FaqCrud.SelectMany(command);
            });
            return(retVal);
        }