protected override void dialogAccept(object Sender, System.EventArgs aEArgs) { if (_eFolderName.Text == "") { CRSMessageBox.ShowBox( XmlTools.getXmlNodeByAttrVal("name", "noName", DialogLocale).InnerText, RsViewEngine.Locale.GetTagText("error"), MessageBoxButtons.OK, MessageBoxIcon.Exclamation ); } else { base.dialogAccept(Sender, aEArgs); } }
public void DoAddReport() { XmlNode lThisData = RsViewEngine.Locale.GetFormData(LOCALE_ALIAS); RsReportCollection lCurrColl = getSelectedCollection(); if (lCurrColl == null) { CRSMessageBox.ShowBox( XmlTools.getXmlNodeByAttrVal("name", NOCOLLECTION_FILE, lThisData).InnerText, RsViewEngine.Locale.GetTagText("error"), MessageBoxButtons.OK, MessageBoxIcon.Exclamation ); } else { if (lCurrColl is CFavoritesCollection) { _dlgAddReport.CollectionName = RsViewEngine.Locale.GetTagText(RsLocalization.TAG_FAVORITES); } else { _dlgAddReport.CollectionName = lCurrColl.CollectionName; } _dlgAddReport.Modify = false; DialogResult lDlgRes = _dlgAddReport.ShowDialog(); if (lDlgRes == DialogResult.OK) { CReportFolder lParent = getCurrentParent(); if (lParent == null) { CRSMessageBox.ShowBox( RsViewEngine.Locale.GetTagText("collectionNotSelected"), RsViewEngine.Locale.GetTagText("error"), MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } CReportFile lNewFile = new CReportFile(_dlgAddReport.Alias, _dlgAddReport.ReportFile); lNewFile.Parent = lParent; lParent.Collection.ApplyToGUI(); lParent.Collection.QuickSave(); } } }
public void DoAddFolder() { XmlNode lThisData = RsViewEngine.Locale.GetFormData(LOCALE_ALIAS); RsReportCollection lCurrColl = getSelectedCollection(); if (getSelectedItem() == null) { CRSMessageBox.ShowBox( XmlTools.getXmlNodeByAttrVal("name", NOCOLLECTION_FOLDER, lThisData).InnerText, RsViewEngine.Locale.GetTagText("error"), MessageBoxButtons.OK, MessageBoxIcon.Exclamation ); } else { if (lCurrColl is CFavoritesCollection) { _dlgAddFolder.CollectionName = RsViewEngine.Locale.GetTagText(RsLocalization.TAG_FAVORITES); } else { _dlgAddFolder.CollectionName = lCurrColl.CollectionName; } _dlgAddFolder.FolderName = ""; DialogResult lDlgRes = _dlgAddFolder.ShowDialog(); if (lDlgRes == DialogResult.OK) { CReportFolder lParent = getCurrentParent(); CReportFolder lNewFolder = new CReportFolder(_dlgAddFolder.FolderName); lNewFolder.Parent = lParent; lParent.Collection.ApplyToGUI(); lParent.Collection.QuickSave(); } } }
public void OpenReport() { if (File.Exists(_ReportFile)) { CHostApplication lHostApp = new CHostApplication(this); _ChildProcess = lHostApp.StartEmbeddedApp( System.Windows.Forms.Application.ExecutablePath, " \"" + _ReportFile + "\" \"" + this.Title + "\"" ); RsViewEngine.ChildApplications.AddChildApplication(_ChildProcess); _ChildProcess.Exited += new EventHandler(EH_ChildExited); } else { CRSMessageBox.ShowBox( RsViewEngine.Locale.GetMessage("rptNotFound") + "\n" + _ReportFile, RsViewEngine.Locale.GetMessageTitle("rptNotFound"), MessageBoxButtons.OK, MessageBoxIcon.Error ); } }
public void DoRemove() { XmlNode lThisData = RsViewEngine.Locale.GetFormData(LOCALE_ALIAS); CReportItem lSelected = getSelectedItem(); RsReportCollection lCollection = getSelectedCollection(); string lVerifyMsg; string lItemName; if (lSelected == null) { CRSMessageBox.ShowBox( XmlTools.getXmlNodeByAttrVal("name", "itemNotSelected_del", lThisData).InnerText, RsViewEngine.Locale.GetTagText("error"), MessageBoxButtons.OK, MessageBoxIcon.Exclamation ); return; } lItemName = lSelected.ItemName; if (lSelected is CReportRootFolder) { if (lSelected is CReportFavoritesRoot) { lVerifyMsg = XmlTools.getXmlNodeByAttrVal("name", "verify_eraseFavs", lThisData).InnerText; } else { lVerifyMsg = XmlTools.getXmlNodeByAttrVal("name", "verify_rmCollection", lThisData).InnerText + " " + lCollection.CollectionName + "?"; } DialogResult lDlgRes = CRSMessageBox.ShowBox( lVerifyMsg, RsViewEngine.Locale.GetTagText("verify"), MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation ); if (lDlgRes == DialogResult.Yes) { if (lSelected is CReportFavoritesRoot) { lCollection.ClearCollection(); lCollection.QuickSave(); lCollection.ApplyToGUI(); _eCollection.SelectedNode = lCollection.RootFolder.GUINode; } else { if (lCollection.Modified) { lDlgRes = CRSMessageBox.ShowBox( XmlTools.getXmlNodeByAttrVal("name", "nosaved_collection", lThisData).InnerText + " " + lCollection.CollectionName + "?", RsViewEngine.Locale.GetTagText("save"), MessageBoxButtons.YesNo, MessageBoxIcon.Question ); if (lDlgRes == DialogResult.Yes) { RsViewEngine.SaveCollection(lCollection); } } RsViewEngine.CloseCollection(lCollection); _eCollection.SelectedNode = RsViewEngine.Favorites.RootFolder.GUINode; } } } else { if (lSelected is CReportFolder) { lVerifyMsg = XmlTools.getXmlNodeByAttrVal("name", "verify_rmFolder", lThisData).InnerText + " " + lItemName + "?"; } else { lVerifyMsg = XmlTools.getXmlNodeByAttrVal("name", "verify_rmFile", lThisData).InnerText + " " + lItemName + "?"; } DialogResult lDlgRes = CRSMessageBox.ShowBox( lVerifyMsg, RsViewEngine.Locale.GetTagText("verify"), MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation ); if (lDlgRes == DialogResult.Yes) { _eCollection.SelectedNode = lSelected.GUINode; lSelected.Release(); lCollection.QuickSave(); } } }