예제 #1
0
        private void ShutdownProgramCallback(SysCommonMsgArgs <string> args)
        {
            IMessageBox _msgBox = IocManagerSingle.Instance.GetPart <IMessageBox>();

            if (!string.IsNullOrWhiteSpace(args.Parameters))
            {
                if (_msgBox.ShowDialogWarningMsg(args.Parameters))
                {
                    Application.Current.Shutdown();
                }
            }
            else
            {
                Application.Current.Shutdown();
            }
        }
예제 #2
0
        private void ShutdownProgramCallback(SysCommonMsgArgs <string> args)
        {
            IMessageBox _msgBox = IocManagerSingle.Instance.GetPart <IMessageBox>();

            if (args.Parameters != null)
            {
                if (_msgBox.ShowMutualMsg(LanguageHelperSingle.Instance.GetLanguageByKey(Languagekeys.ViewLanguage_View_MessageBox_Notice), args.Parameters))
                {
                    Application.Current.Shutdown();
                }
            }
            else
            {
                Application.Current.Shutdown();
            }
        }
예제 #3
0
        private string ExecuteLoginCommand()
        {
            //UserInfoEntityModel s = new UserInfoEntityModel()
            //{
            //    IdNumber = "548795462165789548",
            //    LoginPassword = "******",
            //    LoginUserName = "******",
            //    PhoneNumber = "15448798546",
            //    UserName = "******",
            //    WorkUnit = "月上之上"
            //};
            //UserInfoEntityModel b = new UserInfoEntityModel()
            //{
            //    IdNumber = "548795462165789548",
            //    LoginPassword = "******",
            //    LoginUserName = "******",
            //    PhoneNumber = "15448798546",
            //    UserName = "******",
            //    WorkUnit = "月上之上2"
            //};
            //var a = _dbService.AddNew<UserInfoEntityModel>(s, b);

            string operationLog = string.Empty;
            var    loginUser    = _dbService.UserInfos.FirstOrDefault((t) => t.LoginUserName == CurLoginUser.LoginUserName).ToModel <UserInfo, UserInfoEntityModel>();

            if (loginUser == default(UserInfoEntityModel))
            {
                //登录失败
                MessageBox.ShowDialogErrorMsg("登录失败,请重新登录");
            }
            else
            {
                SystemContext.Instance.SetLoginSuccessUser(loginUser);

                //关闭界面
                //由于此处导航是持续导航(第一个界面完成后,直接进入下个界面,无导航消息发送)
                //所以需要自己关闭
                base.CloseView();
                operationLog = "登录用户成功";

                //登录成功
                SysCommonMsgArgs sysArgs = new SysCommonMsgArgs(SystemKeys.LoginComplete);
                MsgAggregation.Instance.SendSysMsg(sysArgs);
            }

            return(operationLog);
        }
예제 #4
0
        private async void ExecuteSysLoad(string solutionContentFromXml)
        {
            var opertionResult = await Task <bool> .Factory.StartNew(ConcreateLoadOfTask, solutionContentFromXml);

            if (!opertionResult)
            {
                //加载信息失败,关闭程序
                MessageBox.ShowDialogErrorMsg("系统加载失败,即将关闭程序。");
                SysCommonMsgArgs <string> args = new SysCommonMsgArgs <string>(SystemKeys.ShutdownProgram);
                base.MessageAggregation.SendSysMsg(args);
            }
            IsLoadingVisibility = Visibility.Collapsed;
            IsLoadVisibility    = Visibility.Visible;
            //完成加载,进入登录界面
            //base.CloseView();
            //base.NavigationForNewWindow(ExportKeys.ModuleLoginView);
        }
예제 #5
0
        /// <summary>
        /// 设置子界面状态
        /// </summary>
        /// <param name="isExpanded">是否展开创建案例界面</param>
        /// <param name="needCollapsedNavigation">是否需要折叠导航,true:折叠案例编辑界面时自动返回最后一个非案例编辑界面</param>
        public static void SetEditCaseViewStatus(bool isExpanded, bool needCollapsedNavigation = true)
        {
            CurEditViewOpenStatus = isExpanded;

            //便于以后扩展用
            SubViewMsgModel curStatus = new SubViewMsgModel(isExpanded);
            //展开或收起案例名
            SysCommonMsgArgs <SubViewMsgModel> sysArgs = new SysCommonMsgArgs <SubViewMsgModel>(SystemKeys.SetSubViewStatus);

            sysArgs.Parameters = curStatus;
            MsgAggregation.Instance.SendSysMsg <SubViewMsgModel>(sysArgs);

            if (isExpanded)
            {
                //展开案例编辑界面
                NormalNavigationArgs args = NormalNavigationArgs.CreateMainViewNavigationArgs(ExportKeys.CaseCreationView, null);
                MsgAggregation.Instance.SendNavigationMsgForMainView(args);
            }
            else if (needCollapsedNavigation)
            {
                /*
                 * TODO
                 * 此处特殊处理
                 * 因为案例编辑界面是固定的子界面
                 * 同时为了防止返回时界面状态丢失
                 * 所以将打开案例管理界面之前的界面缓存
                 * 在发送导航消息时【参数就是缓存的上一个界面】
                 *
                 * beforeViewOnIsExpanded==null:刚启动程序,登录进入主界面。由于逻辑问题会在登录后执行一次返回
                 *
                 */

                //折叠,还原为上个界面
                var beforeViewKey = NavigationLogHelper.GetBeforeViewKeyBySkipKeyAtMainView(ExportKeys.CaseCreationView);
                if (!string.IsNullOrWhiteSpace(beforeViewKey))
                {
                    NormalNavigationArgs args = beforeViewOnIsExpanded == null?
                                                NormalNavigationArgs.CreateMainViewNavigationArgs(beforeViewKey, null) : NormalNavigationArgs.CreateMainViewNavigationArgs(beforeViewKey, beforeViewOnIsExpanded, true);

                    MsgAggregation.Instance.SendNavigationMsgForMainView(args);
                }
            }
        }
예제 #6
0
 /// <summary>
 /// 打开子界面回调
 /// </summary>
 /// <param name="args"></param>
 private void OpenSubViewCallback(SysCommonMsgArgs <SubViewMsgModel> args)
 {
     gd_CaseName.Visibility = Visibility.Visible;
     ExecuteStoryboard(args.Parameters.IsExpandSubView, args.Parameters.NeedStoryboard);
 }
예제 #7
0
        private void ExeucteExitSysCommand()
        {
            SysCommonMsgArgs <string> args = new SysCommonMsgArgs <string>(SystemKeys.ShutdownProgram);

            base.MessageAggregation.SendSysMsg(args);
        }