Commits

Anton Afanasyev committed 846e6e8

Files, code, and comments cleanup
Some fixes to the code to make sure it builds.

Comments (0)

Files changed (17)

CS/Components/FeatureController.cs

 
 namespace $NameSpace$$safeprojectname$.Components
 {
-
-	/// -----------------------------------------------------------------------------
-	/// <summary>
-	/// The Controller class for $safeprojectname$
+    /// <summary>
+    /// The Controller class for $safeprojectname$
     /// 
     /// The FeatureController class is defined as the BusinessController in the manifest file (.dnn)
     /// DotNetNuke will poll this class to find out which Interfaces the class implements. 
     /// process for a module.
     /// 
     /// Below you will find stubbed out implementations of each, uncomment and populate with your own data
-	/// </summary>
-	/// -----------------------------------------------------------------------------
-    
-	//uncomment the interfaces to add the support.
+    /// </summary>
     public class FeatureController : ISearchable, IPortable, IUpgradeable
-	{
+    {
+        #region Public Methods
 
-        #region "Public Methods"
-
-        /// ----------------------------------------------------------------------------- 
-        /// <summary> 
-        /// gets an object from the database 
-        /// </summary> 
-        /// <remarks> 
-        /// </remarks> 
-        /// <param name="ModuleId">The Id of the module</param> 
-        /// <history> 
-        /// </history> 
-        /// ----------------------------------------------------------------------------- 
+        /// <summary>
+        /// Gets an object from the database
+        /// </summary>
+        /// <param name="ModuleId">The Id of the module</param>
         public List<$safeprojectname$Info> GetItems(int ModuleId)
         {
-
             return CBO.FillCollection<$safeprojectname$Info>(DataProvider.Instance().GetItems(ModuleId));
-
         }
 
-        /// ----------------------------------------------------------------------------- 
-        /// <summary> 
-        /// gets an object from the database 
-        /// </summary> 
-        /// <remarks> 
-        /// </remarks> 
-        /// <param name="ModuleId">The Id of the module</param> 
-        /// <param name="ItemId">The Id of the item</param> 
-        /// <history> 
-        /// </history> 
-        /// ----------------------------------------------------------------------------- 
+        /// <summary>
+        /// Gets an object from the database
+        /// </summary>
+        /// <param name="ModuleId">The Id of the module</param>
+        /// <param name="ItemId">The Id of the item</param>
         public $safeprojectname$Info GetItem(int ModuleId, int ItemId)
         {
-
             return ($safeprojectname$Info)CBO.FillObject(DataProvider.Instance().GetItem(ModuleId, ItemId), typeof($safeprojectname$Info));
-
         }
 
-        /// ----------------------------------------------------------------------------- 
-        /// <summary> 
-        /// adds an object to the database 
-        /// </summary> 
-        /// <remarks> 
-        /// </remarks> 
-        /// <param name="obj$safeprojectname$">The $safeprojectname$Info object</param> 
-        /// <history> 
-        /// </history> 
-        /// ----------------------------------------------------------------------------- 
+        /// <summary>
+        /// Adds an object to the database
+        /// </summary>
+        /// <param name="obj$safeprojectname$">The $safeprojectname$Info object</param>
         public void AddItem($safeprojectname$Info obj$safeprojectname$)
         {
-
             if (obj$safeprojectname$.Content.Trim() != "")
             {
                 DataProvider.Instance().AddItem(obj$safeprojectname$.ModuleId, obj$safeprojectname$.Content, obj$safeprojectname$.CreatedByUser);
             }
-
         }
 
-        /// ----------------------------------------------------------------------------- 
-        /// <summary> 
-        /// saves an object to the database 
-        /// </summary> 
-        /// <remarks> 
-        /// </remarks> 
-        /// <param name="obj$safeprojectname$">The $safeprojectname$Info object</param> 
-        /// <history> 
-        /// </history> 
-        /// ----------------------------------------------------------------------------- 
+        /// <summary>
+        /// Saves an object to the database
+        /// </summary>
+        /// <param name="obj$safeprojectname$">The $safeprojectname$Info object</param>
         public void UpdateItem($safeprojectname$Info obj$safeprojectname$)
         {
-
             if (obj$safeprojectname$.Content.Trim() != "")
             {
                 DataProvider.Instance().UpdateItem(obj$safeprojectname$.ModuleId, obj$safeprojectname$.ItemId, obj$safeprojectname$.Content, obj$safeprojectname$.CreatedByUser);
             }
-
         }
 
-        /// ----------------------------------------------------------------------------- 
-        /// <summary> 
-        /// deletes an object from the database 
-        /// </summary> 
-        /// <remarks> 
-        /// </remarks> 
-        /// <param name="ModuleId">The Id of the module</param> 
-        /// <param name="ItemId">The Id of the item</param> 
-        /// <history> 
-        /// </history> 
-        /// ----------------------------------------------------------------------------- 
+        /// <summary>
+        /// deletes an object from the database
+        /// </summary>
+        /// <param name="ModuleId">The Id of the module</param>
+        /// <param name="ItemId">The Id of the item</param>
         public void DeleteItem(int ModuleId, int ItemId)
         {
-
             DataProvider.Instance().DeleteItem(ModuleId, ItemId);
-
         }
 
         #endregion
-	
-	#region Optional Interfaces
+    
+        #region Optional Interfaces
 
-		/// -----------------------------------------------------------------------------
-		/// <summary>
-		/// GetSearchItems implements the ISearchable Interface
-		/// </summary>
-		/// <param name="ModInfo">The ModuleInfo for the module to be Indexed</param>
-		/// -----------------------------------------------------------------------------
-		public DotNetNuke.Services.Search.SearchItemInfoCollection GetSearchItems(DotNetNuke.Entities.Modules.ModuleInfo ModInfo)
-		{
-			SearchItemInfoCollection SearchItemCollection = new SearchItemInfoCollection();
+        /// -----------------------------------------------------------------------------
+        /// <summary>
+        /// GetSearchItems implements the ISearchable Interface
+        /// </summary>
+        /// <param name="ModInfo">The ModuleInfo for the module to be Indexed</param>
+        public DotNetNuke.Services.Search.SearchItemInfoCollection GetSearchItems(DotNetNuke.Entities.Modules.ModuleInfo ModInfo)
+        {
+            SearchItemInfoCollection SearchItemCollection = new SearchItemInfoCollection();
 
-			List<$safeprojectname$Info> col$safeprojectname$s = Get$safeprojectname$s(ModInfo.ModuleID);
+            List<$safeprojectname$Info> col$safeprojectname$s = Get$safeprojectname$s(ModInfo.ModuleID);
 
-			foreach ($safeprojectname$Info obj$safeprojectname$ in col$safeprojectname$s)
-			{
-			    SearchItemInfo SearchItem = new SearchItemInfo(ModInfo.ModuleTitle, obj$safeprojectname$.Content, obj$safeprojectname$.CreatedByUser, obj$safeprojectname$.CreatedDate, ModInfo.ModuleID, obj$safeprojectname$.ItemId.ToString(), obj$safeprojectname$.Content, "ItemId=" + obj$safeprojectname$.ItemId.ToString());
-			    SearchItemCollection.Add(SearchItem);
-			}
+            foreach ($safeprojectname$Info obj$safeprojectname$ in col$safeprojectname$s)
+            {
+                SearchItemInfo SearchItem = new SearchItemInfo(ModInfo.ModuleTitle, obj$safeprojectname$.Content, obj$safeprojectname$.CreatedByUser, obj$safeprojectname$.CreatedDate, ModInfo.ModuleID, obj$safeprojectname$.ItemId.ToString(), obj$safeprojectname$.Content, "ItemId=" + obj$safeprojectname$.ItemId.ToString());
+                SearchItemCollection.Add(SearchItem);
+            }
 
-			return SearchItemCollection;
+            return SearchItemCollection;
+        }
 
-			throw new System.NotImplementedException("The method or operation is not implemented.");
-		}
+        /// <summary>
+        /// ExportModule implements the IPortable ExportModule Interface
+        /// </summary>
+        /// <param name="ModuleID">The Id of the module to be exported</param>
+        public string ExportModule(int ModuleID)
+        {
+            string strXML = "";
 
-		/// -----------------------------------------------------------------------------
-		/// <summary>
-		/// ExportModule implements the IPortable ExportModule Interface
-		/// </summary>
-		/// <param name="ModuleID">The Id of the module to be exported</param>
-		/// -----------------------------------------------------------------------------
-		public string ExportModule(int ModuleID)
-		{
-			string strXML = "";
+            List<$safeprojectname$Info> col$safeprojectname$s = Get$safeprojectname$s(ModuleID);
+            if (col$safeprojectname$s.Count != 0)
+            {
+                strXML += "<$safeprojectname$s>";
 
-			List<$safeprojectname$Info> col$safeprojectname$s = Get$safeprojectname$s(ModuleID);
-			if (col$safeprojectname$s.Count != 0)
-			{
-			    strXML += "<$safeprojectname$s>";
+                foreach ($safeprojectname$Info obj$safeprojectname$ in col$safeprojectname$s)
+                {
+                    strXML += "<$safeprojectname$>";
+                    strXML += "<content>" + DotNetNuke.Common.Utilities.XmlUtils.XMLEncode(obj$safeprojectname$.Content) + "</content>";
+                    strXML += "</$safeprojectname$>";
+                }
+                strXML += "</$safeprojectname$s>";
+            }
 
-			    foreach ($safeprojectname$Info obj$safeprojectname$ in col$safeprojectname$s)
-			    {
-			        strXML += "<$safeprojectname$>";
-			        strXML += "<content>" + DotNetNuke.Common.Utilities.XmlUtils.XMLEncode(obj$safeprojectname$.Content) + "</content>";
-			        strXML += "</$safeprojectname$>";
-			    }
-			    strXML += "</$safeprojectname$s>";
-			}
+            return strXML;
+        }
 
-			return strXML;
+        /// <summary>
+        /// ImportModule implements the IPortable ImportModule Interface
+        /// </summary>
+        /// <param name="ModuleID">The Id of the module to be imported</param>
+        /// <param name="Content">The content to be imported</param>
+        /// <param name="Version">The version of the module to be imported</param>
+        /// <param name="UserId">The Id of the user performing the import</param>
+        public void ImportModule(int ModuleID, string Content, string Version, int UserID)
+        {
+            XmlNode xml$safeprojectname$s = DotNetNuke.Common.Globals.GetContent(Content, "$safeprojectname$s");
+            foreach (XmlNode xml$safeprojectname$ in xml$safeprojectname$s.SelectNodes("$safeprojectname$"))
+            {
+                $safeprojectname$Info obj$safeprojectname$ = new $safeprojectname$Info();
+                obj$safeprojectname$.ModuleId = ModuleID;
+                obj$safeprojectname$.Content = xml$safeprojectname$.SelectSingleNode("content").InnerText;
+                obj$safeprojectname$.CreatedByUser = UserID;
+                Add$safeprojectname$(obj$safeprojectname$);
+            }
+        }
 
-			throw new System.NotImplementedException("The method or operation is not implemented.");
-		}
+        /// <summary>
+        /// UpgradeModule implements the IUpgradeable Interface
+        /// </summary>
+        /// <param name="Version">The current version of the module</param>
+        public string UpgradeModule(string Version)
+        {
+            throw new System.NotImplementedException("The method or operation is not implemented.");
+        }
 
-		/// -----------------------------------------------------------------------------
-		/// <summary>
-		/// ImportModule implements the IPortable ImportModule Interface
-		/// </summary>
-		/// <param name="ModuleID">The Id of the module to be imported</param>
-		/// <param name="Content">The content to be imported</param>
-		/// <param name="Version">The version of the module to be imported</param>
-		/// <param name="UserId">The Id of the user performing the import</param>
-		/// -----------------------------------------------------------------------------
-		public void ImportModule(int ModuleID, string Content, string Version, int UserID)
-		{
-			XmlNode xml$safeprojectname$s = DotNetNuke.Common.Globals.GetContent(Content, "$safeprojectname$s");
-			foreach (XmlNode xml$safeprojectname$ in xml$safeprojectname$s.SelectNodes("$safeprojectname$"))
-			{
-			    $safeprojectname$Info obj$safeprojectname$ = new $safeprojectname$Info();
-			    obj$safeprojectname$.ModuleId = ModuleID;
-			    obj$safeprojectname$.Content = xml$safeprojectname$.SelectSingleNode("content").InnerText;
-			    obj$safeprojectname$.CreatedByUser = UserID;
-			    Add$safeprojectname$(obj$safeprojectname$);
-			}
-
-			throw new System.NotImplementedException("The method or operation is not implemented.");
-		}
-
-		/// -----------------------------------------------------------------------------
-		/// <summary>
-		/// UpgradeModule implements the IUpgradeable Interface
-		/// </summary>
-		/// <param name="Version">The current version of the module</param>
-		/// -----------------------------------------------------------------------------
-		public string UpgradeModule(string Version)
-		{
-			throw new System.NotImplementedException("The method or operation is not implemented.");
-		}
-
-	#endregion
-
-	}
-
+        #endregion
+    }
 }

CS/Components/ModuleNameInfo.cs

+/*
+' Copyright (c) $CopyrightYear$ $YourCompany$
+'  All rights reserved.
+' 
+' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+' DEALINGS IN THE SOFTWARE.
+' 
+*/
+
+using System;
+using System.Configuration;
+using System.Data;
+
+namespace $NameSpace$$safeprojectname$.Components
+{
+    public class $safeprojectname$Info
+    {
+        #region ctor
+        public $safeprojectname$Info()
+        {
+        }
+        
+        #endregion
+
+        #region Public properties
+
+        public int ModuleId
+        {
+            get;
+            set;
+        }
+
+        public int ItemId
+        {
+            get;
+            set;
+        }
+
+        public string Content
+        {
+            get;
+            set
+        }
+
+        public int CreatedByUser
+        {
+            get;
+            set;
+        }
+
+        public DateTime CreatedDate
+        {
+            get;
+            set;
+        }
+
+        public string CreatedByUserName
+        {
+            get;
+            set;
+        }
+
+        #endregion
+    }
+}

CS/Data/DataProvider.cs

 
 namespace $NameSpace$$safeprojectname$.Data
 {
-
-	/// -----------------------------------------------------------------------------
-	/// <summary>
-	/// An abstract class for the data access layer
+    /// <summary>
+    /// An abstract class for the data access layer
     /// 
     /// The abstract data provider provides the methods that a control data provider (sqldataprovider)
     /// must implement. You'll find two commented out examples in the Abstract methods region below.
-	/// </summary>
-	/// -----------------------------------------------------------------------------
-	public abstract class DataProvider
-	{
+    /// </summary>
+    public abstract class DataProvider
+    {
 
-	#region Shared/Static Methods
+        #region Shared/Static Methods
 
         /// <summary>
-        /// singleton reference to the instantiated object 
+        /// Singleton reference to the instantiated object 
         /// </summary>
         private static DataProvider provider_;
 
         {
             CreateProvider();
         }
-		
+        
         /// <summary>
-        /// dynamically create provider 
+        /// Dynamically create the provider 
         /// </summary>
         private static void CreateProvider()
         {
             //objProvider = (DataProvider)DotNetNuke.Framework.Reflection.CreateObject("data", "$YourCompany$.Modules.$safeprojectname$", "");
-            if (provider == null)
+            if (provider_ == null)
             {
                 const string assembly = "$NameSpace$$safeprojectname$.Data.SqlDataprovider,$safeprojectname$";
                 Type objectType = Type.GetType(assembly, true, true);
 
-                provider = (DataProvider)Activator.CreateInstance(objectType);
-                DataCache.SetCache(objectType.FullName, provider);
+                provider_ = (DataProvider)Activator.CreateInstance(objectType);
+                DataCache.SetCache(objectType.FullName, provider_);
             }
         }
 
-        /// <summary>
-        /// return the provider 
-        /// </summary>
-        /// <returns></returns>
         public static DataProvider Instance()
         {
             return provider_;
         public static IDbConnection GetConnection()
         {
             const string providerType = "data";
-            ProviderConfiguration _providerConfiguration = ProviderConfiguration.GetProviderConfiguration(providerType);
+            ProviderConfiguration providerConfiguration = ProviderConfiguration.GetProviderConfiguration(providerType);
 
-            Provider objProvider = ((Provider)_providerConfiguration.Providers[_providerConfiguration.DefaultProvider]);
-            string _connectionString;
+            Provider objProvider = ((Provider)providerConfiguration.Providers[providerConfiguration.DefaultProvider]);
+            string connectionString;
             if (!String.IsNullOrEmpty(objProvider.Attributes["connectionStringName"]) && !String.IsNullOrEmpty(System.Configuration.ConfigurationManager.AppSettings[objProvider.Attributes["connectionStringName"]]))
             {
-                _connectionString = System.Configuration.ConfigurationManager.AppSettings[objProvider.Attributes["connectionStringName"]];
+                connectionString = System.Configuration.ConfigurationManager.AppSettings[objProvider.Attributes["connectionStringName"]];
             }
             else
             {
-                _connectionString = objProvider.Attributes["connectionString"];
+                connectionString = objProvider.Attributes["connectionString"];
             }
 
             IDbConnection newConnection = new System.Data.SqlClient.SqlConnection();
-            newConnection.ConnectionString = _connectionString.ToString();
+            newConnection.ConnectionString = connectionString.ToString();
             newConnection.Open();
             return newConnection;
-        }	
+        }    
 
-	#endregion
+        #endregion
 
-	#region Abstract methods
+        #region Abstract methods
 
         public abstract IDataReader GetItems(int ModuleId);
         public abstract IDataReader GetItem(int ModuleId, int ItemId);
         public abstract void UpdateItem(int ModuleId, int ItemId, string Content, int UserId);
         public abstract void DeleteItem(int ModuleId, int ItemId);
 
-	#endregion
-
-	}
-
-}
+        #endregion
+    }
+}
-<%@ Control language="C#" AutoEventWireup="false"  Codebehind="Edit.ascx.cs" Inherits="$NameSpace$$safeprojectname$.Edit" %>
+<%@ Control Language="C#" AutoEventWireup="false"  CodeBehind="Edit.ascx.cs" Inherits="$NameSpace$$safeprojectname$.Edit" %>
 <%@ Register TagPrefix="dnn" TagName="Label" Src="~/controls/LabelControl.ascx" %>
 <%@ Register TagPrefix="dnn" TagName="TextEditor" Src="~/controls/TextEditor.ascx"%>
 <%@ Register TagPrefix="dnn" TagName="Audit" Src="~/controls/ModuleAuditControl.ascx" %>
 */
 
 using System;
-
 using DotNetNuke; 
 using DotNetNuke.Common;
 using DotNetNuke.Common.Utilities;
 
 namespace $NameSpace$$safeprojectname$
 {
-
-	/// -----------------------------------------------------------------------------
-	/// <summary>
-	/// The Edit$safeprojectname$ class is used to manage content
+    /// <summary>
+    /// The Edit$safeprojectname$ class is used to manage content
     /// 
     /// Typically your edit control would be used to create new content, or edit existing content within your module.
     /// The ControlKey for this control is "Edit", and is defined in the manifest (.dnn) file.
     /// 
     /// Because the control inherits from $safeprojectname$ModuleBase you have access to any custom properties
     /// defined there, as well as properties from DNN such as PortalId, ModuleId, TabId, UserId and many more.
-    /// 
-	/// </summary>
-	/// -----------------------------------------------------------------------------
-	public partial class Edit : $safeprojectname$ModuleBase
-	{
+    /// </summary>
+    public partial class Edit : $safeprojectname$ModuleBase
+    {
 
-	#region Event Handlers
+        #region Event Handlers
 
-		override protected void OnInit(EventArgs e)
-		{
-			InitializeComponent();
-			base.OnInit(e);
-		}
+        override protected void OnInit(EventArgs e)
+        {
+            InitializeComponent();
+            base.OnInit(e);
+        }
 
-		private void InitializeComponent()
-		{
-			this.Load += this.Page_Load;
-		}
+        private void InitializeComponent()
+        {
+            this.Load += this.Page_Load;
+        }
 
-		/// -----------------------------------------------------------------------------
-		/// <summary>
-		/// Page_Load runs when the control is loaded
-		/// </summary>
-		/// -----------------------------------------------------------------------------
-		private void Page_Load(object sender, System.EventArgs e)
+        private void Page_Load(object sender, System.EventArgs e)
         { 
-            try { 
+            try
+            { 
                 
                 // Determine ItemId of $safeprojectname$ to Update 
-                if ((Request.QueryString["ItemId"] != null)) { 
+                if ((Request.QueryString["ItemId"] != null))
+                { 
                     ItemId = Int32.Parse(Request.QueryString["ItemId"]); 
                 } 
                 
                 // If this is the first visit to the page, bind the role data to the datalist 
-                if (Page.IsPostBack == false) { 
+                if (Page.IsPostBack == false)
+                { 
                     
                     cmdDelete.Attributes.Add("onClick", "javascript:return confirm('" + Localization.GetString("DeleteItem") + "');"); 
                     
-                    if (!Null.IsNull(ItemId)) { 
+                    if (!Null.IsNull(ItemId))
+                    { 
                         // get content 
                         $safeprojectname$Controller obj$safeprojectname$s = new $safeprojectname$Controller(); 
                         $safeprojectname$Info obj$safeprojectname$ = obj$safeprojectname$s.Get$safeprojectname$(ModuleId, ItemId); 
-                        if ((obj$safeprojectname$ != null)) { 
+                        if ((obj$safeprojectname$ != null))
+                        { 
                             txtContent.Text = obj$safeprojectname$.Content; 
                             ctlAudit.CreatedByUser = obj$safeprojectname$.CreatedByUserName; 
                             ctlAudit.CreatedDate = obj$safeprojectname$.CreatedDate.ToString(); 
                         } 
-                        else { 
+                        else
+                        { 
                             // security violation attempt to access item not related to this Module 
                             Response.Redirect(Globals.NavigateURL(), true); 
                         } 
                     } 
-                    else { 
+                    else
+                    { 
                         cmdDelete.Visible = false; 
                         ctlAudit.Visible = false; 
                     } 
                 } 
             } 
-            
-            catch (Exception exc) { 
+            catch (Exception exc)
+            { 
                 //Module failed to load 
                 Exceptions.ProcessModuleLoadException(this, exc); 
             } 
         } 
         
-        /// ----------------------------------------------------------------------------- 
-        /// <summary> 
-        /// cmdCancel_Click runs when the cancel button is clicked 
-        /// </summary> 
-        /// <remarks> 
-        /// </remarks> 
-        /// <history> 
-        /// </history> 
-        /// ----------------------------------------------------------------------------- 
         protected void cmdCancel_Click(object sender, EventArgs e) 
         { 
-            try { 
+            try
+            { 
                 Response.Redirect(Globals.NavigateURL(), true); 
             } 
-            catch (Exception exc) { 
-                //Module failed to load 
+            catch (Exception exc)
+            { 
+                // Module failed to load 
                 Exceptions.ProcessModuleLoadException(this, exc); 
             } 
         } 
         
-        /// ----------------------------------------------------------------------------- 
-        /// <summary> 
-        /// cmdUpdate_Click runs when the update button is clicked 
-        /// </summary> 
-        /// <remarks> 
-        /// </remarks> 
-        /// <history> 
-        /// </history> 
-        /// ----------------------------------------------------------------------------- 
         protected void cmdUpdate_Click(object sender, EventArgs e) 
         { 
-            try { 
+            try
+            { 
                 $safeprojectname$Controller obj$safeprojectname$s = new $safeprojectname$Controller(); 
                 
                 $safeprojectname$Info obj$safeprojectname$ = new $safeprojectname$Info(); 
                 obj$safeprojectname$.Content = txtContent.Text; 
                 obj$safeprojectname$.CreatedByUser = this.UserId; 
                 
-                if (Null.IsNull(ItemId)) { 
+                if (Null.IsNull(ItemId))
+                { 
                     // add the content within the $safeprojectname$ table 
                     obj$safeprojectname$s.Add$safeprojectname$(obj$safeprojectname$); 
                 } 
-                else { 
+                else
+                { 
                     // update the content within the $safeprojectname$ table 
                     obj$safeprojectname$s.Update$safeprojectname$(obj$safeprojectname$); 
                 } 
                 // Redirect back to the portal home page 
                 Response.Redirect(Globals.NavigateURL(), true); 
             } 
-            catch (Exception exc) { 
-                //Module failed to load 
+            catch (Exception exc)
+            { 
+                // Module failed to load 
                 Exceptions.ProcessModuleLoadException(this, exc); 
             } 
         } 
         
-        /// ----------------------------------------------------------------------------- 
-        /// <summary> 
-        /// cmdDelete_Click runs when the delete button is clicked 
-        /// </summary> 
-        /// <remarks> 
-        /// </remarks> 
-        /// <history> 
-        /// </history> 
-        /// ----------------------------------------------------------------------------- 
         protected void cmdDelete_Click(object sender, EventArgs e) 
         { 
-            try { 
+            try
+            { 
                 // Only attempt to delete the item if it exists already 
-                if (!Null.IsNull(ItemId)) { 
+                if (!Null.IsNull(ItemId))
+                { 
                     
                     $safeprojectname$Controller obj$safeprojectname$s = new $safeprojectname$Controller(); 
                     obj$safeprojectname$s.Delete$safeprojectname$(ModuleId, ItemId); 
                 // Redirect back to the portal home page 
                 Response.Redirect(Globals.NavigateURL(), true); 
             } 
-            catch (Exception exc) { 
-                //Module failed to load 
+            catch (Exception exc)
+            { 
+                // Module failed to load 
                 Exceptions.ProcessModuleLoadException(this, exc); 
             } 
         } 
 
-	#endregion
-	}
+        #endregion
+    }
 }

CS/Edit.ascx.designer.cs

 // </auto-generated>
 //------------------------------------------------------------------------------
 
-
 namespace $NameSpace$$safeprojectname$
 {
-
-    /// <summary>
-    /// Edit$safeprojectname$ class.
-    /// </summary>
-    /// <remarks>
-    /// Auto-generated class.
-    /// </remarks>
     public partial class Edit
     {
-        /// <summary>
-        /// lblContent control.
-        /// </summary>
-        /// <remarks>
-        /// Auto-generated field.
-        /// To modify move field declaration from designer file to code-behind file.
-        /// </remarks>
         protected global::DotNetNuke.UI.UserControls.LabelControl lblContent;
-        
-        /// <summary>
-        /// txtContent control.
-        /// </summary>
-        /// <remarks>
-        /// Auto-generated field.
-        /// To modify move field declaration from designer file to code-behind file.
-        /// </remarks>
         protected global::DotNetNuke.UI.UserControls.TextEditor txtContent;
-        
-        /// <summary>
-        /// valContent control.
-        /// </summary>
-        /// <remarks>
-        /// Auto-generated field.
-        /// To modify move field declaration from designer file to code-behind file.
-        /// </remarks>
         protected global::System.Web.UI.WebControls.RequiredFieldValidator valContent;
-        
-        /// <summary>
-        /// cmdUpdate control.
-        /// </summary>
-        /// <remarks>
-        /// Auto-generated field.
-        /// To modify move field declaration from designer file to code-behind file.
-        /// </remarks>
         protected global::System.Web.UI.WebControls.LinkButton cmdUpdate;
-        
-        /// <summary>
-        /// cmdCancel control.
-        /// </summary>
-        /// <remarks>
-        /// Auto-generated field.
-        /// To modify move field declaration from designer file to code-behind file.
-        /// </remarks>
         protected global::System.Web.UI.WebControls.LinkButton cmdCancel;
-        
-        /// <summary>
-        /// cmdDelete control.
-        /// </summary>
-        /// <remarks>
-        /// Auto-generated field.
-        /// To modify move field declaration from designer file to code-behind file.
-        /// </remarks>
         protected global::System.Web.UI.WebControls.LinkButton cmdDelete;
-        
-        /// <summary>
-        /// ctlAudit control.
-        /// </summary>
-        /// <remarks>
-        /// Auto-generated field.
-        /// To modify move field declaration from designer file to code-behind file.
-        /// </remarks>
         protected global::DotNetNuke.UI.UserControls.ModuleAuditControl ctlAudit;
     }
-
-}
+}
 
 namespace $NameSpace$$safeprojectname$
 {
-
     /// <summary>
     /// This base class can be used to define custom properties for multiple controls. 
     /// An example module, DNNSimpleArticle (http://dnnsimplearticle.codeplex.com) uses this for an ArticleId
     /// 
     /// Because the class inherits from PortalModuleBase, properties like ModuleId, TabId, UserId, and others, 
-    /// are accessible to your module's controls (that inherity from $safeprojectname$ModuleBase
-    /// 
+    /// are accessible to your module's controls (that inherits from $safeprojectname$ModuleBase)
     /// </summary>
-
     public class $safeprojectname$ModuleBase : DotNetNuke.Entities.Modules.PortalModuleBase
     {
     }

CS/ModuleName.csproj.user

-<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2008">
-  <PropertyGroup>
-    <ReferencePath>C:\inetpub\wwwroot\dotnetnuke\website\bin\</ReferencePath>
-  </PropertyGroup>
-  <ProjectExtensions>
-    <VisualStudio>
-      <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
-        <WebProjectProperties>
-          <StartPageUrl>
-          </StartPageUrl>
-          <StartAction>CurrentPage</StartAction>
-          <AspNetDebugging>True</AspNetDebugging>
-          <NativeDebugging>False</NativeDebugging>
-          <SQLDebugging>False</SQLDebugging>
-          <PublishCopyOption>RunFiles</PublishCopyOption>
-          <PublishTargetLocation>
-          </PublishTargetLocation>
-          <PublishDeleteAllFiles>False</PublishDeleteAllFiles>
-          <PublishCopyAppData>True</PublishCopyAppData>
-          <ExternalProgram>
-          </ExternalProgram>
-          <StartExternalURL>
-          </StartExternalURL>
-          <StartCmdLineArguments>
-          </StartCmdLineArguments>
-          <StartWorkingDirectory>
-          </StartWorkingDirectory>
-          <EnableENC>False</EnableENC>
-        </WebProjectProperties>
-      </FlavorProperties>
-    </VisualStudio>
-  </ProjectExtensions>
-</Project>

CS/ModuleName.sln

-
-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual Studio 2008
-
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ModuleName", "ModuleName.csproj", "{AD1A58BB-FBF7-4212-BF69-F81A84652ACA}"
-	ProjectSection(WebsiteProperties) = preProject
-		Debug.AspNetCompiler.Debug = "True"
-		Release.AspNetCompiler.Debug = "False"
-	EndProjectSection
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|Any CPU = Debug|Any CPU
-		Release|Any CPU = Release|Any CPU
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{AD1A58BB-FBF7-4212-BF69-F81A84652ACA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{AD1A58BB-FBF7-4212-BF69-F81A84652ACA}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{AD1A58BB-FBF7-4212-BF69-F81A84652ACA}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{AD1A58BB-FBF7-4212-BF69-F81A84652ACA}.Release|Any CPU.Build.0 = Release|Any CPU
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal

CS/Providers/DataProviders/SqlDataProvider/SqlDataProvider.cs

 using System.Data;
 using System.Data.SqlClient;
 using Microsoft.ApplicationBlocks.Data;
-
 using DotNetNuke.Common.Utilities;
 using DotNetNuke.Framework.Providers;
 
 namespace $NameSpace$$safeprojectname$.Data
 {
-
-    /// -----------------------------------------------------------------------------
     /// <summary>
     /// SQL Server implementation of the abstract DataProvider class
     /// 
     /// 
     /// In most cases you will only modify the Public methods region below.
     /// </summary>
-    /// -----------------------------------------------------------------------------
     public class SqlDataProvider : DataProvider
     {
 
-	#region Private Members
+        #region Private Members
 
         private const string ProviderType = "data";
         private const string ModuleQualifier = "$safeprojectname$_";
 
-        private readonly ProviderConfiguration _providerConfiguration = ProviderConfiguration.GetProviderConfiguration(ProviderType);
-        private readonly string _connectionString;
-        private readonly string _providerPath;
-        private readonly string _objectQualifier;
-        private readonly string _databaseOwner;
+        private readonly ProviderConfiguration providerConfiguration_ = ProviderConfiguration.GetProviderConfiguration(ProviderType);
+        private readonly string connectionString_;
+        private readonly string providerPath_;
+        private readonly string objectQualifier_;
+        private readonly string databaseOwner_;
 
-	#endregion
+        #endregion
 
-	#region Constructors
+        #region Constructors
 
         public SqlDataProvider()
         {
             // Read the configuration specific information for this provider
-            Provider objProvider = (Provider)(_providerConfiguration.Providers[_providerConfiguration.DefaultProvider]);
+            Provider objProvider = (Provider)(providerConfiguration_.Providers[providerConfiguration_.DefaultProvider]);
 
             // Read the attributes for this provider
 
             //Get Connection string from web.config
-            _connectionString = Config.GetConnectionString();
+            connectionString_ = Config.GetConnectionString();
 
-            if (string.IsNullOrEmpty(_connectionString))
+            if (string.IsNullOrEmpty(connectionString_))
             {
                 // Use connection string specified in provider
-                _connectionString = objProvider.Attributes["connectionString"];
+                connectionString_ = objProvider.Attributes["connectionString"];
             }
 
-            _providerPath = objProvider.Attributes["providerPath"];
+            providerPath_ = objProvider.Attributes["providerPath"];
 
-            _objectQualifier = objProvider.Attributes["objectQualifier"];
-            if (!string.IsNullOrEmpty(_objectQualifier) && _objectQualifier.EndsWith("_", StringComparison.Ordinal) == false)
+            objectQualifier_ = objProvider.Attributes["objectQualifier"];
+            if (!string.IsNullOrEmpty(objectQualifier_) && objectQualifier_.EndsWith("_", StringComparison.Ordinal) == false)
             {
-                _objectQualifier += "_";
+                objectQualifier_ += "_";
             }
 
-            _databaseOwner = objProvider.Attributes["databaseOwner"];
-            if (!string.IsNullOrEmpty(_databaseOwner) && _databaseOwner.EndsWith(".", StringComparison.Ordinal) == false)
+            databaseOwner_ = objProvider.Attributes["databaseOwner"];
+            if (!string.IsNullOrEmpty(databaseOwner_) && databaseOwner_.EndsWith(".", StringComparison.Ordinal) == false)
             {
-                _databaseOwner += ".";
+                databaseOwner_ += ".";
             }
         }
 
-	#endregion
+        #endregion
 
-	#region Properties
+        #region Properties
 
         public string ConnectionString
         {
-            get { return _connectionString; }
+            get { return connectionString_; }
         }
 
         public string ProviderPath
         {
-            get { return _providerPath; }
+            get { return providerPath_; }
         }
 
         public string ObjectQualifier
         {
-            get { return _objectQualifier; }
+            get { return objectQualifier_; }
         }
 
         public string DatabaseOwner
         {
-            get { return _databaseOwner; }
+            get { return databaseOwner_; }
         }
 
+        #endregion
 
-	#endregion
-
-	#region Private Methods
+        #region Private Methods
 
         private string NamePrefix
         {
 
         private string GetFullyQualifiedName(string name)
         {
-			return NamePrefix + name;
+            return NamePrefix + name;
         }
         private static object GetNull(object Field)
         {
             return DotNetNuke.Common.Utilities.Null.GetNull(Field, DBNull.Value);
         }
 
-	#endregion
+        #endregion
 
-	#region Public Methods
+        #region Public Methods
 
-        public override IDataReader Get$safeprojectname$s(int ModuleId)
+        public override IDataReader GetItems(int ModuleId)
         {
             return (IDataReader)SqlHelper.ExecuteReader(ConnectionString, GetFullyQualifiedName("Get$safeprojectname$s"), ModuleId);
         }
 
-        public override IDataReader Get$safeprojectname$(int ModuleId, int ItemId)
+        public override IDataReader GetItem(int ModuleId, int ItemId)
         {
             return (IDataReader)SqlHelper.ExecuteReader(ConnectionString, GetFullyQualifiedName("Get$safeprojectname$"), ModuleId, ItemId);
         }
 
-        public override void Add$safeprojectname$(int ModuleId, string Content, int UserId)
+        public override void AddItem(int ModuleId, string Content, int UserId)
         {
             SqlHelper.ExecuteNonQuery(ConnectionString, GetFullyQualifiedName("Add$safeprojectname$"), ModuleId, Content, UserId);
         }
 
-        public override void Update$safeprojectname$(int ModuleId, int ItemId, string Content, int UserId)
+        public override void UpdateItem(int ModuleId, int ItemId, string Content, int UserId)
         {
             SqlHelper.ExecuteNonQuery(ConnectionString, GetFullyQualifiedName("Update$safeprojectname$"), ModuleId, ItemId, Content, UserId);
         }
 
-        public override void Delete$safeprojectname$(int ModuleId, int ItemId)
+        public override void DeleteItem(int ModuleId, int ItemId)
         {
             SqlHelper.ExecuteNonQuery(ConnectionString, GetFullyQualifiedName("Delete$safeprojectname$"), ModuleId, ItemId);
         }
 
-	#endregion
-
+        #endregion
     }
-
-}
+}
-<%@ Control Language="C#" AutoEventWireup="false" Inherits="$NameSpace$$safeprojectname$.Settings" Codebehind="Settings.ascx.cs" %>
-
-
-
-<%--
-
-<%@ Register TagName="label" TagPrefix="dnn" Src="~/controls/labelcontrol.ascx" %>
-
-	<h2 id="dnnSitePanel-BasicSettings" class="dnnFormSectionHead"><a href="" class="dnnSectionExpanded"><%=LocalizeString("BasicSettings")%></a></h2>
-	<fieldset>
-        <div class="dnnFormItem">
-            <dnn:Label ID="lblSetting1" runat="server" /> 
- 
-            <asp:TextBox ID="txtSetting1" runat="server" />
-        </div>
-        <div class="dnnFormItem">
-            <dnn:label ID="lblSetting2" runat="server" />
-            <asp:TextBox ID="txtSetting2" runat="server" />
-        </div>
-    </fieldset>
-
-
---%>
+<%@ Control Language="C#" AutoEventWireup="false" Inherits="$NameSpace$$safeprojectname$.Settings" CodeBehind="Settings.ascx.cs" %>
+<%@ Register TagPrefix="dnn" TagName="Label" Src="~/controls/LabelControl.ascx" %>
+<table cellspacing="0" cellpadding="2" border="0" summary="$safeprojectname$ Settings Design Table">
+    <tr>
+        <td class="SubHead" width="150"><dnn:label id="lblTemplate" runat="server" controlname="txtTemplate" suffix=":"></dnn:label></td>
+        <td valign="bottom" >
+            <asp:textbox id="txtTemplate" cssclass="NormalTextBox" width="390" columns="30" textmode="MultiLine" rows="10" maxlength="2000" runat="server" />
+        </td>
+    </tr>
+</table>

CS/Settings.ascx.cs

 */
 
 using System;
+using System.Web.UI;
+using DotNetNuke;
+using DotNetNuke.Entities.Modules;
 using DotNetNuke.Services.Exceptions;
-using DotNetNuke.Entities.Modules;
-
 
 namespace $NameSpace$$safeprojectname$
 {
-
-	/// -----------------------------------------------------------------------------
-	/// <summary>
-	/// The Settings class manages Module Settings
+    /// <summary>
+    /// The Settings class manages Module Settings
     /// 
     /// Typically your settings control would be used to manage settings for your module.
     /// There are two types of settings, ModuleSettings, and TabModuleSettings.
     /// 
     /// Because the control inherits from $safeprojectname$SettingsBase you have access to any custom properties
     /// defined there, as well as properties from DNN such as PortalId, ModuleId, TabId, UserId and many more.
-	/// </summary>
-	/// -----------------------------------------------------------------------------
-	public partial class Settings : $safeprojectname$SettingsBase
-	{
+    /// </summary>
+    public partial class Settings : $safeprojectname$SettingsBase
+    {
 
-    #region Base Method Implementations
+        #region Base Method Implementations
 
-		/// -----------------------------------------------------------------------------
-		/// <summary>
-		/// LoadSettings loads the settings from the Database and displays them
-		/// </summary>
-		/// -----------------------------------------------------------------------------
-		public override void LoadSettings()
-		{
-			try
-			{
-				if (Page.IsPostBack == false)
-				{
-					//Check for existing settings and use those on this page
-					//Settings["SettingName"]
+        /// <summary>
+        /// LoadSettings loads the settings from the Database and displays them
+        /// </summary>
+        public override void LoadSettings()
+        {
+            try
+            {
+                if (!Page.IsPostBack)
+                {
+                    if ((string)TabModuleSettings["template"] != "")
+                    {
+                        txtTemplate.Text = (string)TabModuleSettings["template"];
+                    }
+                }
+            }
+            catch (Exception exc)
+            {
+                // Module failed to load
+                Exceptions.ProcessModuleLoadException(this, exc);
+            }
+        }
 
-					/* uncomment to load saved settings in the text boxes
-					if(Settings.Contains("Setting1"))
-						txtSetting1.Text = Settings["Setting1"].ToString();
-			
-					if (Settings.Contains("Setting2"))
-						txtSetting2.Text = Settings["Setting2"].ToString();
-
-					*/
-
-
-
-				}
-			}
-			catch (Exception exc) //Module failed to load
-			{
-				Exceptions.ProcessModuleLoadException(this, exc);
-			}
-		}
-
-		/// -----------------------------------------------------------------------------
-		/// <summary>
-		/// UpdateSettings saves the modified settings to the Database
-		/// </summary>
-		/// -----------------------------------------------------------------------------
-		public override void UpdateSettings()
-		{
-			try
-			{
+        /// <summary>
+        /// UpdateSettings saves the modified settings to the Database
+        /// </summary>
+        public override void UpdateSettings()
+        {
+            try
+            {
                 ModuleController modules = new ModuleController();
 
-				//the following are two sample Module Settings, using the text boxes that are commented out in the ASCX file.
-                //module settings
-				//modules.UpdateModuleSetting(ModuleId, "Setting1", txtSetting1.Text);
-				//modules.UpdateModuleSetting(ModuleId, "Setting2", txtSetting2.Text);
-
-                //tab module settings
-		        //modules.UpdateTabModuleSetting(TabModuleId, "Setting1",  txtSetting1.Text);
-		        //modules.UpdateTabModuleSetting(TabModuleId, "Setting2",  txtSetting2.Text);
-			}
-			catch (Exception exc) //Module failed to load
-			{
-				Exceptions.ProcessModuleLoadException(this, exc);
-			}
-		}
+                modules.UpdateTabModuleSetting(TabModuleId, "template", txtTemplate.Text);
+            }
+            catch (Exception exc)
+            {
+                //Module failed to load
+                Exceptions.ProcessModuleLoadException(this, exc);
+            }
+        }
 
         #endregion
-
-	}
-
+    }
 }
-

CS/Settings.ascx.designer.cs

 // </auto-generated>
 //------------------------------------------------------------------------------
 
-
 namespace $NameSpace$$safeprojectname$
 {
-
-    /// <summary>
-    /// Settings class.
-    /// </summary>
-    /// <remarks>
-    /// Auto-generated class.
-    /// </remarks>
     public partial class Settings
     {
-
+        protected global::DotNetNuke.UI.UserControls.LabelControl lblTemplate;
+        protected global::System.Web.UI.WebControls.TextBox txtTemplate;
     }
-
 }

CS/SettingsBase.cs

 
 namespace $NameSpace$$safeprojectname$
 {
-
     /// <summary>
     /// This base class can be used to define custom properties for multiple controls. 
     /// An example module, DNNSimpleArticle (http://dnnsimplearticle.codeplex.com) uses this for an ArticleId
     /// are accessible to your module's controls (that inherity from $safeprojectname$SettingsBase
     /// 
     /// </summary>
-
-
     public class $safeprojectname$SettingsBase : ModuleSettingsBase
-    {	
-
+    {
     }
-
 }
-<%@ Control language="C#" Inherits="$NameSpace$$safeprojectname$.View" AutoEventWireup="false"  Codebehind="View.ascx.cs" %>
+<%@ Control Language="C#" Inherits="$NameSpace$$safeprojectname$.View" AutoEventWireup="false"  CodeBehind="View.ascx.cs" %>
+<asp:DataList ID="lstContent" DataKeyField="ItemID" runat="server" CellPadding="4"
+    OnItemDataBound="lstContent_ItemDataBound">
+    <ItemTemplate>
+        <table cellpadding="4" width="100%">
+            <tr>
+                <td valign="top" width="100%" align="left">
+                    <asp:HyperLink ID="HyperLink1" NavigateUrl='<%# EditUrl("ItemID",DataBinder.Eval(Container.DataItem,"ItemID").ToString()) %>'
+                        Visible="<%# IsEditable %>" runat="server">
+                        <asp:Image ID="Image1" runat="server" ImageUrl="~/images/edit.gif" AlternateText="Edit"
+                            Visible="<%#IsEditable%>" resourcekey="Edit" /></asp:HyperLink>
+                    <asp:Label ID="lblContent" runat="server" CssClass="Normal" />
+                </td>
+            </tr>
+        </table>
+    </ItemTemplate>
+</asp:DataList>
 */
 
 using System;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+using System.Collections;
+using System.Collections.Generic;
+using System.Reflection;
+
+using DotNetNuke;
+using DotNetNuke.Common.Utilities;
+using DotNetNuke.Security;
 using DotNetNuke.Services.Exceptions;
+using DotNetNuke.Services.Localization;
 using DotNetNuke.Entities.Modules;
 using DotNetNuke.Entities.Modules.Actions;
-using DotNetNuke.Services.Localization;
-using DotNetNuke.Security;
-
 
 namespace $NameSpace$$safeprojectname$
 {
-
-	/// -----------------------------------------------------------------------------
-	/// <summary>
-	/// The View class displays the content
+    /// <summary>
+    /// The View class displays the content
     /// 
     /// Typically your view control would be used to display content or functionality in your module.
     /// 
     /// Because the control inherits from $safeprojectname$ModuleBase you have access to any custom properties
     /// defined there, as well as properties from DNN such as PortalId, ModuleId, TabId, UserId and many more.
     /// 
-	/// </summary>
-	/// -----------------------------------------------------------------------------
-	public partial class View : $safeprojectname$ModuleBase, IActionable
-	{
+    /// </summary>
+    public partial class View : $safeprojectname$ModuleBase, IActionable
+    {
 
-	#region Event Handlers
+        #region Event Handlers
 
-		override protected void OnInit(EventArgs e)
-		{
-			InitializeComponent();
-			base.OnInit(e);
-		}
+        override protected void OnInit(EventArgs e)
+        {
+            InitializeComponent();
+            base.OnInit(e);
+        }
 
-		private void InitializeComponent()
-		{
-			this.Load += new System.EventHandler(this.Page_Load);
-		}
+        private void InitializeComponent()
+        {
+            this.Load += new System.EventHandler(this.Page_Load);
+        }
 
+        private void Page_Load(object sender, System.EventArgs e)
+        {
+            try
+            {
+                $safeprojectname$Controller obj$safeprojectname$s = new $safeprojectname$Controller();
+                List<$safeprojectname$Info> col$safeprojectname$s;
 
-		/// -----------------------------------------------------------------------------
-		/// <summary>
-		/// Page_Load runs when the control is loaded
-		/// </summary>
-		/// -----------------------------------------------------------------------------
-		private void Page_Load(object sender, System.EventArgs e)
-		{
-			try
-			{
+                // get the content from the $safeprojectname$ table 
+                col$safeprojectname$s = obj$safeprojectname$s.Get$safeprojectname$s(ModuleId);
 
-			}
-			catch (Exception exc) //Module failed to load
-			{
-				Exceptions.ProcessModuleLoadException(this, exc);
-			}
-		}
+                if (col$safeprojectname$s.Count == 0)
+                {
+                    // add the content to the $safeprojectname$ table 
+                    $safeprojectname$Info obj$safeprojectname$ = new $safeprojectname$Info();
+                    obj$safeprojectname$.ModuleId = ModuleId;
+                    obj$safeprojectname$.Content = Localization.GetString("DefaultContent", LocalResourceFile);
+                    obj$safeprojectname$.CreatedByUser = this.UserId;
+                    obj$safeprojectname$s.Add$safeprojectname$(obj$safeprojectname$);
+                    // get the content from the $safeprojectname$ table 
+                    col$safeprojectname$s = obj$safeprojectname$s.Get$safeprojectname$s(ModuleId);
+                }
 
-	#endregion
-		
-	#region Optional Interfaces
+                // bind the content to the repeater 
+                lstContent.DataSource = col$safeprojectname$s;
+                lstContent.DataBind();
+            }
+            catch (Exception exc)
+            {
+                //Module failed to load 
+                Exceptions.ProcessModuleLoadException(this, exc);
+            }
+        }
 
-    public ModuleActionCollection ModuleActions
+        protected void lstContent_ItemDataBound(object sender, System.Web.UI.WebControls.DataListItemEventArgs e)
+        {
+            string strContent = "";
+
+            // add content to template 
+            if (! string.IsNullOrEmpty((string)Settings["template"]))
+            {
+                strContent = (string)Settings["template"];
+                ArrayList objProperties = CBO.GetPropertyInfo(typeof($safeprojectname$Info));
+                foreach (PropertyInfo objPropertyInfo in objProperties)
+                {
+                    strContent = strContent.Replace("[" + objPropertyInfo.Name.ToUpper() + "]", Server.HtmlDecode(DataBinder.Eval(e.Item.DataItem, objPropertyInfo.Name).ToString()));
+                }
+            }
+            else
+            {
+                strContent = DataBinder.Eval(e.Item.DataItem, "Content").ToString();
+            }
+
+            // assign the content 
+            Label lblContent = (Label)e.Item.FindControl("lblContent");
+            lblContent.Text = strContent;
+        }
+
+        #endregion
+
+        #region Optional Interfaces
+
+        /// <summary> 
+        /// Registers the module actions required for interfacing with the portal framework 
+        /// </summary> 
+        public ModuleActionCollection ModuleActions
         {
             get
             {
                 ModuleActionCollection Actions = new ModuleActionCollection();
                 Actions.Add(GetNextActionID(), Localization.GetString("EditModule", this.LocalResourceFile), "", "", "", EditUrl(), false, SecurityAccessLevel.Edit, true, false);
+                fixme
+                Actions.Add(GetNextActionID(), Localization.GetString(ModuleActionType.AddContent, this.LocalResourceFile), ModuleActionType.AddContent, "", "add.gif", EditUrl(), false, DotNetNuke.Security.SecurityAccessLevel.Edit, true, false);
                 return Actions;
             }
         }
 
-	#endregion
-
-	}
-
+        #endregion
+    }
 }

CS/View.ascx.designer.cs

 // </auto-generated>
 //------------------------------------------------------------------------------
 
-
 namespace $NameSpace$$safeprojectname$
 {
-
-    /// <summary>
-    /// View$safeprojectname$ class.
-    /// </summary>
-    /// <remarks>
-    /// Auto-generated class.
-    /// </remarks>
     public partial class View
     {
-
+        protected global::System.Web.UI.WebControls.DataList lstContent;
     }
-
 }
-