예제 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            HealthClinic healthClinic = db.HealthClinics.Find(id);

            db.HealthClinics.Remove(healthClinic);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #2
0
        public ActionResult RemoveAsset(int id)
        {
            HealthClinic healthClinic = db.HealthClinics.Find(id);

            db.HealthClinics.Remove(healthClinic);
            db.SaveChanges();
            TempData["successMessage"] = $"Asset successfully deleted";
            return(RedirectToAction("Index"));
        }
예제 #3
0
 public ActionResult Edit([Bind(Include = "Id,Name,Physical_Address,ResAddress,Phone,Email,CampusId,ClinicTypeId")] HealthClinic healthClinic)
 {
     if (ModelState.IsValid)
     {
         db.Entry(healthClinic).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CampusId     = new SelectList(db.Campus, "Id", "Name", healthClinic.CampusId);
     ViewBag.ClinicTypeId = new SelectList(db.ClinicTypes, "Id", "TypeName", healthClinic.ClinicTypeId);
     return(View(healthClinic));
 }
예제 #4
0
        public ActionResult Create([Bind(Include = "Id,Name,Physical_Address,ResAddress,Phone,Email,CampusId,ClinicTypeId")] HealthClinic healthClinic)
        {
            if (ModelState.IsValid)
            {
                db.HealthClinics.Add(healthClinic);
                db.SaveChanges();
                TempData["successMessage"] = $"Item successfully added";
                return(RedirectToAction("Index"));
            }

            ViewBag.CampusId     = new SelectList(db.Campus, "Id", "Name", healthClinic.CampusId);
            ViewBag.ClinicTypeId = new SelectList(db.ClinicTypes, "Id", "TypeName", healthClinic.ClinicTypeId);
            return(View(healthClinic));
        }
예제 #5
0
        // GET: Clinic/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            HealthClinic healthClinic = db.HealthClinics.Find(id);

            if (healthClinic == null)
            {
                return(HttpNotFound());
            }
            return(View(healthClinic));
        }
예제 #6
0
        // GET: Clinic/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            HealthClinic healthClinic = db.HealthClinics.Find(id);

            if (healthClinic == null)
            {
                return(HttpNotFound());
            }
            ViewBag.CampusId     = new SelectList(db.Campus, "Id", "Name", healthClinic.CampusId);
            ViewBag.ClinicTypeId = new SelectList(db.ClinicTypes, "Id", "TypeName", healthClinic.ClinicTypeId);
            return(View(healthClinic));
        }