Beispiel #1
0
        /// <summary>
        /// 查询按钮。
        /// </summary>
        private void toolbarQuery_Click(object sender, EventArgs e)
        {
            RouteSearchDialog route = new RouteSearchDialog();

            if (DialogResult.OK == route.ShowDialog())
            {
                if (string.Empty == route.RouteKey || route.RouteKey.Length < 1)
                {
                    return;
                }
                if (string.Empty == route.RouteName || route.RouteName.Length < 1)
                {
                    return;
                }
                if (string.Empty == route.RouteVersion || route.RouteVersion.Length < 1)
                {
                    return;
                }

                string title = StringParser.Parse("${res:FanHai.Hemera.Addins.FMM.RouteViewContent.TitleName}")
                               + "_" + route.RouteName + "." + route.RouteVersion;

                foreach (IViewContent viewContent in WorkbenchSingleton.Workbench.ViewContentCollection)
                {
                    if (viewContent.TitleName == title)
                    {
                        viewContent.WorkbenchWindow.SelectWindow();
                        return;
                    }
                }

                RouteViewContent routeContent = new RouteViewContent(new RouteEntity(route.RouteKey));
                WorkbenchSingleton.Workbench.ShowView(routeContent);
            }
        }
Beispiel #2
0
        /// <summary>
        /// 新增按钮。
        /// </summary>
        private void toolbarNew_Click(object sender, EventArgs e)
        {
            foreach (IViewContent viewContent in WorkbenchSingleton.Workbench.ViewContentCollection)
            {
                if (viewContent.TitleName == StringParser.Parse("${res:FanHai.Hemera.Addins.FMM.RouteViewContent.TitleName}"))
                {
                    viewContent.WorkbenchWindow.SelectWindow();
                    RouteCtrl ctrl = (RouteCtrl)viewContent.Control.Controls.Find("RouteCtrl", true)[0];
                    if (ctrl.txtRouteName.Text.Trim() != "")
                    {
                        if (MessageBox.Show(StringParser.Parse("${res:Global.ClearNoteMessage}"),
                                            StringParser.Parse("${res:Global.SystemInfo}"), MessageBoxButtons.OKCancel) == DialogResult.Cancel)
                        {
                            return;
                        }
                    }

                    ctrl.CtrlState = ControlState.New;
                    return;
                }
            }

            RouteViewContent routeContent = new RouteViewContent(new RouteEntity());

            WorkbenchSingleton.Workbench.ShowView(routeContent);
        }
Beispiel #3
0