private static void SetConnectionMappings() { HttpContext.Current.Items["ConnectionMappingContexts"] = ArchiveSettings.GetConfig().ConnectionMappings.CreateConnectionMappingContexts(); ArchiveContext.Current.InArchiveMode = true; }
private void context_PreRequestHandlerExecute(object sender, EventArgs e) { string resourceID = HttpContext.Current.Request.QueryString["resourceID"]; string materialID = HttpContext.Current.Request.QueryString["materialID"]; if (string.Compare(HttpContext.Current.Request.RequestType, "GET", true) == 0) { ArchiveSettings settings = ArchiveSettings.GetConfig(); if (string.IsNullOrEmpty(resourceID) == false) { if (HttpContext.Current.Request.QueryString["isNew"] == null) { if (settings.AutoRedirectToArchiveDB) { if (OriginalDataExists(resourceID) == false) { SetConnectionMappings(); } } } } if (materialID.IsNotEmpty() && ArchiveContext.Current.InArchiveMode == false) { if (OriginalMaterialContentExists(materialID) == false) { SetConnectionMappings(); } } HttpContext.Current.Items["AppPathMappingContexts"] = settings.AppPathMappings.CreateAppPathMappingContexts(); } }
protected void archiveProcess_ExecuteStep(object data) { ArchiveBasicInfo info = new ArchiveBasicInfo(); info.ResourceID = (string)data; IArchiveExecutor executor = ArchiveSettings.GetConfig().GetFactory().GetArchiveExecutor(info); executor.Archive(info); }
protected void btnQueryHistory_Click(object sender, EventArgs e) { DbConnectionMappingContext.ClearAllMappings(); ArchiveSettings.GetConfig().ConnectionMappings.CreateConnectionMappingContexts(); queryHistoryFlag.Value = "QueryHistory"; ExecQuery(); }
protected void Page_Load(object sender, EventArgs e) { bindingControl.Data = QueryCondition; //Note:讨论完成后在同一修改 this.GridViewFormQuery.PageSize = UserSettings.GetSettings(DeluxeIdentity.CurrentUser.ID).GetPropertyValue("CommonSettings", "ToDoListPageSize", GridViewFormQuery.PageSize); if (this.queryHistoryFlag.Value == "QueryHistory") { ArchiveSettings.GetConfig().ConnectionMappings.CreateConnectionMappingContexts(); } }
protected override void OnPreRender(EventArgs e) { archiveBtn.Visible = ArchiveSettings.GetConfig().Enabled; btnQueryHistory.Visible = ArchiveSettings.GetConfig().Enabled; this.GridViewFormQuery.DataBind(); if (queryHistoryFlag.Value == "QueryHistory") { showHistoryFlag.Text = "历史库中的内容"; } else { showHistoryFlag.Text = string.Empty; } base.OnPreRender(e); }