示例#1
0
        public async Task <IActionResult> Edit(string id, [Bind("Id,FirstName,MiddleName,LastName,Nrc,Dob,Address,PhoneNumber,Email,Gender,BloodGroup")] Client client)
        {
            if (id != client.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(client);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ClientExists(client.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(client));
        }
        public async Task <IActionResult> Edit(string id, [Bind("NeonateId,DisorderId,NeedForFollowup,Treatment")] NeonateDiagnosis neonateDiagnosis)
        {
            if (id != neonateDiagnosis.NeonateId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(neonateDiagnosis);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!NeonateDiagnosisExists(neonateDiagnosis.NeonateId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["DisorderId"] = new SelectList(_context.Disorder, "Id", "Id", neonateDiagnosis.DisorderId);
            ViewData["NeonateId"]  = new SelectList(_context.Neonate, "Id", "Id", neonateDiagnosis.NeonateId);
            return(View(neonateDiagnosis));
        }
示例#3
0
        public async Task <IActionResult> Edit(string id, [Bind("Id,ClientId,BilirubunAtBirth,Dob,BirthWeight,GestationalAge,MothersFirstName,MothersMiddleName,MothersLastName,MothersNrc")] Neonate neonate)
        {
            if (id != neonate.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(neonate);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!NeonateExists(neonate.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ClientId"] = new SelectList(_context.Client, "Id", "Id", neonate.ClientId);
            return(View(neonate));
        }