public async Task<IHttpActionResult> PutBiddingConvention(long id, BiddingConvention biddingConvention) { if (!ModelState.IsValid) { return BadRequest(ModelState); } if (id != biddingConvention.Id) { return BadRequest(); } db.Entry(biddingConvention).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BiddingConventionExists(id)) { return NotFound(); } else { throw; } } return StatusCode(HttpStatusCode.NoContent); }
public BiddingSystemConvention AddSystemConvention(BiddingConvention biddingConvention) { if (BiddingSystemConventions == null) { BiddingSystemConventions = new List <BiddingSystemConvention>(); } var existingConvention = BiddingSystemConventions.FirstOrDefault(bsc => bsc.BiddingConvention.Id == biddingConvention.Id); if (existingConvention != null) { return(existingConvention); } var biddingSystemConvention = new BiddingSystemConvention(this, biddingConvention); BiddingSystemConventions.Add(biddingSystemConvention); foreach (var sequence in biddingConvention.BiddingSequences) { AddBiddingSequence(sequence); } return(biddingSystemConvention); }
public async Task<IHttpActionResult> PostBiddingConvention(BiddingConvention biddingConvention) { if (!ModelState.IsValid) { return BadRequest(ModelState); } db.BiddingConventions.Add(biddingConvention); await db.SaveChangesAsync(); return CreatedAtRoute("DefaultApi", new { id = biddingConvention.Id }, biddingConvention); }
public BiddingSystemConvention AddSystemConvention(BiddingConvention biddingConvention) { if (BiddingSystemConventions == null) BiddingSystemConventions = new List<BiddingSystemConvention>(); var existingConvention = BiddingSystemConventions.FirstOrDefault(bsc => bsc.BiddingConvention.Id == biddingConvention.Id); if (existingConvention != null) return existingConvention; var biddingSystemConvention = new BiddingSystemConvention(this, biddingConvention); BiddingSystemConventions.Add(biddingSystemConvention); foreach (var sequence in biddingConvention.BiddingSequences) { AddBiddingSequence(sequence); } return biddingSystemConvention; }
public BiddingSystemConvention(BiddingSystem biddingSystem, BiddingConvention biddingConvention) { BiddingSystem = biddingSystem; BiddingConvention = biddingConvention; }
public BiddingSystemConvention(BiddingSystem biddingSystem, BiddingConvention biddingConvention) { BiddingSystem = biddingSystem; BiddingConvention = biddingConvention; }