private void LoadContents() { try { if(Request.QueryString["content"]!=null) Session[this.ToString() + ":ContentType"]=Request.QueryString["content"]; Session[this.ToString() + ":ReportsType"]=int.Parse(Request.QueryString["rpttype"]); } catch { //do nothing } if(Session[this.ToString() + ":ContentType"]==null) _contentType="List"; else _contentType=(string)Session[this.ToString() + ":ContentType"]; // reports type if(Session[this.ToString() + ":ReportsType"]==null) _reportsType=-1; else _reportsType=(int)Session[this.ToString() + ":ReportsType"]; if(_contentType=="Dispatch") { _dispControl = (FI.UI.Web.ReportDistributionControl)Page.LoadControl("ReportDistributionControl.ascx"); _dispControl._user=this._user; _dispControl.ID="DispC"; this.ContentsPanel.Controls.Add(_dispControl); } else if(_contentType=="DispatchLog") { _dispLogControl = (FI.UI.Web.ReportDistributionLogControl)Page.LoadControl("ReportDistributionLogControl.ascx"); _dispLogControl._user=this._user; _dispLogControl.ID="DispLogC"; this.ContentsPanel.Controls.Add(_dispLogControl); } else if(_contentType=="Export") { _exportControl = (FI.UI.Web.ReportExportControl)Page.LoadControl("ReportExportControl.ascx"); _exportControl._user=this._user; _exportControl.ID="ExpC"; this.ContentsPanel.Controls.Add(_exportControl); } else if(_contentType=="Delete") { _deleteControl = (FI.UI.Web.ReportDeleteControl)Page.LoadControl("ReportDeleteControl.ascx"); _deleteControl._user=this._user; _deleteControl.ID="DelC"; this.ContentsPanel.Controls.Add(_deleteControl); } else if(_contentType=="Copy") { _copyControl = (FI.UI.Web.ReportCopyControl)Page.LoadControl("ReportCopyControl.ascx"); _copyControl._user=this._user; _copyControl.ID="CopyC"; this.ContentsPanel.Controls.Add(_copyControl); } else if(_contentType=="Sharing") { _sharingControl = (FI.UI.Web.ReportSharingControl)Page.LoadControl("ReportSharingControl.ascx"); _sharingControl._user=this._user; _sharingControl.ID="SharingC"; this.ContentsPanel.Controls.Add(_sharingControl); } else if(_contentType=="Save") { _saveControl = (FI.UI.Web.ReportSaveControl)Page.LoadControl("ReportSaveControl.ascx"); _saveControl._user=this._user; _saveControl.ID="SaveC"; this.ContentsPanel.Controls.Add(_saveControl); } else if(_contentType=="Load") { if(this._reportsType==_user.ReportSystem.GetReportTypeCode(typeof(FI.BusinessObjects.OlapReport))) { FI.UI.Web.OlapReport.OlapReportLoadControl loadControl = (FI.UI.Web.OlapReport.OlapReportLoadControl)Page.LoadControl("OlapReport/OlapReportLoadControl.ascx"); loadControl._user=this._user; loadControl.ID="LoadC"; this.ContentsPanel.Controls.Add(loadControl); } else if(this._reportsType==_user.ReportSystem.GetReportTypeCode(typeof(FI.BusinessObjects.CustomSqlReport))) { FI.UI.Web.SqlReport.SqlReportLoadControl loadControl = (FI.UI.Web.SqlReport.SqlReportLoadControl)Page.LoadControl("SqlReport/SqlReportLoadControl.ascx"); loadControl._user=this._user; loadControl.ID="LoadC"; this.ContentsPanel.Controls.Add(loadControl); } else if(this._reportsType==_user.ReportSystem.GetReportTypeCode(typeof(FI.BusinessObjects.CustomMdxReport))) { FI.UI.Web.MdxReport.MdxReportLoadControl loadControl = (FI.UI.Web.MdxReport.MdxReportLoadControl)Page.LoadControl("MdxReport/MdxReportLoadControl.ascx"); loadControl._user=this._user; loadControl.ID="LoadC"; this.ContentsPanel.Controls.Add(loadControl); } else if(this._reportsType==_user.ReportSystem.GetReportTypeCode(typeof(FI.BusinessObjects.StorecheckReport))) { FI.UI.Web.StorecheckReport.StorecheckReportLoadControl loadControl = (FI.UI.Web.StorecheckReport.StorecheckReportLoadControl)Page.LoadControl("StorecheckReport/StorecheckReportLoadControl.ascx"); loadControl._user=this._user; loadControl.ID="LoadC"; this.ContentsPanel.Controls.Add(loadControl); } else { throw new NotSupportedException(); } } else { // load list _listControl = (FI.UI.Web.ReportListControl)Page.LoadControl("ReportListControl.ascx"); _listControl._user=this._user; _listControl._reportsType=this._reportsType; _listControl.ID="ListC"; this.ContentsPanel.Controls.Add(_listControl); } }
private void LoadContents() { try { if (Request.QueryString["content"] != null) { Session[this.ToString() + ":ContentType"] = Request.QueryString["content"]; } Session[this.ToString() + ":ReportsType"] = int.Parse(Request.QueryString["rpttype"]); } catch { //do nothing } if (Session[this.ToString() + ":ContentType"] == null) { _contentType = "List"; } else { _contentType = (string)Session[this.ToString() + ":ContentType"]; } // reports type if (Session[this.ToString() + ":ReportsType"] == null) { _reportsType = -1; } else { _reportsType = (int)Session[this.ToString() + ":ReportsType"]; } if (_contentType == "Dispatch") { _dispControl = (FI.UI.Web.ReportDistributionControl)Page.LoadControl("ReportDistributionControl.ascx"); _dispControl._user = this._user; _dispControl.ID = "DispC"; this.ContentsPanel.Controls.Add(_dispControl); } else if (_contentType == "DispatchLog") { _dispLogControl = (FI.UI.Web.ReportDistributionLogControl)Page.LoadControl("ReportDistributionLogControl.ascx"); _dispLogControl._user = this._user; _dispLogControl.ID = "DispLogC"; this.ContentsPanel.Controls.Add(_dispLogControl); } else if (_contentType == "Export") { _exportControl = (FI.UI.Web.ReportExportControl)Page.LoadControl("ReportExportControl.ascx"); _exportControl._user = this._user; _exportControl.ID = "ExpC"; this.ContentsPanel.Controls.Add(_exportControl); } else if (_contentType == "Delete") { _deleteControl = (FI.UI.Web.ReportDeleteControl)Page.LoadControl("ReportDeleteControl.ascx"); _deleteControl._user = this._user; _deleteControl.ID = "DelC"; this.ContentsPanel.Controls.Add(_deleteControl); } else if (_contentType == "Copy") { _copyControl = (FI.UI.Web.ReportCopyControl)Page.LoadControl("ReportCopyControl.ascx"); _copyControl._user = this._user; _copyControl.ID = "CopyC"; this.ContentsPanel.Controls.Add(_copyControl); } else if (_contentType == "Sharing") { _sharingControl = (FI.UI.Web.ReportSharingControl)Page.LoadControl("ReportSharingControl.ascx"); _sharingControl._user = this._user; _sharingControl.ID = "SharingC"; this.ContentsPanel.Controls.Add(_sharingControl); } else if (_contentType == "Save") { _saveControl = (FI.UI.Web.ReportSaveControl)Page.LoadControl("ReportSaveControl.ascx"); _saveControl._user = this._user; _saveControl.ID = "SaveC"; this.ContentsPanel.Controls.Add(_saveControl); } else if (_contentType == "Load") { if (this._reportsType == _user.ReportSystem.GetReportTypeCode(typeof(FI.BusinessObjects.OlapReport))) { FI.UI.Web.OlapReport.ReportLoadControl loadControl = (FI.UI.Web.OlapReport.ReportLoadControl)Page.LoadControl("OlapReport/ReportLoadControl.ascx"); loadControl._user = this._user; loadControl.ID = "LoadC"; this.ContentsPanel.Controls.Add(loadControl); } else if (this._reportsType == _user.ReportSystem.GetReportTypeCode(typeof(FI.BusinessObjects.CustomSqlReport))) { FI.UI.Web.SqlReport.ReportLoadControl loadControl = (FI.UI.Web.SqlReport.ReportLoadControl)Page.LoadControl("SqlReport/ReportLoadControl.ascx"); loadControl._user = this._user; loadControl.ID = "LoadC"; this.ContentsPanel.Controls.Add(loadControl); } else if (this._reportsType == _user.ReportSystem.GetReportTypeCode(typeof(FI.BusinessObjects.CustomMdxReport))) { FI.UI.Web.MdxReport.ReportLoadControl loadControl = (FI.UI.Web.MdxReport.ReportLoadControl)Page.LoadControl("MdxReport/ReportLoadControl.ascx"); loadControl._user = this._user; loadControl.ID = "LoadC"; this.ContentsPanel.Controls.Add(loadControl); } else if (this._reportsType == _user.ReportSystem.GetReportTypeCode(typeof(FI.BusinessObjects.StorecheckReport))) { FI.UI.Web.StorecheckReport.ReportLoadControl loadControl = (FI.UI.Web.StorecheckReport.ReportLoadControl)Page.LoadControl("StorecheckReport/ReportLoadControl.ascx"); loadControl._user = this._user; loadControl.ID = "LoadC"; this.ContentsPanel.Controls.Add(loadControl); } else { throw new NotSupportedException(); } } else { // load list _listControl = (FI.UI.Web.ReportListControl)Page.LoadControl("ReportListControl.ascx"); _listControl._user = this._user; _listControl._reportsType = this._reportsType; _listControl.ID = "ListC"; this.ContentsPanel.Controls.Add(_listControl); } }