示例#1
0
        /// <summary>
        /// 打开某个模块。
        ///
        /// 如果没有权限打开该模块,则弹出提示框。
        /// </summary>
        /// <param name="module"></param>
        /// <returns></returns>
        public WorkspaceWindow OpenModuleOrAlert(WPFModuleMeta module)
        {
            if (!PermissionMgr.CanShowModule(module))
            {
                App.MessageBox.Show(string.Format(
                                        "对不起,此功能需要 [ {0} ] 模块权限,您不具备此权限,如有需要,请与系统管理员联系!".Translate(),
                                        module.Label.Translate()
                                        ));

                return(null);
            }

            return(this.OpenModule(module));
        }
示例#2
0
        public override void Execute(QueryLogicalView view)
        {
            var moduleMeta = CommonModel.Modules[typeof(ProductCategory)] as WPFModuleMeta;

            if (PermissionMgr.CanShowModule(moduleMeta))
            {
                var page = App.Current.CreateModule(moduleMeta);
                var btn  = App.Windows.ShowDialog(page.WindowControl, w =>
                {
                    w.Title = "维护分类".Translate();
                });
                if (btn == WindowButton.Yes)
                {
                    view.Commands[typeof(RefreshProductNavigation)].TryExecute();
                }
            }
        }