Ejemplo n.º 1
0
 public IEnumerable <FAQ.DataStructure.FAQ> Search(Guid congressId, string value)
 {
     try
     {
         var list          = new List <FAQ.DataStructure.FAQ>();
         var faqFacade     = FAQComponent.Instance.FAQFacade.Search(value);
         var congressFaqbo = new CongressFAQBO();
         foreach (var congressHtml in faqFacade)
         {
             var html = congressFaqbo.Get(this.ConnectionHandler, congressId, congressHtml.Id);
             if (html == null)
             {
                 continue;
             }
             list.Add(congressHtml);
         }
         return(list);
     }
     catch (KnownException ex)
     {
         Log.Save(ex.Message, LogType.ApplicationError, ex.Source, ex.StackTrace);
         throw new KnownException(ex.Message, ex);
     }
     catch (Exception ex)
     {
         Log.Save(ex.Message, LogType.ApplicationError, ex.Source, ex.StackTrace);
         throw new KnownException(ex.Message, ex);
     }
 }
Ejemplo n.º 2
0
 public override bool Delete(params object[] keys)
 {
     try
     {
         this.ConnectionHandler.StartTransaction(IsolationLevel.ReadUncommitted);
         this.FaqConnection.StartTransaction(IsolationLevel.ReadUncommitted);
         var congressFaqbo = new CongressFAQBO();
         var obj           = congressFaqbo.Get(this.ConnectionHandler, keys);
         if (!congressFaqbo.Delete(this.ConnectionHandler, keys))
         {
             throw new Exception(Resources.Congress.ErrorInDeleteCongressFAQ);
         }
         if (!FAQComponent.Instance.FAQTransactionalFacade(this.FaqConnection).Delete(obj.FAQId))
         {
             throw new Exception(Resources.Congress.ErrorInDeleteCongressFAQ);
         }
         this.ConnectionHandler.CommitTransaction();
         this.FaqConnection.CommitTransaction();
         return(true);
     }
     catch (KnownException ex)
     {
         this.ConnectionHandler.RollBack();
         this.FaqConnection.RollBack();
         Log.Save(ex.Message, LogType.ApplicationError, ex.Source, ex.StackTrace);
         throw new KnownException(ex.Message, ex);
     }
     catch (Exception ex)
     {
         this.ConnectionHandler.RollBack();
         this.FaqConnection.RollBack();
         Log.Save(ex.Message, LogType.ApplicationError, ex.Source, ex.StackTrace);
         throw new KnownException(ex.Message, ex);
     }
 }