Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0DAL+ Code example using ObjectQualifierDAL+ Code example using ObjectQualifier
Previous
 
Next
New Post
11/24/2006 6:31 PM
 

I'm just tossing this code out for anyone to use. I am working on a update to the Bill Severance version of the FotoVision module (the only version that works with DNN4) to store the data in a database rather than an .xml file. I decided to use the DAL+ and realized that in my Super-Simple Module (DAL+) tutorial I don't provide an example of handling the ObjectQualifier.

Here is the code I am using

 
Imports System
Imports System.Data
Imports System.Collections.Generic
Imports DotNetNuke

Namespace SD.DNN.Modules.FotoVisionDNN

Public Class Controller

#
Region "Private Members"
Private Const ProviderType As String = "data"
Private _providerConfiguration As Framework.Providers.ProviderConfiguration = Framework.Providers.ProviderConfiguration.GetProviderConfiguration(ProviderType)
Private _objectQualifier As String
#End Region

#Region "Constructors"
Public Sub New()
' Read the configuration specific information for this provider
Dim objProvider As Framework.Providers.Provider = CType(_providerConfiguration.Providers(_providerConfiguration.DefaultProvider), Framework.Providers.Provider)
' Read the attributes for this provider
_objectQualifier = objProvider.Attributes("objectQualifier")
If _objectQualifier <> "" And _objectQualifier.EndsWith("_") = False Then
_objectQualifier += "_"
End If
End Sub
#End Region

#Region "Properties"
Public ReadOnly Property ObjectQualifier() As String
Get
Return _objectQualifier
End Get
End Property
#End Region

Dim mySqlString As String = ""
Public Function GetFotoVisionSettings(ByVal PortalID As Integer, ByVal SettingID As String) As String
Dim FotoVisionInfo As SettingInfo = New SettingInfo()
mySqlString =
"SELECT Setting FROM " & ObjectQualifier & "FotoVisionDNN_Settings WHERE (PortalID = " & PortalID & ") AND (SettingID = '" & SettingID & "')"
Using dr As IDataReader = CType(DataProvider.Instance().ExecuteSQL(mySqlString.ToString()), IDataReader)
While dr.Read
FotoVisionInfo.Setting = Convert.ToString(dr(
"Setting"))
End While
End Using
If FotoVisionInfo.Setting Is Nothing Then
FotoVisionInfo.Setting = ""
End If
Return FotoVisionInfo.Setting
End Function

Public Sub InsertFotoVisionSettings(ByVal colFotoVisionInfo As SettingInfo)
mySqlString =
"INSERT INTO " & ObjectQualifier & "FotoVisionDNN_Settings (PortalID, SettingID, Setting) VALUES (" & colFotoVisionInfo.PortalID & ",'" & colFotoVisionInfo.SettingID & "','" & colFotoVisionInfo.Setting & "')"
DataProvider.Instance().ExecuteSQL(mySqlString.ToString())
End Sub

Public Sub UpdateFotoVisionSettings(ByVal colFotoVisionInfo As SettingInfo)
mySqlString =
"UPDATE " & ObjectQualifier & "FotoVisionDNN_Settings SET Setting = '" & colFotoVisionInfo.Setting & "' WHERE (PortalID = " & colFotoVisionInfo.PortalID & ") AND (SettingID = '" & colFotoVisionInfo.SettingID & "')"
DataProvider.Instance().ExecuteSQL(mySqlString.ToString())
End Sub

End Class
End
Namespace

When I complete the code in mid December it will be released as a free module. Bill did a lot of work on it and it finally allows you to have a picture gallery for each of the members of your site. As you can see in the code above I added the ability to indicate which Role is able to use the gallery so you could easily set up a situation where only paid members can use the gallery.

This module has a long history:

  • Orginally developed by Ralph Aveson of Vertigo Software for the MSDN Smart Client Developer Center
  • Converted to a DotNetNuke Module by Todd Davis of Seabury Design
  • Further developed by Peter Donker of Bring2Mind and Darren Neese of DotNetNuke Rocks
  • Converted to DotNetNuke 4 by Bill Severance (http://wesnetdesigns.com)
  • Converted to use a database using the DAL+ by Michael Washington (http://ADefWebserver.com)


Michael Washington
http://ADefWebserver.com
www.ADefHelpDesk.com
A Free Open Source DotNetNuke Help Desk Module
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0DAL+ Code example using ObjectQualifierDAL+ Code example using ObjectQualifier


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out