public DrawDetailDto GetDrawDetail(int drawId) { var r = from dr in DrawingsService.GetQueryList() join p in PrizeService.GetQueryList() on dr.PrizeId equals p.Id join a in AddressService.GetQueryList() on dr.AddressId equals a.Id into xx where dr.Id == drawId from x in xx.DefaultIfEmpty() select new DrawDetailDto { Id = dr.Id, Area = x.Area, City = x.City, Email = x.Email, Name = x.TrueName, Phone = x.Mobile, PrizeName = p.Name, Province = x.Province, Street = x.Address1, Tel = x.Tel, OrderNo = dr.OrderNo, CreateTime = dr.CreateTime, Source = dr.Source, IsVirtual = p.IsVirtual }; return(r.FirstOrDefault()); }
public IQueryable <DrawListDto> GetDrawList(int source) { //throw new NotImplementedException(); if (source == (int)Ichari.Model.Enum.GameSource.ChangeOfCare) { var r = from d in DrawingsService.GetQueryList() join o in LoveChangeService.GetQueryList() on d.OrderNo equals o.UnionOrder join p in PrizeService.GetQueryList() on d.PrizeId equals p.Id into px from gp in px.DefaultIfEmpty() join u in UserInfoService.GetQueryList() on d.UserId equals u.Id into ux from g in ux.DefaultIfEmpty() select new DrawListDto() { Id = d.Id, PrizeId = gp.Id, PrizeName = gp.Name, UserId = g.Id, UserName = g.UserName, IsConfirmed = d.IsConfirrmed, IsWin = d.IsWinner, IsHandled = d.IsHandled ?? false, Source = d.Source, DrawTime = d.CreateTime, OrderNo = o.UnionOrder, OrderState = o.State }; return(r); } else if (source == (int)Ichari.Model.Enum.GameSource.IchariDonation) { var r = from d in DrawingsService.GetQueryList() join o in OrderService.GetQueryList() on d.OrderNo equals o.TradeNo join p in PrizeService.GetQueryList() on d.PrizeId equals p.Id into px from gp in px.DefaultIfEmpty() join u in UserInfoService.GetQueryList() on d.UserId equals u.Id into x from g in x.DefaultIfEmpty() select new DrawListDto() { Id = d.Id, PrizeId = gp.Id, PrizeName = gp.Name, UserId = g.Id, UserName = g.UserName, IsConfirmed = d.IsConfirrmed, IsWin = d.IsWinner, IsHandled = d.IsHandled ?? false, Source = d.Source, DrawTime = d.CreateTime, OrderNo = o.TradeNo, OrderState = o.Status }; return(r); } return(null); }