コード例 #1
0
        ///<summary>
        /// Method Invocation of wrapper classes
        ///<summary>
        protected static FR_L2FL_GAPIAFLRFA_1238 Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            bool cleanupConnection  = Connection == null;
            bool cleanupTransaction = Transaction == null;

            FR_L2FL_GAPIAFLRFA_1238 functionReturn = new FR_L2FL_GAPIAFLRFA_1238();

            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_AccountPersonalInformations_And_FunctionLevelRights_For_AccountID", ex);
            }
            return(functionReturn);
        }
コード例 #2
0
        protected static FR_L2FL_GAPIAFLRFA_1238 Execute(DbConnection Connection, DbTransaction Transaction, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_L2FL_GAPIAFLRFA_1238();

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL2_FunctionLevelRight.Atomic.Retrieval.SQL.cls_Get_AccountPersonalInformations_And_FunctionLevelRights_For_AccountID.sql";

            command.CommandText = new System.IO.StreamReader(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream(commandLocation)).ReadToEnd();
            CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "ticket", securityTicket);
            command.CommandTimeout = QueryTimeout;

            List <L2FL_GAPIAFLRFA_1238_raw> results = new List <L2FL_GAPIAFLRFA_1238_raw>();
            var loader = new CSV2Core_MySQL.Dictionaries.MultiTable.Loader.DictionaryLoader(Connection, Transaction);
            var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader());

            try
            {
                reader.SetOrdinals(new string[] { "DefaultLanguage_RefID", "Username", "BusinessParticipant_RefID", "AccountType", "USR_AccountID", "Tenant_RefID", "FunctionLevelRight_AssignmentID", "USR_Account_FunctionLevelRightID", "FunctionLevelRight_RefID", "RightName", "FunctionLevelRights_Group_RefID", "PersonalInfo_AssignmentID", "CMN_PER_PersonInfoID", "Salutation_Letter", "Salutation_General", "Address_RefID", "BirthDate", "ProfileImage_Document_RefID", "Title", "PrimaryEmail", "LastName", "FirstName" });
                while (reader.Read())
                {
                    L2FL_GAPIAFLRFA_1238_raw resultItem = new L2FL_GAPIAFLRFA_1238_raw();
                    //0:Parameter DefaultLanguage_RefID of type Guid
                    resultItem.DefaultLanguage_RefID = reader.GetGuid(0);
                    //1:Parameter Username of type String
                    resultItem.Username = reader.GetString(1);
                    //2:Parameter BusinessParticipant_RefID of type Guid
                    resultItem.BusinessParticipant_RefID = reader.GetGuid(2);
                    //3:Parameter AccountType of type int
                    resultItem.AccountType = reader.GetInteger(3);
                    //4:Parameter USR_AccountID of type Guid
                    resultItem.USR_AccountID = reader.GetGuid(4);
                    //5:Parameter Tenant_RefID of type Guid
                    resultItem.Tenant_RefID = reader.GetGuid(5);
                    //6:Parameter FunctionLevelRight_AssignmentID of type Guid
                    resultItem.FunctionLevelRight_AssignmentID = reader.GetGuid(6);
                    //7:Parameter USR_Account_FunctionLevelRightID of type Guid
                    resultItem.USR_Account_FunctionLevelRightID = reader.GetGuid(7);
                    //8:Parameter FunctionLevelRight_RefID of type Guid
                    resultItem.FunctionLevelRight_RefID = reader.GetGuid(8);
                    //9:Parameter RightName of type String
                    resultItem.RightName = reader.GetString(9);
                    //10:Parameter FunctionLevelRights_Group_RefID of type Guid
                    resultItem.FunctionLevelRights_Group_RefID = reader.GetGuid(10);
                    //11:Parameter PersonalInfo_AssignmentID of type Guid
                    resultItem.PersonalInfo_AssignmentID = reader.GetGuid(11);
                    //12:Parameter CMN_PER_PersonInfoID of type Guid
                    resultItem.CMN_PER_PersonInfoID = reader.GetGuid(12);
                    //13:Parameter Salutation_Letter of type String
                    resultItem.Salutation_Letter = reader.GetString(13);
                    //14:Parameter Salutation_General of type String
                    resultItem.Salutation_General = reader.GetString(14);
                    //15:Parameter Address_RefID of type Guid
                    resultItem.Address_RefID = reader.GetGuid(15);
                    //16:Parameter BirthDate of type DateTime
                    resultItem.BirthDate = reader.GetDate(16);
                    //17:Parameter ProfileImage_Document_RefID of type Guid
                    resultItem.ProfileImage_Document_RefID = reader.GetGuid(17);
                    //18:Parameter Title of type String
                    resultItem.Title = reader.GetString(18);
                    //19:Parameter PrimaryEmail of type String
                    resultItem.PrimaryEmail = reader.GetString(19);
                    //20:Parameter LastName of type String
                    resultItem.LastName = reader.GetString(20);
                    //21:Parameter FirstName of type String
                    resultItem.FirstName = reader.GetString(21);

                    results.Add(resultItem);
                }
            }
            catch (Exception ex)
            {
                reader.Close();
                throw new Exception("Exception occured durng data retrieval in method cls_Get_AccountPersonalInformations_And_FunctionLevelRights_For_AccountID", ex);
            }
            reader.Close();
            //Load all the dictionaries from the datatables
            loader.Load();

            returnStatus.Result = L2FL_GAPIAFLRFA_1238_raw.Convert(results).FirstOrDefault();

            return(returnStatus);
        }