///<summary></summary> public static void Update(Faq faq) { if (RemotingClient.RemotingRole == RemotingRole.ClientWeb) { Meth.GetVoid(MethodBase.GetCurrentMethod(), faq); return; } DataAction.RunManualPublisherHQ(() => { Crud.FaqCrud.Update(faq); }); }
///<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); }
///<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); }
///<summary>Helper method that copies existing Faq's (and their links) for the most recent version ///and inserts them for the new specified version. This is how Jordan handles releases in the manual publisher. ///Faq must follow this pattern as well. PageForVersionExists() should be called before this method.</summary> public static void CreateFaqsForNewVersion(int newVersion) { //No need to check RemotingRole; no direct calls to the Db from this method. string version = VersionReleases.GetLastReleases(2); string[] versionParts = version.Split('.'); int lastStableVersion = PIn.Int(versionParts[0] + versionParts[1]); List <Faq> listFaqs = GetAllForVersion(lastStableVersion); foreach (Faq faq in listFaqs) { List <string> listPagesLinkedToFaq = GetLinkedManualPages(faq.FaqNum); Faq faqNew = faq.Copy(); faqNew.ManualVersion = newVersion; long faqNewNum = Insert(faqNew); //Attach the manual pages from the beta version to the new version. CreateManualPageLinks(faqNew.FaqNum, listPagesLinkedToFaq, faqNew.ManualVersion); } }