Beispiel #1
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            HIVMedsModel hIVMedsModel = await db.HIVMedsModel.FindAsync(id);

            db.HIVMedsModel.Remove(hIVMedsModel);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
Beispiel #2
0
        public async Task <ActionResult> Edit([Bind(Include = "HIVMedsId,HIVMeds")] HIVMedsModel hIVMedsModel)
        {
            if (ModelState.IsValid)
            {
                db.Entry(hIVMedsModel).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(hIVMedsModel));
        }
Beispiel #3
0
        public async Task <ActionResult> Create([Bind(Include = "HIVMedsId,HIVMeds")] HIVMedsModel hIVMedsModel)
        {
            if (ModelState.IsValid)
            {
                db.HIVMedsModel.Add(hIVMedsModel);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(hIVMedsModel));
        }
Beispiel #4
0
        // GET: HIVMedsModels/Delete/5
        public async Task <ActionResult> Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            HIVMedsModel hIVMedsModel = await db.HIVMedsModel.FindAsync(id);

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