예제 #1
0
        public async Task <IActionResult> Create([Bind("ClientID,NHI,First,Last,Age,Location")] Client client)
        {
            if (ModelState.IsValid)
            {
                _context.Add(client);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(client));
        }
예제 #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"));
            }
        }