public ActionResult Edit(Guid?id, SysEnterprise collection)
        {
            if (!ModelState.IsValid)
            {
                return(View(collection));
            }

            _sysEnterpriseService.Save(id, collection);

            if (!id.HasValue)
            {
                //添加企业的时候需要给该企业初始化 角色和管理员账户

                //新建角色

                var sysRoleSysControllerSysActions = new List <SysRoleSysControllerSysAction>();

                foreach (var aa in _sysControllerSysActionService.GetAllEnt().Where(a => a.SysController.SysArea.AreaName == "Platform"))
                {
                    sysRoleSysControllerSysActions.Add(new SysRoleSysControllerSysAction
                    {
                        EnterpriseId           = collection.Id,
                        SysControllerSysAction = aa
                    });
                }

                var role = new SysRole
                {
                    EnterpriseId = collection.Id,
                    RoleName     = "管理员",
                    SysRoleSysControllerSysActions = sysRoleSysControllerSysActions,
                };
                //新建管理员
                var user = new SysUser
                {
                    EnterpriseId    = collection.Id,
                    UserName        = "******",
                    Password        = "******",
                    OldPassword     = "******",
                    DisplayName     = "管理员",
                    SysRoleSysUsers = new List <SysRoleSysUser>
                    {
                        new SysRoleSysUser
                        {
                            EnterpriseId = collection.Id,
                            SysRole      = role,
                        }
                    }
                };

                _sysUserService.Add(user);
            }

            _unitOfWork.Commit();

            return(RedirectToAction("Index"));
        }