예제 #1
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            dia dia = await db.dias.FindAsync(id);

            db.dias.Remove(dia);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
예제 #2
0
        public async Task <ActionResult> Edit([Bind(Include = "id,dias")] dia dia)
        {
            if (ModelState.IsValid)
            {
                db.Entry(dia).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(PartialView(dia));
        }
예제 #3
0
        public async Task <ActionResult> Create([Bind(Include = "id,dias")] dia dia)
        {
            if (ModelState.IsValid)
            {
                db.dias.Add(dia);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(PartialView(dia));
        }
예제 #4
0
        // GET: dias/Delete/5
        public async Task <ActionResult> Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            dia dia = await db.dias.FindAsync(id);

            if (dia == null)
            {
                return(HttpNotFound());
            }
            return(PartialView(dia));
        }
예제 #5
0
 public persona(short E, string N, dia F)
 {
     Edad         = E;
     Nombre       = N;
     Dia_Favorito = F;
 }