public IEnumerable <FAQ.DataStructure.FAQ> Search(Guid websiteId, string value) { try { var list = new List <FAQ.DataStructure.FAQ>(); var faqFacade = FAQComponent.Instance.FAQFacade.Search(value); var congressFaqbo = new FAQBO(); foreach (var congressHtml in faqFacade) { var html = congressFaqbo.Get(this.ConnectionHandler, websiteId, congressHtml.Id); if (html == null) { continue; } list.Add(congressHtml); } return(list); } catch (KnownException knownException) { throw new KnownException(knownException.Message, knownException); } catch (Exception ex) { throw new KnownException(ex.Message, ex); } }
public override bool Delete(params object[] keys) { try { this.ConnectionHandler.StartTransaction(IsolationLevel.ReadUncommitted); this.FaqConnection.StartTransaction(IsolationLevel.ReadUncommitted); var congressFaqbo = new FAQBO(); var obj = congressFaqbo.Get(this.ConnectionHandler, keys); if (!congressFaqbo.Delete(this.ConnectionHandler, keys)) { throw new Exception("خطایی در حذف FAQ وجود دارد"); } if (!FAQComponent.Instance.FAQTransactionalFacade(this.FaqConnection).Delete(obj.FAQId)) { throw new Exception("خطایی در حذف FAQ وجود دارد"); } this.ConnectionHandler.CommitTransaction(); this.FaqConnection.CommitTransaction(); return(true); } catch (KnownException knownException) { this.ConnectionHandler.RollBack(); this.FaqConnection.RollBack(); throw new KnownException(knownException.Message, knownException); } catch (Exception ex) { this.ConnectionHandler.RollBack(); this.FaqConnection.RollBack(); throw new KnownException(ex.Message, ex); } }