public IHttpActionResult Putgen(int id, gen gen) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != gen.gencode) { return(BadRequest()); } db.Entry(gen).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!genExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
/// <summary> /// Convert our WaveFormat to NAudio compatible WaveFormat. /// </summary> /// <param name="riff">gen.snd.IffForm.WaveFormat</param> /// <returns>NAudio compatible WaveFormat</returns> public static NAudio.Wave.WaveFormat ToNAudio(gen.snd.IffForm.WaveFormat riff) { return new NAudio.Wave.WaveFormat( Convert.ToInt32(riff.fmtRate), Convert.ToInt32(riff.fmtBPSmp), Convert.ToInt32(riff.fmtChannels) ); }
public ActionResult DeleteConfirmed(int id) { gen gen = db.gen.Find(id); db.gen.Remove(gen); db.SaveChanges(); return(RedirectToAction("Index")); }
public IHttpActionResult Getgen(int id) { gen gen = db.gen.Find(id); if (gen == null) { return(NotFound()); } return(Ok(gen)); }
public ActionResult Edit(gen gen) { if (ModelState.IsValid) { db.Entry(gen).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.gencar = new SelectList(db.car, "carcode", "carbrand", gen.gencar); return(View(gen)); }
public IHttpActionResult Postgen(gen gen) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.gen.Add(gen); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = gen.gencode }, gen)); }
public ActionResult Create(gen gen) { if (ModelState.IsValid) { db.gen.Add(gen); db.SaveChanges(); return(RedirectToAction("Index", "View_Car")); } ViewBag.gencar = new SelectList(db.car, "carcode", "carbrand", gen.gencar); return(View(gen)); }
public IHttpActionResult Deletegen(int id) { gen gen = db.gen.Find(id); if (gen == null) { return(NotFound()); } db.gen.Remove(gen); db.SaveChanges(); return(Ok(gen)); }
// GET: gens/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } gen gen = db.gen.Find(id); if (gen == null) { return(HttpNotFound()); } return(View(gen)); }
// GET: gens/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } gen gen = db.gen.Find(id); if (gen == null) { return(HttpNotFound()); } ViewBag.gencar = new SelectList(db.car, "carcode", "carbrand", gen.gencar); return(View(gen)); }
public static gen.snd.Midi.MBT ToMBT(this ulong deltaTime, gen.snd.Midi.MidiReader reader) { return new gen.snd.Midi.MBT(deltaTime,reader.MidiTimeInfo.Division); }
// Use this for initialization void Start() { genScript = Camera.main.GetComponent <gen>(); }
public static Stream <T> from <S>(gen <T, S> gen, next <S> next, S init) { state <T, S> guard = s => new Tuple <T, S>(gen(s), next(s)); return(unfold(init, guard)); }