Exemplo n.º 1
0
        public async Task <IActionResult> Edit(int id, [Bind("ClientID,NHI,First,Last,Age,Location")] Client client)
        {
            if (id != client.ClientID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(client);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ClientExists(client.ClientID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(client));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> MDT(Episode episode)
        {
            if (episode.Outcome == "3" || episode.Outcome == "4")  // Close the episode if outcome is Deferred or Closed
            {
                episode.isOpen = false;
            }
            try
            {
                episode.Referral = _context.Referrals.Find(episode.ReferralID);
                _context.Update(episode);
                await _context.SaveChangesAsync();

                Debug.WriteLine("ClientID after= {0}", episode.ClientID);
                return(RedirectToAction("MdtList"));
            }
            catch
            {
                return(Content("Something went wrong"));
            }
        }