public bool updatePatient(int patientID, Patient patient)
        {
            patient.ID = patientID;
            _ctx.Entry(patient).State = patientID == 0 ? EntityState.Added : EntityState.Modified;

            return(Convert.ToBoolean(_ctx.SaveChanges()));
        }
Esempio n. 2
0
        public async Task <IActionResult> PutHospital(int id, Hospital hospital)
        {
            if (id != hospital.Id)
            {
                return(BadRequest());
            }

            _context.Entry(hospital).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!HospitalExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Esempio n. 3
0
        public async Task <IActionResult> PutNurse(int id, Nurse nurse)
        {
            if (id != nurse.Id)
            {
                return(BadRequest());
            }

            _context.Entry(nurse).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!NurseExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public bool updateHospitalInfo(int hosipitalID, Hospital hospital)
        {
            hospital.ID = hosipitalID;
            _ctx.Entry(hospital).State = hosipitalID == 0 ? EntityState.Added : EntityState.Modified;

            return(Convert.ToBoolean(_ctx.SaveChanges()));
        }
Esempio n. 5
0
 public ActionResult Edit([Bind(Include = "StaffID,FName,LName,Adress,PhoneNR,SSN,HierDate,_Department")] Staff staff)
 {
     if (ModelState.IsValid)
     {
         db.Entry(staff).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(staff));
 }
 public ActionResult Edit([Bind(Include = "WhatsDoneID,Description")] WhatsDone whatsDone)
 {
     if (ModelState.IsValid)
     {
         db.Entry(whatsDone).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(whatsDone));
 }
 public ActionResult Edit([Bind(Include = "PatientID,FName,LName,Adress,PhoneNR,SSN,CeckInHospital")] Patient patient)
 {
     if (ModelState.IsValid)
     {
         db.Entry(patient).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(patient));
 }
Esempio n. 8
0
 public ActionResult Edit([Bind(Include = "TreatmentStatusID,Status")] TreatmentStatus treatmentStatus)
 {
     if (ModelState.IsValid)
     {
         db.Entry(treatmentStatus).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(treatmentStatus));
 }
 public ActionResult Edit([Bind(Include = "CauseTypeID,CauseTypeName")] CauseType causeType)
 {
     if (ModelState.IsValid)
     {
         db.Entry(causeType).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(causeType));
 }
 public ActionResult Edit([Bind(Include = "TreatmentID,Date,StillAlive,PatientID,WhatsDoneID,TreatmentStatusID")] Treatment treatment)
 {
     if (ModelState.IsValid)
     {
         db.Entry(treatment).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.PatientID         = new SelectList(db._Patient, "PatientID", "FName", treatment.PatientID);
     ViewBag.TreatmentStatusID = new SelectList(db._Treatmentstatus, "TreatmentStatusID", "Status", treatment.TreatmentStatusID);
     ViewBag.WhatsDoneID       = new SelectList(db._WhatsDone, "WhatsDoneID", "Description", treatment.WhatsDoneID);
     return(View(treatment));
 }