public void Handle(GetOrderUserInfoRequest message)
        {
            var service = new HotelOrderService();
            var order   = service
                          .GetModelList(string.Format("openid='{0}'", message.OpenId))
                          .OrderByDescending(o => o.createDate)
                          .FirstOrDefault();

            var user = new OrderUserDto()
            {
                UserIdcard = string.Empty,
                UserMobile = string.Empty,
                UserName   = string.Empty
            };

            if (order != null)
            {
                user.UserName   = order.oderName;
                user.UserMobile = order.tel;
                user.UserIdcard = order.identityNumber;
            }

            _bus.Reply(new GetOrderUserInfoResponse()
            {
                User = user
            });
        }
Beispiel #2
0
        public void GetOrderList()
        {
            AutoMapperConfiguration.Configure();
            var service = new HotelOrderService();
            var list    = service.GetModelList(string.Format("openid='{0}'", "test"));

            list.MapTo <List <OrderDto> >();
        }
        public void Handle(GetOrderCountRequest message)
        {
            var service = new HotelOrderService();

            string strWhere = "1=1 ";

            if (!string.IsNullOrEmpty(message.OpenId))
            {
                strWhere += string.Format(" And OpenId='{0}' ", message.OpenId);
            }

            if (message.HotelId > 0)
            {
                strWhere += string.Format(" And hotelid={0}", message.HotelId);
            }
            var orderDtos = service.GetModelList(strWhere).MapTo <List <OrderDto> >();

            _bus.Reply(new GetOrderCountResponse()
            {
                Count = orderDtos.Count
            });
        }
Beispiel #4
0
        public void GetOrderUserInfo()
        {
            var service = new HotelOrderService();
            var order   = service
                          .GetModelList(string.Format("openid='{0}'", "test"))
                          .OrderByDescending(o => o.createDate)
                          .FirstOrDefault();

            var user = new OrderUserDto()
            {
                UserIdcard = string.Empty,
                UserMobile = string.Empty,
                UserName   = string.Empty
            };

            if (order != null)
            {
                user.UserName   = order.oderName;
                user.UserMobile = order.tel;
                user.UserIdcard = order.identityNumber;
            }

            Assert.IsTrue(!string.IsNullOrEmpty(user.UserName));
        }