Esempio n. 1
0
 public AccessKey(int?tenantId, Door door, HomeOwer homeOwer, DateTime validity, long communityId)
 {
     TenantId    = tenantId;
     HomeOwer    = homeOwer;
     Validity    = validity;
     CommunityId = communityId;
     Door        = door;
 }
Esempio n. 2
0
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="HomeOwer"></param>
        /// <returns></returns>
        public virtual async Task UpdateAsync(HomeOwer entity)
        {
            await HomeOwerRepository.UpdateAsync(entity);

            var userId      = _abpSession.UserId;
            var currentUser = _userManager.Users.FirstOrDefault(user => user.Id == userId);

            if (currentUser != null)
            {
                Logger.InfoFormat("Admin {0} Create HomeOwer {1}", currentUser.UserName, entity.Name);
            }
        }
Esempio n. 3
0
        /// <summary>
        /// 添加业主信息
        /// ================================
        /// 1. 业主录入初始状态:Initial
        /// 2. 业主录入,默认自带小区大门的门禁
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public async Task CreateHomeOwer(CreateHomeOwerInput input)
        {
            var community = await _communityManager.CommunityRepository.FirstOrDefaultAsync(input.CommunityId);

            var entity = new HomeOwer(CurrentUnitOfWork.GetTenantId(), input.CommunityId, input.Forename, input.Surname, input.Phone, input.Email, EHomeOwerTitleTypeUtils.GetValue(input.Title), EHomeOwerGroupTypeUtils.GetValue(input.UserGroup), community.Name, input.AltContace, input.AltMobile);

            //录入业主关联的门禁
            entity.Doors = new List <Door>();
            //小区大门
            var gates = await _doorManager.DoorRepository.GetAllListAsync(d => d.DoorType == EDoorType.Gate.ToString());

            gates.ForEach(door =>
            {
                entity.Doors.Add(door);
            });

            await _manager.CreateAsync(entity);
        }