Example #1
0
        public void TestAddNew()
        {
            AdminLogService adsService  = new AdminLogService();
            long            id          = adsService.AddNew(2, "测试信息");
            AdminLogDTO     adminLogDto = adsService.GetById(id);

            Assert.AreEqual(id, adminLogDto.Id);
            Assert.AreEqual("测试信息", adminLogDto.Msg);
        }
Example #2
0
        public AdminLogDTO ToDTO(AdminLogEntity admin)
        {
            AdminLogDTO adminDto = new AdminLogDTO();

            adminDto.UserId         = admin.UserId;
            adminDto.Msg            = admin.Msg;
            adminDto.UserName       = admin.AdminUserEntity.Name;
            adminDto.UserPhoneNum   = admin.AdminUserEntity.PhoneNum;
            adminDto.CreateDateTime = admin.CreateDateTime;
            adminDto.Id             = admin.Id;
            return(adminDto);
        }
Example #3
0
        private AdminLogDTO ToDTO(AdminLogEntity log)
        {
            AdminLogDTO dto = new AdminLogDTO();

            dto.AdminUserId       = log.AdminUserId;
            dto.AdminUserName     = log.AdminUser.Name;
            dto.AdminUserPhoneNum = log.AdminUser.PhoneNum;
            dto.CreateDateTime    = log.CreateDateTime;
            dto.Id      = log.Id;
            dto.Message = log.Message;
            return(dto);
        }
Example #4
0
        public AdminLogDTO ToDTO(AdminLogEntity entity)
        {
            AdminLogDTO dto = new AdminLogDTO();

            dto.AdminId      = entity.AdminId;
            dto.AdminMobile  = entity.AdminMobile;
            dto.CreateTime   = entity.CreateTime;
            dto.Remark       = entity.Remark;
            dto.Id           = entity.Id;
            dto.IpAddress    = entity.IpAddress;
            dto.PermTypeName = entity.PermTypeName;
            dto.Tip          = entity.Tip;
            return(dto);
        }
Example #5
0
        public AdminLogDTO ToDTO(AdminLogEntity entity)
        {
            AdminLogDTO dto = new AdminLogDTO();

            dto.AdminId            = entity.AdminId;
            dto.AdminMobile        = entity.Admin.Mobile;
            dto.CreateTime         = entity.CreateTime;
            dto.Description        = entity.Description;
            dto.Id                 = entity.Id;
            dto.IpAddress          = entity.IpAddress;
            dto.PermissionTypeId   = entity.PermissionTypeId;
            dto.PermissionTypeName = entity.PermissionType.Name;
            dto.Tip                = entity.Tip;
            return(dto);
        }
Example #6
0
 public AdminLogDTO GetById(long id)
 {
     using (ZSZDbContext ctx = new ZSZDbContext())
     {
         BaseService <AdminLogEntity> bs = new BaseService <AdminLogEntity>(ctx);
         var log = bs.GetById(id);
         if (log == null)
         {
             return(null);
         }
         AdminLogDTO dto = new AdminLogDTO();
         dto.AdminUserId       = log.AdminUserId;
         dto.AdminUserName     = log.AdminUser.Name;
         dto.AdminUserPhoneNum = log.AdminUser.PhoneNum;
         dto.CreateDateTime    = log.CreateDateTime;
         dto.Id      = log.Id;
         dto.Message = log.Message;
         return(dto);
     }
 }