ResetModule() 공개 메소드

delete a whole table of a module.
public ResetModule ( ) : void
리턴 void
예제 #1
0
 DataSet CreateFields(IEnumerable <string> columns, UserDefinedTableController udtController)
 {
     udtController.ResetModule();
     FieldController.GetFieldsTable(ModuleId);
     foreach (var column in columns)
     {
         FieldController.AddField(ModuleId, column);
     }
     return(udtController.GetRow(-1, false));
 }
예제 #2
0
        /// <summary>
        ///   Implements the enhanced Import Interface for DotNetNuke
        /// </summary>
        public void ImportModule(int moduleId, int tabId, string content, string version, int userId, bool isInstance)
        {
            // save script timeout
            var scriptTimeOut = HttpContext.Current.Server.ScriptTimeout;

            try
            {
                // temporarily set script timeout to large value ( this value is only applicable when application is not running in Debug mode )
                HttpContext.Current.Server.ScriptTimeout = int.MaxValue;

                var udtController = new UserDefinedTableController(moduleId);
                using (var ds = new DataSet())
                {
                    var xmlNode = Globals.GetContent(content, string.Empty);
                    ds.ReadXml(new XmlNodeReader(xmlNode));
                    var modules     = new ModuleController();
                    var tabModuleId = Null.NullInteger;
                    if (tabId != Null.NullInteger)
                    {
                        var moduleInfo = modules.GetModule(moduleId, tabId);
                        tabModuleId = moduleInfo.TabModuleID;
                    }
                    if (tabModuleId != Null.NullInteger && ds.Tables[DataSetTableName.TabSettings] != null)
                    {
                        AddTabModuleSettings(modules, tabModuleId, ds);
                    }
                    if (!isInstance)
                    {
                        AddModuleSettings(moduleId, modules, ds);
                        //Fields - first delete old Fields
                        udtController.ResetModule();
                        AddFields(moduleId, ds);
                        AddData(udtController, ds);
                    }
                    if (ds.Tables.Contains(DataSetTableName.Stylesheets))
                    {
                        ImportStyleSheet(moduleId, isInstance, tabModuleId, modules, ds);
                    }
                }
            }
            finally
            {
                // reset script timeout
                HttpContext.Current.Server.ScriptTimeout = scriptTimeOut;
            }
        }
        /// <summary>
        ///   Implements the enhanced Import Interface for DotNetNuke
        /// </summary>
        public void ImportModule(int moduleId, int tabId, string content, string version, int userId, bool isInstance)
        {
            // save script timeout
            var scriptTimeOut = HttpContext.Current.Server.ScriptTimeout;

            try
            {
                // temporarily set script timeout to large value ( this value is only applicable when application is not running in Debug mode )
                HttpContext.Current.Server.ScriptTimeout = int.MaxValue;

                var udtController = new UserDefinedTableController(moduleId);
                using (var ds = new DataSet())
                {
                    var xmlNode = Globals.GetContent(content, string.Empty);
                    ds.ReadXml(new XmlNodeReader(xmlNode));
                    var modules = new ModuleController();
                    var tabModuleId = Null.NullInteger;
                    if (tabId != Null.NullInteger)
                    {
                        var moduleInfo = modules.GetModule(moduleId, tabId);
                        tabModuleId = moduleInfo.TabModuleID;
                    }
                    if (tabModuleId != Null.NullInteger && ds.Tables[DataSetTableName.TabSettings] != null)
                    {
                        AddTabModuleSettings(modules, tabModuleId, ds);
                    }
                    if (! isInstance)
                    {
                        AddModuleSettings(moduleId, modules, ds);
                        //Fields - first delete old Fields
                        udtController.ResetModule();
                        AddFields(moduleId, ds);
                        AddData(udtController, ds);
                    }
                    if (ds.Tables.Contains(DataSetTableName.Stylesheets))
                    {
                        ImportStyleSheet(moduleId, isInstance, tabModuleId, modules, ds);
                    }
                }
            }
            finally
            {
                // reset script timeout
                HttpContext.Current.Server.ScriptTimeout = scriptTimeOut;
            }
        }
  DataSet CreateFields(IEnumerable<string> columns, UserDefinedTableController udtController)
 {
     udtController.ResetModule();
     FieldController.GetFieldsTable(ModuleId );
     foreach (var column in columns)
     {
         FieldController.AddField(ModuleId, column);
     }
     return udtController.GetRow(- 1, false);
 }