Example #1
0
        public UserProfileResponse RetrieveAllUserProfiles(UserProfileRequest obj)
        {
            UserProfileResponse result = new UserProfileResponse();

            DbConnectionHandler dbConnectionHandler = new DbConnectionHandler();
            DbConnection        dbConnection        = dbConnectionHandler.GetSqlConnection(obj.ConnString);
            SqlTransaction      transaction         = null;

            try
            {
                dbConnectionHandler.OpenDbConnection(dbConnection);
                transaction = (SqlTransaction)dbConnection.BeginTransaction();

                UserProfileBL userProfileBL = new UserProfileBL();
                result.UserProfileList = userProfileBL.RetrieveAllUserProfiles(obj.UserProfileType, dbConnection, transaction);
            }
            catch (Exception ex)
            {
                AppLog.GetAppLog().Log("Error: occurred in retrieving from query RetriveAllUserProfiles.");
                AppLog.GetAppLog().Log(ex.ToString());
                AppLog.GetAppLog().HasError = true;
                throw ex;
            }
            finally
            {
                dbConnectionHandler.CloseDbConnection(dbConnection);
            }
            return(result);
        }
Example #2
0
 public MyClass(DbConnectionHandler dbhandler)
 {
     _dbHandler = dbhandler;
 }