Ejemplo n.º 1
0
        public async Task <IActionResult> OnPostAsync()
        {
            var adminUserInfo = _accountInfoService.Init(out string userName, out string password);//初始化管理员信息

            if (adminUserInfo == null)
            {
                return(new StatusCodeResult(404));
                //base.Response.StatusCode = 404;
                //return;
            }
            else
            {
                Step = 1;
                _systemConfigService.Init();//初始化系统信息
                _sysMenuService.Init();

                IXscfRegister systemRegister = Senparc.Scf.XscfBase.Register.RegisterList.First(z => z.GetType() == typeof(Senparc.Areas.Admin.Register));
                await _xscfModuleService.InstallMenuAsync(systemRegister, Scf.Core.Enums.InstallOrUpdate.Install);//安装菜单

                AdminUserName = userName;
                AdminPassword = password;//这里不可以使用 adminUserInfo.Password,因为此参数已经是加密信息

                return(Page());
            }
        }
Ejemplo n.º 2
0
        public void OnGet()
        {
            _systemConfigService.Init();                                                            //初始化系统信息

            var adminUserInfo = _accountInfoService.Init(out string userName, out string password); //初始化管理员信息

            if (adminUserInfo == null)
            {
                base.Response.StatusCode = 404;
                return;
                //return new StatusCodeResult(404);
            }
            else
            {
                AdminUserName = userName;
                AdminPassword = password;//这里不可以使用 adminUserInfo.Password,因为此参数已经是加密信息
            }
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> OnPostAsync()
        {
            var adminUserInfo = _accountInfoService.Init(out string userName, out string password);//初始化管理员信息

            if (adminUserInfo == null)
            {
                return(new StatusCodeResult(404));
            }
            else
            {
                Step = 1;

                //添加初始化多租户信息
                if (SiteConfig.SenparcCoreSetting.EnableMultiTenant)
                {
                    var httpContext = _httpContextAccessor.Value.HttpContext;
                    try
                    {
                        //var tenantInfo = await _tenantInfoService.CreateInitTenantInfoAsync(httpContext);

                        CreatedRequestTenantInfo = await _tenantInfoService.SetScopedRequestTenantInfoAsync(httpContext);

                        TenantInfoDto = _tenantInfoService.Mapper.Map <TenantInfoDto>(await _tenantInfoService.GetObjectAsync(z => z.Id == CreatedRequestTenantInfo.Id));
                    }
                    catch (Exception)
                    {
                    }
                    finally
                    {
                    }
                }

                _systemConfigService.Init();//初始化系统信息
                _sysMenuService.Init();

                IXncfRegister systemRegister = XncfRegisterManager.RegisterList.First(z => z.GetType() == typeof(Senparc.Areas.Admin.Register));
                await _xncfModuleService.InstallMenuAsync(systemRegister, Ncf.Core.Enums.InstallOrUpdate.Install);//安装菜单

                AdminUserName = userName;
                AdminPassword = password;//这里不可以使用 adminUserInfo.Password,因为此参数已经是加密信息

                return(Page());
            }
        }
Ejemplo n.º 4
0
        public IActionResult Index()
        {
            var adminUserInfo = _accountInfoService.Init(out string userName, out string password);

            _systemConfigService.Init();

            if (adminUserInfo == null)
            {
                return(new StatusCodeResult(404));
            }

            var vd = new Install_IndexVD()
            {
                AdminUserName = userName,
                AdminPassword = password//这里不可以使用 adminUserInfo.Password,因为此参数已经是加密信息
            };

            return(View(vd));
        }
Ejemplo n.º 5
0
        public IActionResult OnGet()
        {
            _systemConfigService.Init();                                                            //初始化系统信息
            _sysMenuService.Init();
            var adminUserInfo = _accountInfoService.Init(out string userName, out string password); //初始化管理员信息

            if (adminUserInfo == null)
            {
                return(new StatusCodeResult(404));

                base.Response.StatusCode = 404;
                //return;
                //return new StatusCodeResult(404);
            }
            else
            {
                AdminUserName = userName;
                AdminPassword = password;//这里不可以使用 adminUserInfo.Password,因为此参数已经是加密信息

                return(Page());
            }
        }
        /// <summary>
        /// 呼叫 初始化DB 的method
        /// </summary>
        private void DBInitial()
        {
            log.Info($"資料庫初始化...");
            try
            {
                var apiResult = new DataServices.DataServices().GetDataFromAPI();

                ClinicRoomService.ClearClinic();

                DoctorService.ClearDoctor();

                SystemConfigService.Init();

                ClinicRoomService.Init(apiResult.Result.ClinicRoom);

                DoctorService.Init(apiResult.Result.Doctor);
            }
            catch (Exception ex)
            {
                log.Error(ex.ToString());
            }

            log.Info($"資料庫初始化完成...");
        }