public virtual void GlobalSearchDelete(GlobalSearch entity)
 {
     TraceCallEnterEvent.Raise();
       try
       {
     m_DataContext.BeginNestedTran();
     try
     {
       m_DataContext.ndihdGlobalSearchDelete(entity.IDRef,
                                         entity.SearchCategoryRef);
       m_DataContext.CommitNested();
     }
     catch
     {
       m_DataContext.RollbackNested();
       throw;
     }
     TraceCallReturnEvent.Raise();
     return;
       }
       catch (Exception ex)
       {
     ExceptionManager.Publish(ex);
     TraceCallReturnEvent.Raise(false);
     throw;
       }
 }
Beispiel #2
0
 // -------------------------------------------------------------------------------------
 /// <summary>
 /// Copy constructor.
 /// </summary>
 /// <param name="IDRefVal">Value of 'uIDRef' field</param>
 /// <param name="SearchCategoryRefVal">Value of 'cSearchCategoryRef' field</param>
 /// <param name="origInstance">Original document data to copy.</param>
 // -------------------------------------------------------------------------------------
 public GlobalSearch(DBGuid IDRefVal,
                 DBString SearchCategoryRefVal,
                 GlobalSearch origInstance)
     : base(IDRefVal, SearchCategoryRefVal, origInstance)
 {
 }
Beispiel #3
0
 // -------------------------------------------------------------------------------------
 /// <summary>
 /// Copy constructor.
 /// </summary>
 /// <param name="origInstance">Original document data to copy.</param>
 // -------------------------------------------------------------------------------------
 public GlobalSearch(GlobalSearch origInstance)
     : base(origInstance)
 {
 }
 public virtual void GlobalSearchUpdate(GlobalSearch entity)
 {
     TraceCallEnterEvent.Raise();
       try
       {
     m_DataContext.BeginNestedTran();
     try
     {
       int count;
       m_DataContext.ndihdGlobalSearchUpdate(entity.IDRef,
                                         entity.SearchCategoryRef,
                                         entity.SearchText, out count);
       if (count == 0) throw new ServiceUpdateException();
       m_DataContext.CommitNested();
     }
     catch
     {
       m_DataContext.RollbackNested();
       throw;
     }
     TraceCallReturnEvent.Raise();
     return;
       }
       catch (Exception ex)
       {
     ExceptionManager.Publish(ex);
     TraceCallReturnEvent.Raise(false);
     throw;
       }
 }
 public virtual GlobalSearch GlobalSearchSelect(DBGuid IDRefVal,
                                            DBString SearchCategoryRefVal)
 {
     TraceCallEnterEvent.Raise();
       try
       {
     GlobalSearch result = null;
     DataSet entitySet = m_DataContext.ndihdGlobalSearchSelect(IDRefVal,
                                                           SearchCategoryRefVal);
     if (entitySet.Tables[0].Rows.Count != 0)
     {
       result = new GlobalSearch(entitySet);
     }
     TraceCallReturnEvent.Raise();
     return result;
       }
       catch (Exception ex)
       {
     ExceptionManager.Publish(ex);
     TraceCallReturnEvent.Raise(false);
     throw;
       }
 }
 public void SaveDesignerDrog( DesignerDrog entity )
 {
     TraceCallEnterEvent.Raise();
       try
       {
     //megnézzük hogy van e már hozzá megadott keresõ szöveg .. mert akkor azt update -eljük
     GlobalSearch search = base.GlobalSearchSelect( entity.ID, "DESIGNERDROG" );
     bool hasItem = search != null;
     var text = entity.Title.ToString() + " " + entity.Abstract.ToString()
       + " " +
             entity.Body.ToString() + " " + entity.Author + " " + entity.Source;
     if (hasItem)
     {
       search.SearchText = text;
       //ha van ilyen UPDATE
       base.GlobalSearchUpdate( search );
     }
     else //ha még nincs ilyen INSERT
     {
       search = new GlobalSearch( entity.ID, "DESIGNERDROG" );
       search.SearchText = text;
       base.GlobalSearchInsert( search );
     }
       }
       catch (Exception ex)
       {
     ExceptionManager.Publish( ex );
     BusinessAuditEvent.Fail(
       new EventParameter( "Exception", ex.ToString() ),
       new EventParameter( "IDRef", entity.ID.ToString() ),
       new EventParameter( "SearchCategory", "NEWS" )
       );
     TraceCallReturnEvent.Raise( false );
     throw;
       }
 }
        public void SaveProgram(Guid progID)
        {
            TraceCallEnterEvent.Raise();
              Program entity = null;

              try
              {
            //lekérdezzük a program ID alapján a programot
            ProgramService srvProg = new ProgramService();
            entity = srvProg.ProgramSelect(progID);

            //logical check
            if (entity == null)
              throw new ApplicationException("Ezzel az azonosítóval nem létezik program.");

            //megnézzük hogy van e már hozzá megadott keresõ szöveg .. mert akkor azt update -eljük
            GlobalSearch search = base.GlobalSearchSelect(entity.ID, "PROGRAM");

            if (search != null)
            {
              search.SearchText = entity.Name.ToString() + " " + entity.Description.ToString();

              //lekérdezzük a hozzá tartozó összes kérdõív adatait és hozzáadjuk a SearchText -hez
              search.SearchText = search.SearchText + AddProgramRelated(entity.ID);

              //ha van ilyen UPDATE
              base.GlobalSearchUpdate(search);
            }
            else //ha még nincs ilyen INSERT
            {
              search = new GlobalSearch(entity.ID, "PROGRAM");

              search.SearchText = entity.Name.ToString() + " " + entity.Description.ToString();

              //lekérdezzük a hozzá tartozó összes kérdõív adatait és hozzáadjuk a SearchText -hez
              search.SearchText = search.SearchText + AddProgramRelated(entity.ID);

              base.GlobalSearchInsert(search);
            }
              }
              catch (Exception ex)
              {
            ExceptionManager.Publish(ex);
            BusinessAuditEvent.Fail(
              new EventParameter("Exception", ex.ToString()),
              new EventParameter("IDRef", entity.ID.ToString()),
              new EventParameter("SearchCategory", "PROGRAM")
              );
            TraceCallReturnEvent.Raise(false);
            throw;
              }
        }