示例#1
0
        public async Task <ActionResult> DeleteConfirmed(long id)
        {
            RecetaMedicaMaterial recetaMedicaMaterial = await db.RecetaMedicaMaterial.FindAsync(id);

            db.RecetaMedicaMaterial.Remove(recetaMedicaMaterial);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
示例#2
0
        public async Task <ActionResult> Edit([Bind(Include = "Id,RecetaMedica,Material,Cantidad")] RecetaMedicaMaterial recetaMedicaMaterial)
        {
            if (ModelState.IsValid)
            {
                db.Entry(recetaMedicaMaterial).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewBag.Material     = new SelectList(db.Material, "Id", "Codigo", recetaMedicaMaterial.Material);
            ViewBag.RecetaMedica = new SelectList(db.RecetaMedica, "Id", "Descripcion", recetaMedicaMaterial.RecetaMedica);
            return(View("/Views/Administrativas/RecetaMedicaMaterials/Edit.cshtml", recetaMedicaMaterial));
        }
示例#3
0
        // GET: RecetaMedicaMaterials/Details/5
        public async Task <ActionResult> Details(long?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            RecetaMedicaMaterial recetaMedicaMaterial = await db.RecetaMedicaMaterial.FindAsync(id);

            if (recetaMedicaMaterial == null)
            {
                return(HttpNotFound());
            }
            return(View("/Views/Administrativas/RecetaMedicaMaterials/Details.cshtml", recetaMedicaMaterial));
        }
示例#4
0
        // GET: RecetaMedicaMaterials/Edit/5
        public async Task <ActionResult> Edit(long?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            RecetaMedicaMaterial recetaMedicaMaterial = await db.RecetaMedicaMaterial.FindAsync(id);

            if (recetaMedicaMaterial == null)
            {
                return(HttpNotFound());
            }
            ViewBag.Material     = new SelectList(db.Material, "Id", "Codigo", recetaMedicaMaterial.Material);
            ViewBag.RecetaMedica = new SelectList(db.RecetaMedica, "Id", "Descripcion", recetaMedicaMaterial.RecetaMedica);
            return(View("/Views/Administrativas/RecetaMedicaMaterials/Edit.cshtml", recetaMedicaMaterial));
        }