Example #1
0
        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));
        }
Example #2
0
 /// <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)
     );
 }
Example #3
0
        public ActionResult DeleteConfirmed(int id)
        {
            gen gen = db.gen.Find(id);

            db.gen.Remove(gen);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #4
0
        public IHttpActionResult Getgen(int id)
        {
            gen gen = db.gen.Find(id);

            if (gen == null)
            {
                return(NotFound());
            }

            return(Ok(gen));
        }
Example #5
0
 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));
 }
Example #6
0
        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));
        }
Example #7
0
        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));
        }
Example #8
0
        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));
        }
Example #9
0
        // 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));
        }
Example #10
0
        // 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));
        }
Example #11
0
 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);
 }
Example #12
0
 // Use this for initialization
 void Start()
 {
     genScript = Camera.main.GetComponent <gen>();
 }
Example #13
0
        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));
        }