コード例 #1
0
        //[ValidateAntiForgeryToken]
        public IActionResult Create([Bind("AssistanceId,AssistanceDate,UserId")] Assistance assistance)
        {
            if (ModelState.IsValid)
            {
                //_context.Add(assistance);
                //await _context.SaveChangesAsync();
                //return RedirectToAction(nameof(Index));
                var users       = from u in _context.User select u;
                var currentUser = users.Where(u => u.UserId.Equals(assistance.UserId)).FirstOrDefault();

                var assistanceInfo = _assistanceLogic.ProcessAssistance(currentUser.Token, assistance.AssistanceDate);

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["UserId"] = new SelectList(_context.User, "UserId", "DocumentNumber", assistance.UserId);
            return(View(assistance));
        }
コード例 #2
0
        public IActionResult Contact(string fingerprint)
        {
            var assistanceInfo = _assistanceLogic.ProcessAssistance(fingerprint);

            return(View(assistanceInfo));
        }