コード例 #1
0
 public static ScanSession CreateScanSessionEntry(TenantUserSession tenantUserSession, string name, string description, ContextTenant context = null)
 {
     if (context == null)
     {
         using (context = new ContextTenant(tenantUserSession.Tenant.DatabaseConnectionString))
         {
             return(ScanSessionManagement.CreateScanSessionEntryPrivate(tenantUserSession, name, description, context));
         }
     }
     else
     {
         return(ScanSessionManagement.CreateScanSessionEntryPrivate(tenantUserSession, name, description, context));
     }
 }
コード例 #2
0
 public static ScanSession ScanSessionEntryFinalize(TenantUserSession tenantUserSession, long scanSessionId, ContextTenant context = null)
 {
     if (context == null)
     {
         using (context = new ContextTenant(tenantUserSession.Tenant.DatabaseConnectionString))
         {
             return(ScanSessionManagement.ScanSessionEntryFinalizePrivate(tenantUserSession, scanSessionId, context));
         }
     }
     else
     {
         return(ScanSessionManagement.ScanSessionEntryFinalizePrivate(tenantUserSession, scanSessionId, context));
     }
 }
コード例 #3
0
 //public static bool GetScanSessionById(TenantUserSession tenantUserSession,  long id, out ScanSession scanSession, out Exception exception)
 //{
 //    var result = false;
 //    scanSession = new ScanSession();
 //    exception = null;
 //    try
 //    {
 //        if (!(ScanSessionManagement.GetScanSessionById(tenantUserSession, null, id, out scanSession, out exception))) { if (exception != null) { throw (exception); } }
 //    }
 //    catch (Exception ex)
 //    {
 //        exception = ex;
 //    }
 //    return result;
 //}
 public static ScanSession GetScanSessionById(TenantUserSession tenantUserSession, long id, ContextTenant context = null)
 {
     if (context == null)
     {
         using (context = new ContextTenant(tenantUserSession.Tenant.DatabaseConnectionString))
         {
             return(ScanSessionManagement.GetScanSessionByIdPrivate(tenantUserSession, id, context));
         }
     }
     else
     {
         return(ScanSessionManagement.GetScanSessionByIdPrivate(tenantUserSession, id, context));
     }
 }
コード例 #4
0
 public static ScanSession EditScanSession(TenantUserSession tenantUserSession, long id, string name, string description, ContextTenant context = null)
 {
     if (context == null)
     {
         using (context = new ContextTenant(tenantUserSession.Tenant.DatabaseConnectionString))
         {
             return(ScanSessionManagement.EditScanSessionPrivate(tenantUserSession, id, name, description, context));
             // Audit Trail.
         }
     }
     else
     {
         return(ScanSessionManagement.EditScanSessionPrivate(tenantUserSession, id, name, description, context));
         // Audit Trail.
     }
 }
コード例 #5
0
        //public static bool GetAllScanSessions(TenantUserSession tenantUserSession, out List<ScanSession> scanSessionList, out Exception exception)
        //{
        //    var result = false;
        //    scanSessionList = new List<ScanSession>();
        //    exception = null;
        //    try
        //    {
        //        if (!(ScanSessionManagement.GetAllScanSessions(tenantUserSession, null, out scanSessionList,out exception))) { if (exception != null) { throw (exception); } }
        //    }
        //    catch (Exception ex)
        //    {
        //        exception = ex;
        //    }
        //    return result;
        //}
        //internal static bool GetAllScanSessions(TenantUserSession tenantUserSession, ContextTenant context, out List<ScanSession> scanSessionList, out Exception exception)
        //{
        //    var result = false;
        //    scanSessionList = new List<ScanSession>();
        //    exception = null;
        //    try
        //    {
        //        if (context == null)
        //        {
        //            using (context = new ContextTenant(tenantUserSession.Tenant.DatabaseConnectionString))
        //            {
        //                if (!(ScanSessionManagement.GetAllScanSessions(tenantUserSession, context, out scanSessionList))) { if (exception != null) { throw (exception); } }
        //            }
        //        }
        //        else
        //        {
        //            if (!(ScanSessionManagement.GetAllScanSessions(tenantUserSession, context, out scanSessionList))) { if (exception != null) { throw (exception); } }
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        exception = ex;
        //    }
        //    return result;
        //}
        //private static bool GetAllScanSessions(TenantUserSession tenantUserSession,ContextTenant context, out List<ScanSession> scanSessionList)
        //{
        //    var result = false;
        //    scanSessionList = context.ScanSessions
        //                                .Include(x => x.Documents)
        //                                .Include(x => x.Documents.Select(y => y.User))
        //                                .Include(x => x.User)
        //                                .ToList();
        //    return result;
        //}

        public static List <ScanSession> GetAllScanSessions(TenantUserSession tenantUserSession, ContextTenant context = null)
        {
            if (context == null)
            {
                using (context = new ContextTenant(tenantUserSession.Tenant.DatabaseConnectionString))
                {
                    return(ScanSessionManagement.GetAllScanSessionsPrivate(tenantUserSession, context));
                    // Audit Trail.
                }
            }
            else
            {
                return(ScanSessionManagement.GetAllScanSessionsPrivate(tenantUserSession, context));
                // Audit Trail.
            }
        }