public async Task <ActionResult> DeleteConfirmed(int id) { InstrumentReference instrumentReference = await db.InstrumentReferences.FindAsync(id); db.InstrumentReferences.Remove(instrumentReference); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit([Bind(Include = "Id,Reference,InstrumentId,BrokerId")] InstrumentReference instrumentReference) { if (ModelState.IsValid) { db.Entry(instrumentReference).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.BrokerId = new SelectList(db.Brokers, "Id", "Name", instrumentReference.BrokerId); ViewBag.InstrumentId = new SelectList(db.Instruments, "Id", "Name", instrumentReference.InstrumentId); return(View(instrumentReference)); }
// GET: InstrumentReferences/Details/5 public async Task <ActionResult> Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } InstrumentReference instrumentReference = await db.InstrumentReferences.FindAsync(id); if (instrumentReference == null) { return(HttpNotFound()); } return(View(instrumentReference)); }
// GET: InstrumentReferences/Edit/5 public async Task <ActionResult> Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } InstrumentReference instrumentReference = await db.InstrumentReferences.FindAsync(id); if (instrumentReference == null) { return(HttpNotFound()); } ViewBag.BrokerId = new SelectList(db.Brokers, "Id", "Name", instrumentReference.BrokerId); ViewBag.InstrumentId = new SelectList(db.Instruments, "Id", "Name", instrumentReference.InstrumentId); return(View(instrumentReference)); }
public PPriceSensor(string instrument, ValueCondition greaterOrEqual, decimal price) { this.Instrument = instrument; this.ValueCondition = greaterOrEqual; this.Value = price; }