示例#1
0
        /// <summary>
        /// Handles the Click event of the btnImport control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        void btnImport_Click(object sender, EventArgs e)
        {
            Guid appId = AppContext.Current.ApplicationId;

            // start import in a new thread
            ProgressControl1.StartOperation(new System.Threading.ThreadStart(delegate { DoImport(appId); }));
        }
示例#2
0
 /// <summary>
 /// Handles the LoadComplete event of the Page control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 void Page_LoadComplete(object sender, EventArgs e)
 {
     if (String.Compare(Request.Form["__EVENTTARGET"], CommandManager.GetCurrent(this.Page).ID, false) == 0)
     {
         object objArgs = Request.Form["__EVENTARGUMENT"];
         if (objArgs != null)
         {
             Dictionary <string, object> cmd = new System.Web.Script.Serialization.JavaScriptSerializer().DeserializeObject(objArgs.ToString()) as Dictionary <string, object>;
             if (cmd != null && cmd.Count > 1)
             {
                 object cmdName = cmd[_CommandName];
                 if (String.Compare((string)cmdName, _DoImportCommand, true) == 0)
                 {
                     // process move command
                     Dictionary <string, object> args = cmd[_CommandArguments] as Dictionary <string, object>;
                     if (args != null)
                     {
                         // start import in a new thread
                         string siteId = (string)args["SiteId"];
                         Guid   appId  = GetCurrentApplicationId();
                         ProgressControl1.StartOperation(new System.Threading.ThreadStart(delegate { DoImport(new Guid(siteId), appId); }));
                     }
                 }
             }
         }
     }
 }
示例#3
0
        /// <summary>
        /// Handles the Click event of the btnImport control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        void btnImport_Click(object sender, EventArgs e)
        {
            string filePath        = FilesControl.GetSelectedFilePath();
            string mappingFilePath = MappingFilesControl.GetSelectedFilePath();

            if (String.IsNullOrEmpty(filePath))
            {
                DisplayErrorMessage("No data file selected.");
                return;
            }
            else
            {
                SelectedFilePath = filePath;
            }

            if (String.IsNullOrEmpty(mappingFilePath))
            {
                DisplayErrorMessage("No mapping file selected.");
                return;
            }
            else
            {
                SelectedMappingFilePath = mappingFilePath;
            }

            if (!String.IsNullOrEmpty(ListCatalogs.SelectedValue))
            {
                Guid appId = GetCurrentApplicationId();

                // start import in a new thread
                ProgressControl1.StartOperation(new System.Threading.ThreadStart(delegate { DoImport(appId); }));
            }
        }
示例#4
0
        /// <summary>
        /// Processes the rebuild button event.
        /// </summary>
        protected void ProcessRebuildButtonEvent(bool rebuild)
        {
            _SearchManager = new Mediachase.Search.SearchManager(AppContext.Current.ApplicationName);

            // start export in a new thread
            if (rebuild)
            {
                ProgressControl1.StartOperation(new System.Threading.ThreadStart(StartIndexing));
            }
            else
            {
                ProgressControl1.StartOperation(new System.Threading.ThreadStart(StartIndexing2));
            }
        }
示例#5
0
        /// <summary>
        /// Handles the Click event of the btnImport control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        void btnImport_Click(object sender, EventArgs e)
        {
            _ImportExport = new Mediachase.Cms.ImportExport.ImportExportHelper();             //ImportExportHelper.Current;

            Guid appId = GetCurrentApplicationId();

            string filePath = SelectedFilePath;

            if (String.IsNullOrEmpty(filePath))
            {
                throw new Exception("No selected file.");
            }

            // import site
            FileStream fs = new FileStream(filePath, FileMode.Open, FileAccess.Read);

            Guid siteId = _ImportExport.GetSiteID(fs, appId);

            SiteDto sites = CMSContext.Current.GetSitesDto(appId);

            if (sites.Site.Count > 0)
            {
                CommandParameters           cp  = new CommandParameters("cmdShowDialogSiteImportConfirm");
                Dictionary <string, string> dic = new Dictionary <string, string>();

                if (!siteId.Equals(Guid.Empty))
                {
                    dic["SiteId"] = siteId.ToString();
                }
                cp.CommandArguments = dic;

                string cmd = CommandManager.GetCommandString("cmdShowDialogSiteImportConfirm", dic);
                cmd = cmd.Replace("\"", "&quot;");
                Mediachase.Ibn.Web.UI.WebControls.ClientScript.RegisterStartupScript(this.Page, this.Page.GetType(), Guid.NewGuid().ToString("N"), cmd, true);

                return;
            }

            // start import in a new thread
            ProgressControl1.StartOperation(new System.Threading.ThreadStart(delegate { DoImport(new Guid(), appId); }));
        }
示例#6
0
 /// <summary>
 /// Handles the Click event of the btnImport control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 void btnImport_Click(object sender, EventArgs e)
 {
     // start import in a new thread
     ProgressControl1.StartOperation(new System.Threading.ThreadStart(DoImport));
 }