Пример #1
0
 public async Task <IActionResult> ConfirmPayment(string id, [Bind("ID,Patient,DateOfVisit,Illness,MedicationGiven,Price,Status")] History history)
 {
     if (id != history.ID)
     {
         return(NotFound());
     }
     if (ModelState.IsValid)
     {
         try
         {
             _context.Update(history);
             await _context.SaveChangesAsync();
         }
         catch (DbUpdateConcurrencyException)
         {
             if (!DoctorsExists(history.ID))
             {
                 return(NotFound());
             }
             else
             {
                 throw;
             }
         }
         return(RedirectToAction("Prescription", "Doctors"));
     }
     return(View(history));
 }
Пример #2
0
        public async Task<IActionResult> Edit(string id, [Bind("ID,NRIC,Name,Gender,DateOfBirth,Address,History")] Patients patients)
        {
            if (id != patients.ID)
            {
                return NotFound();
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(patients);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PatientsExists(patients.ID))
                    {
                        return NotFound();
                    }
                    else
                    {
                        throw;
                    }
                }
                return RedirectToAction(nameof(Index));
            }
            return View(patients);
        }