/// <summary> /// Dispose IAppRuntime /// </summary> /// <param name="pIAppRuntime"></param> /// <param name="pCheckSession"></param> public static void DisposeAppRuntime(IAppRuntime pIAppRuntime, bool pCheckSession) { try { if (pIAppRuntime == null && pCheckSession) { pIAppRuntime = WebUtilities.GetSessionObject <IAppRuntime>(Constants.SessionKey_IAppRuntime); } if (pIAppRuntime != null) { pIAppRuntime.Dispose(); pIAppRuntime = null; } if (pCheckSession) { WebUtilities.RemoveSessionObject(Constants.SessionKey_IAppRuntime); } } catch { throw; } }
/// <summary> /// Create an instance of the IAppRuntime /// </summary> /// <param name="pCheckSession"></param> /// <returns></returns> public static IAppRuntime CreateAppRuntime(bool pCheckSession) { IAppRuntime appRunTime = null; try { if (pCheckSession) { appRunTime = WebUtilities.GetSessionObject <IAppRuntime>(Constants.SessionKey_IAppRuntime); } if (appRunTime == null) { appRunTime = AppRuntime.Create(); } if (pCheckSession) { WebUtilities.SetSessionObject(Constants.SessionKey_IAppRuntime, appRunTime); } } catch { throw; } return(appRunTime); }
public static TTarget Adapt <TTarget>(this IAppRuntime @this, object source) where TTarget : class, new() { var adpter = @this.TypeAdapterFactory.Create(); return(adpter.Adapt <TTarget>(source)); }
/// <summary> /// Get Presenter /// </summary> /// <typeparam name="T"></typeparam> /// <param name="pAppRuntime"></param> /// <param name="pSessionKey"></param> /// <returns></returns> public static T GetPresenter <T>(IAppRuntime pAppRuntime, string pSessionKey) where T : PresenterBase { T presenter = null; try { presenter = WebUtilities.GetSessionObject <T>(pSessionKey); if (presenter == null) { presenter = Activator.CreateInstance(typeof(T), new object[] { pAppRuntime }, null) as T; if (presenter != null) { WebUtilities.SetSessionObject(pSessionKey, presenter); } } } catch { throw; } return(presenter); }
/// <summary> /// Get History Manager /// </summary> /// <param name="pAppRuntime"></param> /// <param name="pSessionKey"></param> /// <returns></returns> public static HistoryManager GetHistoryManager(IAppRuntime pAppRuntime, string pSessionKey) { HistoryManager manager = null; try { manager = WebUtilities.GetSessionObject <HistoryManager>(pSessionKey); if (manager == null) { manager = Activator.CreateInstance(typeof(HistoryManager), new object[] { pAppRuntime }, null) as HistoryManager; if (manager != null) { WebUtilities.SetSessionObject(pSessionKey, manager); } } } catch { throw; } return(manager); }
public ApplicationWebServiceRequestPresenter(IAppRuntime pAppRuntime) : base(pAppRuntime) { }
/// <summary> /// Initializes a new instance of the <see cref="ModelAssemblyRegistry"/> class. /// </summary> /// <param name="appRuntime">The application runtime.</param> public ModelAssemblyRegistry(IAppRuntime appRuntime) { Contract.Requires(appRuntime != null); this.appRuntime = appRuntime; }
/// <summary> /// Create DBProvider /// </summary> /// <param name="pAdapterMetadata"></param> /// <param name="pApplicationDatabase"></param> /// <param name="pAppRuntime"></param> /// <returns></returns> public static AbstractDBProvider CreateDBProvider(IntegrationAdapter pAdapterMetadata, ApplicationDatabas pApplicationDatabase, IAppRuntime pAppRuntime) { AbstractDBProvider dbProvider = null; try { switch (pApplicationDatabase.ApplicationDatabaseType.ToEnum <ApplicationDatabaseType>()) { case ApplicationDatabaseType.SQLServer: { dbProvider = SQLProvider.Create(pAdapterMetadata, pApplicationDatabase, pAppRuntime); } break; case ApplicationDatabaseType.Oracle: { dbProvider = OracleProvider.Create(pAdapterMetadata, pApplicationDatabase, pAppRuntime); } break; case ApplicationDatabaseType.MySQL: { //Not yet Implemented } break; case ApplicationDatabaseType.Sybase: { //Not yet Implemented } break; default: { } break; } } catch { throw; } return(dbProvider); }
internal SettingsService(IAppRuntime pIAppRuntime) : base(pIAppRuntime) { }
internal static DBAdapter Create(IntegrationProcess pProcessMetadata, IntegrationAdapter pAdapterMetadata, IAppRuntime pIAppRuntime) { return(new DBAdapter(pProcessMetadata, pAdapterMetadata, pIAppRuntime)); }
internal ReportsService(IAppRuntime pIAppRuntime) : base(pIAppRuntime) { }
public IntegrationAdapterPresenter(IAppRuntime pAppRuntime) : base(pAppRuntime) { }
public ApplicationDatabasePresenter(IAppRuntime pAppRuntime) : base(pAppRuntime) { }
internal AdapterCacheManager(IAppRuntime pIAppRuntime) : base(pIAppRuntime) { }
public IntegrationProcessHistoryPresenter(IAppRuntime pAppRuntime) : base(pAppRuntime) { }
public AbstractProvider(IntegrationAdapter pAdapterMetadata, IAppRuntime pAppRuntime) : base(pAppRuntime) { this.AdapterMetadata = pAdapterMetadata; }
internal AbstractAdapter(IntegrationProcess pProcessMetadata, IntegrationAdapter pAdapterMetadata, IAppRuntime pIAppRuntime) : base(pIAppRuntime) { this.ProcessMetadata = pProcessMetadata; this.AdapterMetadata = pAdapterMetadata; }
/// <summary> /// Create Adapter /// </summary> /// <param name="pProcessMetadata"></param> /// <param name="pAdapterMetadata"></param> /// <param name="pAppRuntime"></param> /// <returns></returns> internal static AbstractAdapter CreateAdapter(IntegrationProcess pProcessMetadata, IntegrationAdapter pAdapterMetadata, IAppRuntime pAppRuntime) { AbstractAdapter adapter = null; switch (pAdapterMetadata.EndPointType.ToEnum <EndPointType>()) { case EndPointType.Database: { adapter = DBAdapter.Create(pProcessMetadata, pAdapterMetadata, pAppRuntime); } break; case EndPointType.WebService: { adapter = WSAdapter.Create(pProcessMetadata, pAdapterMetadata, pAppRuntime); } break; default: { } break; } return(adapter); }
internal TransactionLogManager(IAppRuntime pIAppRuntime) : base(pIAppRuntime) { }
internal static IReportsService Create(IAppRuntime pIAppRuntime) { return(new ReportsService(pIAppRuntime)); }
internal SecurityService(IAppRuntime pIAppRuntime) : base(pIAppRuntime) { }
internal DBAdapter(IntegrationProcess pProcessMetadata, IntegrationAdapter pAdapterMetadata, IAppRuntime pIAppRuntime) : base(pProcessMetadata, pAdapterMetadata, pIAppRuntime) { }
///// <summary> ///// Get User ///// </summary> ///// <param name="pUserName"></param> ///// <param name="pIncludeAll"></param> ///// <returns></returns> //public ApplicationUser GetUser(string pUserName, bool pIncludeAll = true) //{ // ApplicationUser user = null; // try // { // List<string> includes = new List<string>(); // if (pIncludeAll) // { // includes.Add("ApplicationUserInGroups.ApplicationGroup.ApplicationGroupInRoles.ApplicationRole.ApplicationRoleUsersAccess"); // } // else // { // includes.Add("ApplicationUserInGroups.ApplicationGroup"); // includes.Add("ApplicationUserCCSIs.CCSI"); // includes.Add("ApplicationUserLicenses.License"); // } // user = base.AppRuntime.DataService.GetEntity(GetDataRequest<ApplicationUser>.Create( // c => c.UserName == pUserName, includes.ToArray())); // } // catch { throw; } // return user; //} ///// <summary> ///// Get User Info ///// </summary> ///// <returns></returns> //public UserInfo GetUserInfo(string pUserName) //{ // UserInfo userInfo = null; // try // { // userInfo = DTOUtilities.BuildUserInfo(pUserName, this.GetUser(pUserName, false)); // } // catch (Exception ex) // { // LogManager.LogException(ex); // } // return userInfo; //} ///// <summary> ///// Get Current User ///// </summary> ///// <param name="pReload"></param> ///// <returns></returns> //public UserInfo GetCurrentUser(bool pReload = true) //{ // if (pReload) // { // this.CurrentUser = null; // } // return this.CurrentUser; //} ///// <summary> ///// Add User Track Page ///// </summary> ///// <param name="pApplicationRole"></param> ///// <param name="pUserID"></param> //public void AddUserTrackPage(ApplicationRole pApplicationRole, string pUserID) //{ // try // { // if (pApplicationRole != null) // { // ApplicationRoleUsersAccess appRoleUserAccesss = new ApplicationRoleUsersAccess() // { // ApplicationRoleID = pApplicationRole.ApplicationRoleID, // ApplicationUserID = pUserID, // AccessDateTime = DateTime.Now, // }; // base.AppRuntime.DataService.AddEntity(appRoleUserAccesss); // base.AppRuntime.DataService.SaveChanges(); // } // } // catch (Exception ex) // { // LogManager.LogException(ex); // } //} ///// <summary> ///// Add User Track Page ///// </summary> ///// <param name="pApplicationRolePath"></param> ///// <param name="pUserID"></param> //public void AddUserTrackPage(string pApplicationRolePath, string pUserID) //{ // try // { // ApplicationRole appRole = base.AppRuntime.MetadataService.GetRole(pApplicationRolePath); // if (appRole != null) // { // this.AddUserTrackPage(appRole, pUserID); // } // } // catch (Exception ex) // { // LogManager.LogException(ex); // } //} ///// <summary> ///// Check User Authorization ///// </summary> ///// <param name="pUser"></param> ///// <param name="pApplicationRolePath"></param> ///// <param name="pAddUserTrack"></param> ///// <returns></returns> //public bool CheckUserAuthorization(UserInfo pUser, string pApplicationRolePath, bool pAddUserTrack = true) //{ // bool isAuthorized = false; // try // { // ApplicationRole appRole = base.AppRuntime.MetadataService.GetRole(pApplicationRolePath); // if (appRole != null) // { // isAuthorized = this.CheckUserAuthorization(pUser, appRole, pAddUserTrack); // } // } // catch (Exception ex) // { // LogManager.LogException(ex); // } // return isAuthorized; //} ///// <summary> ///// Check User Authorization ///// </summary> ///// <param name="pUser"></param> ///// <param name="pApplicationRole"></param> ///// <param name="pAddUserTrack"></param> ///// <returns></returns> //public bool CheckUserAuthorization(UserInfo pUser, ApplicationRole pApplicationRole, bool pAddUserTrack = true) //{ // bool isAuthorized = false; // try // { // if (pApplicationRole != null) // { // foreach (ApplicationGroupInRole appGroup in pApplicationRole.ApplicationGroupInRoles.Where(c => c.ApplicationGroup.IsActiveDirectoryGroup == false)) // { // ApplicationUserInGroup appGroupUser = appGroup.ApplicationGroup.ApplicationUserInGroups.FirstOrDefault(c => // c.ApplicationUser.UserName.ToLower() == pUser.UserName.ToLower()); // if (appGroupUser != null) // { // isAuthorized = true; // break; // } // } // if (pAddUserTrack) // { // this.AddUserTrackPage(pApplicationRole, pUser.UserName); // } // } // } // catch (Exception ex) // { // LogManager.LogException(ex); // } // return isAuthorized; //} ///// <summary> ///// Get User Roles ///// </summary> ///// <param name="pUser"></param> ///// <returns></returns> //public List<ApplicationRole> GetUserRoles(UserInfo pUser) //{ // List<ApplicationRole> roles = null; // try // { // roles = new List<ApplicationRole>(); // foreach (ApplicationRole appRole in base.AppRuntime.MetadataService.Roles) // { // foreach (ApplicationGroupInRole appGroup in appRole.ApplicationGroupInRoles) // { // ApplicationUserInGroup appGroupUser = appGroup.ApplicationGroup.ApplicationUserInGroups.FirstOrDefault(c => // c.ApplicationUser.UserName.ToLower() == pUser.UserName); // if (appGroupUser != null) // { // roles.Add(appRole); // break; // } // } // } // } // catch (Exception ex) // { // LogManager.LogException(ex); // } // return roles; //} ///// <summary> ///// Get User Menu ///// </summary> ///// <param name="pUser"></param> ///// <returns></returns> //public List<ApplicationMenu> GetUserMenu(UserInfo pUser) //{ // List<ApplicationMenu> menus = null; // try // { // menus = new List<ApplicationMenu>(); // List<ApplicationRole> userRoles = this.GetUserRoles(pUser); // foreach (ApplicationMenu menuModule in base.AppRuntime.MetadataService.Menus.Where(c => c.IsModuleRoot).OrderBy(c => c.DisplaySequence)) // { // bool pAddModule = false; // foreach (ApplicationMenu menuGroup in menuModule.Items.OrderBy(c => c.DisplaySequence)) // { // bool pAddGroup = false; // foreach (ApplicationMenu menuRole in menuGroup.Items.OrderBy(c => c.DisplaySequence)) // { // ApplicationRole appRole = userRoles.FirstOrDefault(c => c.ApplicationRoleID == menuRole.ApplicationRoleID); // if (appRole != null) // { // pAddModule = true; // pAddGroup = true; // menus.Add(menuRole); // } // } // if (pAddGroup) // { // menus.Add(menuGroup); // } // } // if (pAddModule) // { // menus.Add(menuModule); // } // } // } // catch (Exception ex) // { // LogManager.LogException(ex); // } // return menus; //} #endregion #endregion #region Factory internal static ISecurityService Create(IAppRuntime pIAppRuntime) { return(new SecurityService(pIAppRuntime)); }
internal static ISettingsService Create(IAppRuntime pIAppRuntime) { return(new SettingsService(pIAppRuntime)); }
public AbstractWSProvider(IntegrationAdapter pAdapterMetadata, ApplicationWebService pApplicationWebServiceMetadata, IAppRuntime pAppRuntime) : base(pAdapterMetadata, pAppRuntime) { this.ApplicationWebServiceMetadata = pApplicationWebServiceMetadata; }
public IntegrationProcessMappingPresenter(IAppRuntime pAppRuntime) : base(pAppRuntime) { }
public AbstractDBProvider(IntegrationAdapter pAdapterMetadata, ApplicationDatabas pApplicationDatabaseMetadata, IAppRuntime pAppRuntime) : base(pAdapterMetadata, pAppRuntime) { this.ApplicationDatabaseMetadata = pApplicationDatabaseMetadata; if (this.ApplicationDatabaseMetadata != null) { this.ProviderType = this.ApplicationDatabaseMetadata.ApplicationDatabaseType.ToEnum <ApplicationDatabaseType>(); } }
public AppRuntimeComponent(IAppRuntime pIAppRuntime) { this.AppRuntime = pIAppRuntime; }
internal MetadataService(IAppRuntime pIAppRuntime) : base(pIAppRuntime) { }
/// <summary> /// Presenter Base /// </summary> /// <param name="pAppRuntime"></param> public PresenterBase(IAppRuntime pAppRuntime) { this.AppRuntime = pAppRuntime; }
internal static IMetadataService Create(IAppRuntime pIAppRuntime) { return(new MetadataService(pIAppRuntime)); }