Ejemplo n.º 1
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            Rometype rometype = await db.Rometype.FindAsync(id);

            db.Rometype.Remove(rometype);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
        public async Task <ActionResult> Edit([Bind(Include = "IDX,roomtype,price,pnumber")] Rometype rometype)
        {
            if (ModelState.IsValid)
            {
                db.Entry(rometype).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(rometype));
        }
Ejemplo n.º 3
0
        public async Task <ActionResult> Create([Bind(Include = "IDX,roomtype,price,pnumber")] Rometype rometype)
        {
            if (ModelState.IsValid)
            {
                db.Rometype.Add(rometype);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(rometype));
        }
Ejemplo n.º 4
0
        // GET: Rometypes/Delete/5
        public async Task <ActionResult> Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Rometype rometype = await db.Rometype.FindAsync(id);

            if (rometype == null)
            {
                return(HttpNotFound());
            }
            return(View(rometype));
        }