DNN 模块插件开发全程详解 (一)

我今天刚开发了一个DNN插件,也是我第一次开发DNN插件,我把开发的过程描述下来,对于精通DNN的希望多多指点,对于希望涉足DNN的起到抛砖引玉的作用.

本示例以一张基本的表Department的CRUD来说明用C#制作DNN4.3插件的全过程

1:首先创建Department表   

(ModuleID,DepartmentID,DepartmentName,CreatedByUser,CreatedDate),

DepartmentID是主键

通过ModuleID建立Department表和Modules表的关系(ModuleID字段是实现模块插件的关键)

创建对应的CRUD存储过程

2:创建部门模块的内核部分

 2.1: 创建VS2005的类库项目

 2.2 添加DotNetNuke.dll 引用

  2.3 添加DepartmentInfo实体类

None.gif using  System;
None.gif
using  System.Configuration;
None.gif
using  System.Data;
None.gif
None.gif
namespace  ISS.DNN.Modules.Department
ExpandedBlockStart.gifContractedBlock.gif
dot.gif {
ExpandedSubBlockStart.gifContractedSubBlock.gif    
/**//**//**//// -----------------------------------------------------------------------------
InBlock.gif    
///<summary>
InBlock.gif    
/// The Info class for the Department
InBlock.gif    
/// </summary>
InBlock.gif    
/// <remarks>
InBlock.gif    
/// </remarks>
InBlock.gif    
/// <history>
InBlock.gif    
/// </history>
ExpandedSubBlockEnd.gif    
/// -----------------------------------------------------------------------------

InBlock.gif    public class DepartmentInfo
ExpandedSubBlockStart.gifContractedSubBlock.gif    
dot.gif{
InBlock.gif
ContractedSubBlock.gifExpandedSubBlockStart.gif    Private Members
Private Members#region Private Members
InBlock.gif
InBlock.gif        
private int _ModuleId;
InBlock.gif        
private int _DepartmentID;
InBlock.gif        
private string _DepartmentName;
InBlock.gif        
private int _CreatedByUser;
InBlock.gif        
private DateTime _CreatedDate;
InBlock.gif        
private string _CreatedByUserName;
InBlock.gif
ExpandedSubBlockEnd.gif    
#endregion

InBlock.gif
ContractedSubBlock.gifExpandedSubBlockStart.gif    Constructors
Constructors#region Constructors
InBlock.gif
InBlock.gif        
// initialization
InBlock.gif
        public DepartmentInfo()
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
ExpandedSubBlockEnd.gif        }

InBlock.gif
ExpandedSubBlockEnd.gif    
#endregion

InBlock.gif
ContractedSubBlock.gifExpandedSubBlockStart.gif    Public Methods
Public Methods#region Public Methods
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
/// Gets and sets the Module Id
ExpandedSubBlockEnd.gif        
/// </summary>

InBlock.gif        public int ModuleId
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
get
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
return _ModuleId;
ExpandedSubBlockEnd.gif            }

InBlock.gif            
set
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                _ModuleId 
= value;
ExpandedSubBlockEnd.gif            }

ExpandedSubBlockEnd.gif        }

InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
/// Gets and sets the Item Id
ExpandedSubBlockEnd.gif        
/// </summary>

InBlock.gif        public int DepartmentId
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
get
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
return _DepartmentID;
ExpandedSubBlockEnd.gif            }

InBlock.gif            
set
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                _DepartmentID 
= value;
ExpandedSubBlockEnd.gif            }

ExpandedSubBlockEnd.gif        }

InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
/// gets and sets the DepartmentName
ExpandedSubBlockEnd.gif        
/// </summary>

InBlock.gif        public string DepartmentName
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
get
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
return _DepartmentName;
ExpandedSubBlockEnd.gif            }

InBlock.gif            
set
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                _DepartmentName 
= value;
ExpandedSubBlockEnd.gif            }

ExpandedSubBlockEnd.gif        }

InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
/// Gets and sets the User Id who Created/Updated the DepartmentName
ExpandedSubBlockEnd.gif        
/// </summary>

InBlock.gif        public int CreatedByUser
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
get
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
return _CreatedByUser;
ExpandedSubBlockEnd.gif            }

InBlock.gif            
set
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                _CreatedByUser 
= value;
ExpandedSubBlockEnd.gif            }

ExpandedSubBlockEnd.gif        }

InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
/// Gets and sets the User Id who Created/Updated the DepartmentName
ExpandedSubBlockEnd.gif        
/// </summary>

InBlock.gif        public string CreatedByUserName
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
get
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
return _CreatedByUserName;
ExpandedSubBlockEnd.gif            }

InBlock.gif            
set
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                _CreatedByUserName 
= value;
ExpandedSubBlockEnd.gif            }

ExpandedSubBlockEnd.gif        }

InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
/// Gets and sets the Date when Created/Updated
ExpandedSubBlockEnd.gif        
/// </summary>

InBlock.gif        public DateTime CreatedDate
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
get
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
return _CreatedDate;
ExpandedSubBlockEnd.gif            }

InBlock.gif            
set
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                _CreatedDate 
= value;
ExpandedSubBlockEnd.gif            }

ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif
ExpandedSubBlockEnd.gif    
#endregion

InBlock.gif    
ExpandedSubBlockEnd.gif    }

ExpandedBlockEnd.gif}

None.gif

         2.4 创建DataProvider抽象类并添加一下代码

None.gif using  System;
None.gif
using  DotNetNuke;
None.gif
using  System.Data;
None.gif
None.gif
using  DotNetNuke.Framework;
None.gif
None.gif
namespace  ISS.DNN.Modules.Department
ExpandedBlockStart.gifContractedBlock.gif
dot.gif {
ExpandedSubBlockStart.gifContractedSubBlock.gif    
/**//**//**//// -----------------------------------------------------------------------------
InBlock.gif    
/// <summary>
InBlock.gif    
/// An abstract class that provides the DAL contract
InBlock.gif    
/// </summary>
InBlock.gif    
/// <remarks>
InBlock.gif    
/// </remarks>
InBlock.gif    
/// <history>
InBlock.gif    
/// </history>
ExpandedSubBlockEnd.gif    
/// -----------------------------------------------------------------------------

InBlock.gif    public abstract class DataProvider
ExpandedSubBlockStart.gifContractedSubBlock.gif    
dot.gif{
InBlock.gif
ContractedSubBlock.gifExpandedSubBlockStart.gif    Shared
/Static MethodsShared/Static Methods#region Shared/Static Methods
InBlock.gif
InBlock.gif        
// singleton reference to the instantiated object 
InBlock.gif
        static DataProvider  objProvider = null;
InBlock.gif
InBlock.gif        
// constructor
InBlock.gif
        static DataProvider()
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            CreateProvider();
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        
// dynamically create provider
InBlock.gif        
//一定要注意DataProvider的配置节department
InBlock.gif
        private static void CreateProvider()
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            objProvider 
= (DataProvider)Reflection.CreateObject("department");
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        
// return the provider
InBlock.gif
        public static  DataProvider Instance() 
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
return objProvider;
ExpandedSubBlockEnd.gif        }

InBlock.gif
ExpandedSubBlockEnd.gif    
#endregion

InBlock.gif
ContractedSubBlock.gifExpandedSubBlockStart.gif    Abstract methods
Abstract methods#region Abstract methods
InBlock.gif
InBlock.gif        
public abstract void AddDepartment(int ModuleId, string DepartmentName, int UserId);
InBlock.gif        
public abstract IDataReader GetDepartment(int ModuleId, int DepartmentID);
InBlock.gif        
public abstract IDataReader GetDepartments(int ModuleId);
InBlock.gif        
public abstract void UpdateDepartment(int ModuleId, int DepartmentID, string DepartmentName, int UserId);
InBlock.gif        
public abstract void DeleteDepartment(int ModuleId, int DepartmentID);
InBlock.gif
ExpandedSubBlockEnd.gif    
#endregion

InBlock.gif    
ExpandedSubBlockEnd.gif    }

ExpandedBlockEnd.gif}

None.gif

      2.5 创建业务控制类DepartmentController

None.gif using  System;
None.gif
using  System.Collections;
None.gif
using  System.Configuration;
None.gif
using  System.Data;
None.gif
using  System.Xml;
None.gif
using  System.Web;
None.gif
using  DotNetNuke;
None.gif
using  DotNetNuke.Common;
None.gif
using  DotNetNuke.Common.Utilities;
None.gif
using  DotNetNuke.Entities.Modules;
None.gif
using  DotNetNuke.Services.Search;
None.gif
None.gif
namespace  ISS.DNN.Modules.Department
ExpandedBlockStart.gifContractedBlock.gif
dot.gif {
ExpandedSubBlockStart.gifContractedSubBlock.gif    
/**//**//**//// -----------------------------------------------------------------------------
InBlock.gif    
///<summary>
InBlock.gif    
/// The Controller class for the Department
InBlock.gif    
/// </summary>
InBlock.gif    
/// <remarks>
InBlock.gif    
/// </remarks>
InBlock.gif    
/// <history>
InBlock.gif    
/// </history>
ExpandedSubBlockEnd.gif    
/// -----------------------------------------------------------------------------

InBlock.gif    public class DepartmentController : ISearchable, IPortable
ExpandedSubBlockStart.gifContractedSubBlock.gif    
dot.gif{
InBlock.gif
ContractedSubBlock.gifExpandedSubBlockStart.gif    Constructors
Constructors#region Constructors
InBlock.gif
InBlock.gif        
public DepartmentController()
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
ExpandedSubBlockEnd.gif        }

InBlock.gif
ExpandedSubBlockEnd.gif    
#endregion

InBlock.gif
ContractedSubBlock.gifExpandedSubBlockStart.gif    Public Methods
Public Methods#region Public Methods
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// -----------------------------------------------------------------------------
InBlock.gif        
/// <summary>
InBlock.gif        
/// adds an object to the database
InBlock.gif        
/// </summary>
InBlock.gif        
/// <remarks>
InBlock.gif        
/// </remarks>
InBlock.gif        
/// <param name="objDepartment">The DepartmentInfo object</param>
InBlock.gif        
/// <history>
InBlock.gif        
/// </history>
ExpandedSubBlockEnd.gif        
/// -----------------------------------------------------------------------------

InBlock.gif        public void AddDepartment(DepartmentInfo objDepartment)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
if (objDepartment.DepartmentName.Trim() != "")
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                DataProvider.Instance().AddDepartment(objDepartment.ModuleId, objDepartment.DepartmentName, objDepartment.CreatedByUser);
ExpandedSubBlockEnd.gif            }

ExpandedSubBlockEnd.gif        }

InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// -----------------------------------------------------------------------------
InBlock.gif        
/// <summary>
InBlock.gif        
/// deletes an object from the database
InBlock.gif        
/// </summary>
InBlock.gif        
/// <remarks>
InBlock.gif        
/// </remarks>
InBlock.gif        
/// <param name="ModuleId">The Id of the module</param>
InBlock.gif        
/// <param name="DepartmentId">The Id of the item</param>
InBlock.gif        
/// <history>
InBlock.gif        
/// </history>
ExpandedSubBlockEnd.gif        
/// -----------------------------------------------------------------------------

InBlock.gif        public void DeleteDepartment(int ModuleId, int DepartmentID) 
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            DataProvider.Instance().DeleteDepartment(ModuleId,DepartmentID);
ExpandedSubBlockEnd.gif        }

InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// -----------------------------------------------------------------------------
InBlock.gif        
/// <summary>
InBlock.gif        
/// gets an object from the database
InBlock.gif        
/// </summary>
InBlock.gif        
/// <remarks>
InBlock.gif        
/// </remarks>
InBlock.gif        
/// <param name="moduleId">The Id of the module</param>
InBlock.gif        
/// <param name="DepartmentId">The Id of the item</param>
InBlock.gif        
/// <history>
InBlock.gif        
/// </history>
ExpandedSubBlockEnd.gif        
/// -----------------------------------------------------------------------------

InBlock.gif        public DepartmentInfo GetDepartment(int ModuleId, int DepartmentID)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
return CBO.FillObject (DataProvider.Instance().GetDepartment(ModuleId, DepartmentID),typeof(DepartmentInfo)) as DepartmentInfo;
ExpandedSubBlockEnd.gif        }

InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// -----------------------------------------------------------------------------
InBlock.gif        
/// <summary>
InBlock.gif        
/// gets an object from the database
InBlock.gif        
/// </summary>
InBlock.gif        
/// <remarks>
InBlock.gif        
/// </remarks>
InBlock.gif        
/// <param name="moduleId">The Id of the module</param>
InBlock.gif        
/// <history>
InBlock.gif        
/// </history>
ExpandedSubBlockEnd.gif        
/// -----------------------------------------------------------------------------

InBlock.gif        public IList GetDepartments(int ModuleId)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
return CBO.FillCollection(DataProvider.Instance().GetDepartments(ModuleId),typeof(DepartmentInfo));
ExpandedSubBlockEnd.gif        }

InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// -----------------------------------------------------------------------------
InBlock.gif        
/// <summary>
InBlock.gif        
/// saves an object to the database
InBlock.gif        
/// </summary>
InBlock.gif        
/// <remarks>
InBlock.gif        
/// </remarks>
InBlock.gif        
/// <param name="objDepartment">The DepartmentInfo object</param>
InBlock.gif        
/// <history>
InBlock.gif        
/// </history>
ExpandedSubBlockEnd.gif        
/// -----------------------------------------------------------------------------

InBlock.gif        public void UpdateDepartment(DepartmentInfo objDepartment)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
if (objDepartment.DepartmentName.Trim() != "")
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                DataProvider.Instance().UpdateDepartment(objDepartment.ModuleId, objDepartment.DepartmentId, objDepartment.DepartmentName, objDepartment.CreatedByUser);
ExpandedSubBlockEnd.gif            }

ExpandedSubBlockEnd.gif        }

InBlock.gif
ExpandedSubBlockEnd.gif    
#endregion

InBlock.gif
ContractedSubBlock.gifExpandedSubBlockStart.gif    Optional Interfaces
Optional Interfaces#region Optional Interfaces
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// -----------------------------------------------------------------------------
InBlock.gif        
/// <summary>
InBlock.gif        
/// GetSearchItems implements the ISearchable Interface
InBlock.gif        
/// </summary>
InBlock.gif        
/// <remarks>
InBlock.gif        
/// </remarks>
InBlock.gif        
/// <param name="ModInfo">The ModuleInfo for the module to be Indexed</param>
InBlock.gif        
/// <history>
InBlock.gif        
/// </history>
ExpandedSubBlockEnd.gif        
/// -----------------------------------------------------------------------------

InBlock.gif        public SearchItemInfoCollection GetSearchItems(ModuleInfo ModInfo)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            SearchItemInfoCollection SearchItemCollection 
= new SearchItemInfoCollection();
InBlock.gif            IList colDepartments  
= GetDepartments(ModInfo.ModuleID);
InBlock.gif
InBlock.gif            
foreach (DepartmentInfo objDepartment in colDepartments)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
if(objDepartment != null)
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    SearchItemInfo SearchItem 
= new SearchItemInfo(ModInfo.ModuleTitle, objDepartment.DepartmentName, objDepartment.CreatedByUser, objDepartment.CreatedDate, ModInfo.ModuleID, objDepartment.DepartmentId.ToString(), objDepartment.DepartmentName, "DepartmentId=" + objDepartment.DepartmentId.ToString());
InBlock.gif                    SearchItemCollection.Add(SearchItem);
ExpandedSubBlockEnd.gif                }

ExpandedSubBlockEnd.gif            }

InBlock.gif
InBlock.gif            
return SearchItemCollection;
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// -----------------------------------------------------------------------------
InBlock.gif        
/// <summary>
InBlock.gif        
/// ExportModule implements the IPortable ExportModule Interface
InBlock.gif        
/// </summary>
InBlock.gif        
/// <remarks>
InBlock.gif        
/// </remarks>
InBlock.gif        
/// <param name="ModuleID">The Id of the module to be exported</param>
InBlock.gif        
/// <history>
InBlock.gif        
/// </history>
ExpandedSubBlockEnd.gif        
/// -----------------------------------------------------------------------------

InBlock.gif        public string ExportModule(int ModuleID)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
string strXML = "";
InBlock.gif            IList colDepartments  
= GetDepartments(ModuleID);
InBlock.gif
InBlock.gif            
if (colDepartments.Count != 0)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                strXML 
+= "<Departments>";
InBlock.gif                
foreach (DepartmentInfo objDepartment in colDepartments)
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    strXML 
+= "<Department>";
InBlock.gif                    strXML 
+= "<DepartmentName>" + XmlUtils.XMLEncode(objDepartment.DepartmentName) + "</DepartmentName>";
InBlock.gif                    strXML 
+= "</Department>";
ExpandedSubBlockEnd.gif                }

InBlock.gif                strXML 
+= "</Departments>";
ExpandedSubBlockEnd.gif            }

InBlock.gif
InBlock.gif            
return strXML;
ExpandedSubBlockEnd.gif        }

InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// -----------------------------------------------------------------------------
InBlock.gif        
/// <summary>
InBlock.gif        
/// ImportModule implements the IPortable ImportModule Interface
InBlock.gif        
/// </summary>
InBlock.gif        
/// <remarks>
InBlock.gif        
/// </remarks>
InBlock.gif        
/// <param name="ModuleID">The Id of the module to be imported</param>
InBlock.gif        
/// <param name="DepartmentName">The DepartmentName to be imported</param>
InBlock.gif        
/// <param name="Version">The version of the module to be imported</param>
InBlock.gif        
/// <param name="UserId">The Id of the user performing the import</param>
InBlock.gif        
/// <history>
InBlock.gif        
/// </history>
ExpandedSubBlockEnd.gif        
/// -----------------------------------------------------------------------------

InBlock.gif        public void ImportModule(int ModuleID, string DepartmentName, string Version, int UserId)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            XmlNode xmlDepartments 
= Globals.GetContent(DepartmentName, "Departments");
InBlock.gif
InBlock.gif            
foreach (XmlNode xmlDepartment in xmlDepartments.SelectNodes("Department"))
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                DepartmentInfo objDepartment 
= new DepartmentInfo();
InBlock.gif
InBlock.gif                objDepartment.ModuleId 
= ModuleID;
InBlock.gif                objDepartment.DepartmentName 
= xmlDepartment.SelectSingleNode("DepartmentName").InnerText;
InBlock.gif                objDepartment.CreatedByUser 
= UserId;
InBlock.gif                AddDepartment(objDepartment);
ExpandedSubBlockEnd.gif            }

InBlock.gif
ExpandedSubBlockEnd.gif}

InBlock.gif
ExpandedSubBlockEnd.gif    
#endregion

InBlock.gif
ExpandedSubBlockEnd.gif    }

ExpandedBlockEnd.gif}

None.gif

         2.6 创建UI 部门浏览控件ViewDepartment,这个类一定要继承PortalModuleBase,该类是DNN模块的基类也是模块插件机制的关键,提供了很多默认的实现,该类又实现了一个接口IActionable,这个接口指明该控件又哪些操作行为,本类指明了可以对Department进行添加操作

Actions.Add(this.GetNextActionID(), Localization.GetString(ModuleActionType.AddContent, this.LocalResourceFile), ModuleActionType.AddContent, "", "", this.EditUrl(), false, SecurityAccessLevel.Edit, true, false);

None.gif namespace  ISS.DNN.Modules.Department
ExpandedBlockStart.gifContractedBlock.gif
dot.gif {
InBlock.gif    
using System;
InBlock.gif    
using System.Data;
InBlock.gif    
using System.Collections;
InBlock.gif    
using System.Drawing;
InBlock.gif    
using System.Web;
InBlock.gif    
using System.Web.UI.WebControls;
InBlock.gif    
using System.Web.UI.HtmlControls;
InBlock.gif    
using System.Reflection;
InBlock.gif    
using DotNetNuke;
InBlock.gif    
using DotNetNuke.Common.Utilities;
InBlock.gif    
using DotNetNuke.Entities.Modules;
InBlock.gif    
using DotNetNuke.Entities.Modules.Actions;
InBlock.gif    
using DotNetNuke.Security;
InBlock.gif    
using DotNetNuke.Services.Exceptions;
InBlock.gif    
using DotNetNuke.Services.Localization;
InBlock.gif    
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif    
/**//**//**//// <summary>
InBlock.gif    
///        ViewDepartment 的摘要说明。
ExpandedSubBlockEnd.gif    
/// </summary>

InBlock.gif    public class ViewDepartment : PortalModuleBase, IActionable
ExpandedSubBlockStart.gifContractedSubBlock.gif    
dot.gif{
InBlock.gif        
protected System.Web.UI.WebControls.DataList lstDepartment;
InBlock.gif
InBlock.gif        
ContractedSubBlock.gifExpandedSubBlockStart.gif        Web 窗体设计器生成的代码
Web 窗体设计器生成的代码#region Web 窗体设计器生成的代码
InBlock.gif        
override protected void OnInit(EventArgs e)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
//
InBlock.gif            
// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
InBlock.gif            
//
InBlock.gif
            InitializeComponent();
InBlock.gif            
base.OnInit(e);
ExpandedSubBlockEnd.gif        }

InBlock.gif        
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
///        设计器支持所需的方法 - 不要使用代码编辑器
InBlock.gif        
///        修改此方法的内容。
ExpandedSubBlockEnd.gif        
/// </summary>

InBlock.gif        private void InitializeComponent()
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
this.Load += new System.EventHandler(this.Page_Load);
InBlock.gif
ExpandedSubBlockEnd.gif        }

ExpandedSubBlockEnd.gif        
#endregion

InBlock.gif
ContractedSubBlock.gifExpandedSubBlockStart.gif        Public Methods
Public Methods#region Public Methods
InBlock.gif
InBlock.gif        
public bool DisplayAudit()
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
bool retValue = false;
InBlock.gif
InBlock.gif            
if ((string)Settings["auditinfo"== "Y")
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                retValue 
= true;
ExpandedSubBlockEnd.gif            }

InBlock.gif
InBlock.gif            
return retValue;
ExpandedSubBlockEnd.gif        }

InBlock.gif
ExpandedSubBlockEnd.gif        
#endregion

InBlock.gif
ContractedSubBlock.gifExpandedSubBlockStart.gif        Event Handlers
Event Handlers#region Event Handlers
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// -----------------------------------------------------------------------------
InBlock.gif        
/// <summary>
InBlock.gif        
/// Page_Load runs when the control is loaded
InBlock.gif        
/// </summary>
InBlock.gif        
/// <remarks>
InBlock.gif        
/// </remarks>
InBlock.gif        
/// <history>
InBlock.gif        
/// </history>
ExpandedSubBlockEnd.gif        
/// -----------------------------------------------------------------------------

InBlock.gif        protected void Page_Load(System.Object sender, System.EventArgs e)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
try
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                DepartmentController objDepartments 
= new DepartmentController();
InBlock.gif                IList colDepartments;
InBlock.gif
InBlock.gif                
//get the content from the Department table
InBlock.gif
                colDepartments = objDepartments.GetDepartments(ModuleId);
InBlock.gif
InBlock.gif                
if (colDepartments.Count == 0)
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    
//add the content to the Department table
InBlock.gif
                    DepartmentInfo objDepartment = new DepartmentInfo();
InBlock.gif                    objDepartment.ModuleId 
= ModuleId;
InBlock.gif                    objDepartment.DepartmentName 
= Localization.GetString("DefaultContent", LocalResourceFile);
InBlock.gif                    objDepartment.CreatedByUser 
= this.UserId;
InBlock.gif                    objDepartments.AddDepartment(objDepartment);
InBlock.gif
InBlock.gif                    
//get the content from the Department table
InBlock.gif
                    colDepartments = objDepartments.GetDepartments(ModuleId);
ExpandedSubBlockEnd.gif                }

InBlock.gif
InBlock.gif                
//bind the content to the repeater
InBlock.gif
                lstDepartment.DataSource = colDepartments;
InBlock.gif                lstDepartment.DataBind();
ExpandedSubBlockEnd.gif            }

InBlock.gif            
catch (Exception exc) //Module failed to load
ExpandedSubBlockStart.gifContractedSubBlock.gif
            dot.gif{
InBlock.gif                Exceptions.ProcessModuleLoadException(
this, exc);
ExpandedSubBlockEnd.gif            }

InBlock.gif
ExpandedSubBlockEnd.gif        }

InBlock.gif
ExpandedSubBlockEnd.gif        
#endregion

InBlock.gif
ContractedSubBlock.gifExpandedSubBlockStart.gif        Optional Interfaces
Optional Interfaces#region Optional Interfaces
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// -----------------------------------------------------------------------------
InBlock.gif        
/// <summary>
InBlock.gif        
/// Registers the module actions required for interfacing with the portal framework
InBlock.gif        
/// </summary>
InBlock.gif        
/// <value></value>
InBlock.gif        
/// <returns></returns>
InBlock.gif        
/// <remarks></remarks>
InBlock.gif        
/// <history>
InBlock.gif        
/// </history>
ExpandedSubBlockEnd.gif        
/// -----------------------------------------------------------------------------

InBlock.gif        public ModuleActionCollection ModuleActions
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
get
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                ModuleActionCollection Actions 
= new ModuleActionCollection();
InBlock.gif                Actions.Add(
this.GetNextActionID(), Localization.GetString(ModuleActionType.AddContent, this.LocalResourceFile), ModuleActionType.AddContent, """"this.EditUrl(), false, SecurityAccessLevel.Edit, truefalse);
InBlock.gif                
return Actions;
ExpandedSubBlockEnd.gif            }

ExpandedSubBlockEnd.gif        }

InBlock.gif
ExpandedSubBlockEnd.gif        
#endregion

ExpandedSubBlockEnd.gif    }

ExpandedBlockEnd.gif}

None.gif

 

2.7  创建UI 部门编辑控件EditDepartment(实现CUD),该类也要继承PortalModuleBase

ContractedBlock.gif ExpandedBlockStart.gif
  1None.gifnamespace ISS.DNN.Modules.Department
  2ExpandedBlockStart.gifContractedBlock.gifdot.gif{
  3InBlock.gif    using System;
  4InBlock.gif    using System.Data;
  5InBlock.gif    using System.Drawing;
  6InBlock.gif    using System.Web;
  7InBlock.gif    using System.Web.UI.WebControls;
  8InBlock.gif    using System.Web.UI.HtmlControls;
  9InBlock.gif    using DotNetNuke;
 10InBlock.gif    using DotNetNuke.Common;
 11InBlock.gif    using DotNetNuke.Common.Utilities;
 12InBlock.gif    using DotNetNuke.Entities.Modules;
 13InBlock.gif    using DotNetNuke.Services.Exceptions;
 14InBlock.gif    using DotNetNuke.Services.Localization;
 15InBlock.gif
 16ExpandedSubBlockStart.gifContractedSubBlock.gif    /**//**//**//// <summary>
 17InBlock.gif    ///        EditDepartment 的摘要说明。
 18ExpandedSubBlockEnd.gif    /// </summary>

 19InBlock.gif    public class EditDepartment : PortalModuleBase
 20ExpandedSubBlockStart.gifContractedSubBlock.gif    dot.gif{
 21InBlock.gif        protected System.Web.UI.WebControls.RequiredFieldValidator valDepartmentName;
 22InBlock.gif        protected System.Web.UI.WebControls.LinkButton cmdUpdate;
 23InBlock.gif        protected System.Web.UI.WebControls.LinkButton cmdCancel;
 24InBlock.gif        protected System.Web.UI.WebControls.LinkButton cmdDelete;
 25InBlock.gif        protected DotNetNuke.UI.UserControls.ModuleAuditControl ctlAudit;
 26InBlock.gif        protected DotNetNuke.UI.UserControls.TextEditor txtDepartmentName;
 27InBlock.gif
 28ContractedSubBlock.gifExpandedSubBlockStart.gif        Web 窗体设计器生成的代码Web 窗体设计器生成的代码#region Web 窗体设计器生成的代码
 29InBlock.gif        override protected void OnInit(EventArgs e)
 30ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif{
 31InBlock.gif            //
 32InBlock.gif            // CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
 33InBlock.gif            //
 34InBlock.gif            InitializeComponent();
 35InBlock.gif            base.OnInit(e);
 36ExpandedSubBlockEnd.gif        }

 37InBlock.gif        
 38ExpandedSubBlockStart.gifContractedSubBlock.gif        /**//**//**//// <summary>
 39InBlock.gif        ///        设计器支持所需的方法 - 不要使用代码编辑器
 40InBlock.gif        ///        修改此方法的内容。
 41ExpandedSubBlockEnd.gif        /// </summary>

 42InBlock.gif        private void InitializeComponent()
 43ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif{
 44InBlock.gif            this.cmdUpdate.Click += new System.EventHandler(this.cmdUpdate_Click);
 45InBlock.gif            this.cmdCancel.Click += new System.EventHandler(this.cmdCancel_Click);
 46InBlock.gif            this.cmdDelete.Click += new System.EventHandler(this.cmdDelete_Click);
 47InBlock.gif            this.Load += new System.EventHandler(this.Page_Load);
 48InBlock.gif
 49ExpandedSubBlockEnd.gif        }

 50ExpandedSubBlockEnd.gif        #endregion

 51InBlock.gif
 52ContractedSubBlock.gifExpandedSubBlockStart.gif        Private MembersPrivate Members#region Private Members
 53InBlock.gif
 54InBlock.gif        private int DepartmentID = Null.NullInteger;
 55InBlock.gif
 56ExpandedSubBlockEnd.gif        #endregion

 57InBlock.gif
 58ContractedSubBlock.gifExpandedSubBlockStart.gif        Event HandlersEvent Handlers#region Event Handlers
 59InBlock.gif
 60ExpandedSubBlockStart.gifContractedSubBlock.gif        /**//**//**//// -----------------------------------------------------------------------------
 61InBlock.gif        /// <summary>
 62InBlock.gif        /// Page_Load runs when the control is loaded
 63InBlock.gif        /// </summary>
 64InBlock.gif        /// <remarks>
 65InBlock.gif        /// </remarks>
 66InBlock.gif        /// <history>
 67InBlock.gif        /// </history>
 68ExpandedSubBlockEnd.gif        /// -----------------------------------------------------------------------------

 69InBlock.gif        protected void Page_Load(System.Object sender, System.EventArgs e)
 70ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif{
 71InBlock.gif            try
 72ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif{
 73InBlock.gif                //Determine DepartmentId of Department to Update
 74InBlock.gif                if(this.Request.QueryString["DepartmentId"!=null)
 75ExpandedSubBlockStart.gifContractedSubBlock.gif                dot.gif{
 76InBlock.gif                    DepartmentID = Int32.Parse(this.Request.QueryString["DepartmentId"]);
 77ExpandedSubBlockEnd.gif                }

 78InBlock.gif
 79InBlock.gif                //If this is the first visit to the page, bind the role data to the datalist
 80InBlock.gif                if (Page.IsPostBack == false)
 81ExpandedSubBlockStart.gifContractedSubBlock.gif                dot.gif{
 82InBlock.gif                    cmdDelete.Attributes.Add("onClick""javascript:return confirm('" + Localization.GetString("DeleteItem"+ "');");
 83InBlock.gif
 84InBlock.gif                    if(DepartmentID != -1)
 85ExpandedSubBlockStart.gifContractedSubBlock.gif                    dot.gif{
 86InBlock.gif                        //get DepartmentName
 87InBlock.gif                        DepartmentController objDepartments = new DepartmentController();
 88InBlock.gif                        DepartmentInfo objDepartment = objDepartments.GetDepartment(ModuleId,DepartmentID);
 89InBlock.gif                        if (objDepartment != null)
 90ExpandedSubBlockStart.gifContractedSubBlock.gif                        dot.gif{
 91InBlock.gif                            txtDepartmentName.Text = objDepartment.DepartmentName;
 92InBlock.gif                            ctlAudit.CreatedByUser = objDepartment.CreatedByUserName;
 93InBlock.gif                            ctlAudit.CreatedDate = objDepartment.CreatedDate.ToString();
 94ExpandedSubBlockEnd.gif                        }

 95InBlock.gif                        else
 96ExpandedSubBlockStart.gifContractedSubBlock.gif                        dot.gif{
 97InBlock.gif                            Response.Redirect(Globals.NavigateURL(), true);
 98ExpandedSubBlockEnd.gif                        }

 99ExpandedSubBlockEnd.gif                    }

100InBlock.gif                    else
101ExpandedSubBlockStart.gifContractedSubBlock.gif                    dot.gif{
102InBlock.gif                        cmdDelete.Visible = false;
103InBlock.gif                        ctlAudit.Visible = false;
104ExpandedSubBlockEnd.gif                    }

105ExpandedSubBlockEnd.gif                }

106ExpandedSubBlockEnd.gif            }

107InBlock.gif            catch (Exception exc) //Module failed to load
108ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif{
109InBlock.gif                Exceptions.ProcessModuleLoadException(this, exc);
110ExpandedSubBlockEnd.gif            }

111ExpandedSubBlockEnd.gif        }

112InBlock.gif
113ExpandedSubBlockStart.gifContractedSubBlock.gif        /**//**//**//// -----------------------------------------------------------------------------
114InBlock.gif        /// <summary>
115InBlock.gif        /// cmdCancel_Click runs when the cancel button is clicked
116InBlock.gif        /// </summary>
117InBlock.gif        /// <remarks>
118InBlock.gif        /// </remarks>
119InBlock.gif        /// <history>
120InBlock.gif        /// </history>
121ExpandedSubBlockEnd.gif        /// -----------------------------------------------------------------------------

122InBlock.gif        protected void cmdCancel_Click(System.Object sender, System.EventArgs e)
123ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif{
124InBlock.gif            try
125ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif{
126InBlock.gif                this.Response.Redirect(Globals.NavigateURL(this.TabId), true);
127ExpandedSubBlockEnd.gif            }

128InBlock.gif            catch (Exception exc) //Module failed to load
129ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif{
130InBlock.gif                Exceptions.ProcessModuleLoadException(this, exc);
131ExpandedSubBlockEnd.gif            }

132ExpandedSubBlockEnd.gif        }

133InBlock.gif
134ExpandedSubBlockStart.gifContractedSubBlock.gif        /**//**//**//// -----------------------------------------------------------------------------
135InBlock.gif        /// <summary>
136InBlock.gif        /// cmdDelete_Click runs when the delete button is clicked
137InBlock.gif        /// </summary>
138InBlock.gif        /// <remarks>
139InBlock.gif        /// </remarks>
140InBlock.gif        /// <history>
141InBlock.gif        /// </history>
142ExpandedSubBlockEnd.gif        /// -----------------------------------------------------------------------------

143InBlock.gif        protected void cmdDelete_Click(System.Object sender, System.EventArgs e)
144ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif{
145InBlock.gif            try
146ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif{
147InBlock.gif                //Only attempt to delete the item if it exists already
148InBlock.gif                if (!Null.IsNull(DepartmentID))
149ExpandedSubBlockStart.gifContractedSubBlock.gif                dot.gif{
150InBlock.gif                    DepartmentController objDepartments = new DepartmentController();
151InBlock.gif                    objDepartments.DeleteDepartment(ModuleId,DepartmentID);
152ExpandedSubBlockEnd.gif                }

153InBlock.gif
154InBlock.gif                this.Response.Redirect(Globals.NavigateURL(this.TabId), true);
155ExpandedSubBlockEnd.gif            }

156InBlock.gif            catch (Exception exc) //Module failed to load
157ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif{
158InBlock.gif                Exceptions.ProcessModuleLoadException(this, exc);
159ExpandedSubBlockEnd.gif            }

160ExpandedSubBlockEnd.gif        }

161InBlock.gif
162ExpandedSubBlockStart.gifContractedSubBlock.gif        /**//**//**//// -----------------------------------------------------------------------------
163InBlock.gif        /// <summary>
164InBlock.gif        /// cmdUpdate_Click runs when the update button is clicked
165InBlock.gif        /// </summary>
166InBlock.gif        /// <remarks>
167InBlock.gif        /// </remarks>
168InBlock.gif        /// <history>
169InBlock.gif        /// </history>
170ExpandedSubBlockEnd.gif        /// -----------------------------------------------------------------------------

171InBlock.gif        protected void cmdUpdate_Click(System.Object sender, System.EventArgs e)
172ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif{
173InBlock.gif            try
174ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif{
175InBlock.gif                DepartmentController objDepartments = new DepartmentController();
176InBlock.gif                DepartmentInfo objDepartment = new DepartmentInfo();
177InBlock.gif
178InBlock.gif                objDepartment.ModuleId = ModuleId;
179InBlock.gif                objDepartment.DepartmentId = DepartmentID;
180InBlock.gif                objDepartment.DepartmentName = txtDepartmentName.Text;
181InBlock.gif                objDepartment.CreatedByUser = this.UserId;
182InBlock.gif
183InBlock.gif                //Update the DepartmentName within the Department table
184InBlock.gif                if(Null.IsNull(DepartmentID))
185ExpandedSubBlockStart.gifContractedSubBlock.gif                dot.gif{
186InBlock.gif                    objDepartments.AddDepartment(objDepartment);
187ExpandedSubBlockEnd.gif                }

188InBlock.gif                else
189ExpandedSubBlockStart.gifContractedSubBlock.gif                dot.gif{
190InBlock.gif                    objDepartments.UpdateDepartment(objDepartment);
191ExpandedSubBlockEnd.gif                }

192InBlock.gif
193InBlock.gif                //Redirect back to the portal home page
194InBlock.gif                this.Response.Redirect(Globals.NavigateURL(this.TabId), true);
195ExpandedSubBlockEnd.gif            }

196InBlock.gif            catch (Exception exc) //Module failed to load
197ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif{
198InBlock.gif                Exceptions.ProcessModuleLoadException(this, exc);
199ExpandedSubBlockEnd.gif            }

200ExpandedSubBlockEnd.gif        }

201InBlock.gif
202ExpandedSubBlockEnd.gif        #endregion

203InBlock.gif
204ExpandedSubBlockEnd.gif    }

205ExpandedBlockEnd.gif}

206None.gif

2.8 创建模块设置控件Settings,该类一定要继承ModuleSettingsBase

None.gif using  System;
None.gif
using  System.Web;
None.gif
using  System.Web.UI;
None.gif
using  System.Web.UI.WebControls;
None.gif
using  DotNetNuke;
None.gif
using  DotNetNuke.Common;
None.gif
using  DotNetNuke.Common.Utilities;
None.gif
using  DotNetNuke.Services.Localization;
None.gif
using  DotNetNuke.Services.Exceptions;
None.gif
None.gif
namespace  ISS.DNN.Modules.Department
ExpandedBlockStart.gifContractedBlock.gif
dot.gif {
InBlock.gif    
public abstract class Settings : DotNetNuke.Entities.Modules.ModuleSettingsBase
ExpandedSubBlockStart.gifContractedSubBlock.gif    
dot.gif{
ContractedSubBlock.gifExpandedSubBlockStart.gif        Web Form Designer generated code
Web Form Designer generated code#region Web Form Designer generated code
InBlock.gif        
override protected void OnInit(EventArgs e)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
//
InBlock.gif            
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
InBlock.gif            
//
InBlock.gif
            InitializeComponent();
InBlock.gif            
base.OnInit(e);
ExpandedSubBlockEnd.gif        }

InBlock.gif        
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
///        Required method for Designer support - do not modify
InBlock.gif        
///        the contents of this method with the code editor.
ExpandedSubBlockEnd.gif        
/// </summary>

InBlock.gif        private void InitializeComponent()
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif
ExpandedSubBlockEnd.gif        }

ExpandedSubBlockEnd.gif        
#endregion

InBlock.gif
InBlock.gif        
public override void LoadSettings()
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
try 
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
if (!Page.IsPostBack) 
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    
string setting1 = ((string)TabModuleSettings["settingname1"]);
InBlock.gif                    
string setting2 = ((string)Settings["settingname2"]);
ExpandedSubBlockEnd.gif                }

ExpandedSubBlockEnd.gif            }
 
InBlock.gif            
catch (Exception exc) 
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                Exceptions.ProcessModuleLoadException(
this, exc);
ExpandedSubBlockEnd.gif            }

ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        
public override void UpdateSettings()
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
try 
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                DotNetNuke.Entities.Modules.ModuleController objModules 
= new DotNetNuke.Entities.Modules.ModuleController();
InBlock.gif                objModules.UpdateTabModuleSetting(TabModuleId, 
"settingname1""value");
InBlock.gif                objModules.UpdateModuleSetting(ModuleId, 
"settingname2""value");
InBlock.gif                Response.Redirect(Globals.NavigateURL(), 
true);
ExpandedSubBlockEnd.gif            }
 
InBlock.gif            
catch (Exception exc) 
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                Exceptions.ProcessModuleLoadException(
this, exc);
ExpandedSubBlockEnd.gif            }

ExpandedSubBlockEnd.gif        }

ExpandedSubBlockEnd.gif    }

ExpandedBlockEnd.gif}

None.gif

 

OK,现在已经完成了系统的关键开发了,编译项目生成ISS.DNN.Modules.Department.dll,下一篇介绍SqlDataProvider的开发,UI界面的开发,以及安装包的制作!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值