public Auction() { this._id = Guid.NewGuid (); this._createtimestamp = SNDK.Date.CurrentDateTimeToTimestamp (); this._updatetimestamp = SNDK.Date.CurrentDateTimeToTimestamp (); this._no = Helpers.NewNo (); this._title = string.Empty; this._begin = SNDK.Date.CurrentDateTimeToTimestamp (); this._end = SNDK.Date.CurrentDateTimeToTimestamp (); this._deadline = SNDK.Date.CurrentDateTimeToTimestamp (); this._pickupbegin = SNDK.Date.CurrentDateTimeToTimestamp (); this._pickupend = SNDK.Date.CurrentDateTimeToTimestamp (); this._pickuptext = string.Empty; this._location = string.Empty; this._description = string.Empty; this._livebiders = new List<LiveBider> (); this._buyernos = string.Empty; this._notes = string.Empty; this._type = Enums.AuctionType.Live; this._status = Enums.AuctionStatus.Hidden; }
public async Task <JsonResult> GetAuctions(Enums.AuctionStatus status) { try { var auctions = await _auctionService.GetAll(status); return(Json(new { success = true, result = auctions })); } catch (Exception ex) { return(Json(new { success = false, result = ex.Message })); } }
public async Task <List <Auction> > GetAll(Enums.AuctionStatus status) { return(await _db.Auctions.Where(x => x.Status == status).OrderByDescending(x => x.Id).ToListAsync()); }