///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_L6US_GAUTDfT_1343_Array Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_L6US_GAUTDfT_1343_Array functionReturn = new FR_L6US_GAUTDfT_1343_Array(); try { if (cleanupConnection == true) { Connection = CSV2Core_MySQL.Support.DBSQLSupport.CreateConnection(ConnectionString); Connection.Open(); } if (cleanupTransaction == true) { Transaction = Connection.BeginTransaction(); } functionReturn = Execute(Connection, Transaction, securityTicket); #region Cleanup Connection/Transaction //Commit the transaction if (cleanupTransaction == true) { Transaction.Commit(); } //Close the connection if (cleanupConnection == true) { Connection.Close(); } #endregion } catch (Exception ex) { try { if (cleanupTransaction == true && Transaction != null) { Transaction.Rollback(); } } catch { } try { if (cleanupConnection == true && Connection != null) { Connection.Close(); } } catch { } throw new Exception("Exception occured in method cls_Get_AdminUsersTableData_for_TenantID", ex); } return(functionReturn); }
protected static FR_L6US_GAUTDfT_1343_Array Execute(DbConnection Connection, DbTransaction Transaction, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { #region UserCode var returnValue = new FR_L6US_GAUTDfT_1343_Array(); //Put your code here List <L6US_GAUTDfT_1343> tempResult = new List <L6US_GAUTDfT_1343>(); var tempUsers = cls_Get_UsersBasicInfo_for_TenantID.Invoke(Connection, Transaction, securityTicket).Result; ORM_CMN_Account_ApplicationSubscription.Query appSubscriptionQuery = new ORM_CMN_Account_ApplicationSubscription.Query(); Guid ApplicationID = Guid.Parse(WebConfigurationManager.AppSettings["ApplicationID"].ToString()); foreach (var currentUser in tempUsers) { L6US_GAUTDfT_1343 tempResultItem = new L6US_GAUTDfT_1343(); tempResultItem.User_ID = currentUser.USR_AccountID; tempResultItem.User_FirsName = currentUser.FirstName; tempResultItem.User_LastName = currentUser.LastName; tempResultItem.User_Email = currentUser.PrimaryEmail; P_L5US_GARfAID_1319 userRightsParameter = new P_L5US_GARfAID_1319(); userRightsParameter.Account_ID = tempResultItem.User_ID; tempResultItem.User_AccountRights = cls_Get_AccountRights_for_AccountID.Invoke(Connection, Transaction, userRightsParameter, securityTicket).Result; L6US_GAMDMDfAU_1317a tempUser = new L6US_GAMDMDfAU_1317a(); appSubscriptionQuery.Account_RefID = currentUser.USR_AccountID; appSubscriptionQuery.IsDeleted = false; appSubscriptionQuery.Tenant_RefID = securityTicket.TenantID; List <ORM_CMN_Account_ApplicationSubscription> tempSubscriptionResult = ORM_CMN_Account_ApplicationSubscription.Query.Search(Connection, Transaction, appSubscriptionQuery); if (tempSubscriptionResult != null && tempSubscriptionResult.Count > 0) { tempResultItem.User_HasAccessToApp = tempSubscriptionResult.Exists(ts => ts.Application_RefID == ApplicationID && !ts.IsDisabled); } else { tempResultItem.User_HasAccessToApp = false; } tempResultItem.IsAdmin = false; tempResultItem.IsManager = false; tempResultItem.IsDeveloper = false; tempResult.Add(tempResultItem); } returnValue.Result = tempResult.ToArray(); return(returnValue); #endregion UserCode }