Beispiel #1
0
        public string GetAuctionsForUser()
        {
            EntityAllResponse <AuctionListCustomerViewModel> AuctoinRes =
                new EntityAllResponse <AuctionListCustomerViewModel>();

            var res = _actionSrv.GetAuctionsForCustomer(User.GetUser().Id);

            AuctoinRes.Entities = res.Entities.Select(a => new AuctionListCustomerViewModel()
            {
                Id              = a.AuctionId,
                AuctionName     = a.AuctionName,
                AuctionStatus   = a.AuctionStatus.ToDescription(),
                CloseDate       = a.CloseDate == null ? "" : a.CloseDate.Value.ToShortDateString(),
                OpenDate        = a.OpenDate == null ? "" : a.OpenDate.Value.ToShortDateString(),
                OpenProjectDate = a.OpenProjectDate == null ? "" : a.OpenProjectDate.Value.ToShortDateString(),
                PickWinnerDate  = a.PickWinnerDate == null ? "" : a.PickWinnerDate.Value.ToShortDateString(),
                SketchesCount   = a.Sketches.Count
            }).ToList();
            AuctoinRes.Message = res.Message;
            AuctoinRes.Success = res.Success;
            return(JsonConvert.SerializeObject(AuctoinRes));
        }