コード例 #1
0
        OnPostAsync(long?id)
        {
            string uid = HttpContext.Session.GetString("uid");

            if (uid == null)
            {
                return(RedirectToPage("../../Index"));
            }

            if (id == null)
            {
                return(NotFound());
            }

            TblEmployeeRequestUserSkill = await _context.TblEmployeeRequestUserSkills.FindAsync(id);

            if (TblEmployeeRequestUserSkill != null)
            {
                _context.TblEmployeeRequestUserSkills.Remove(TblEmployeeRequestUserSkill);

                TblEmployeeRequestEmployeeEditLog t = new TblEmployeeRequestEmployeeEditLog()
                {
                    FldEmployeeRequestEmployeeEditLogDate = DateTime.Now,
                    FldEmployeeRequestUserId                 = Int64.Parse(uid),
                    FldEmployeeRequestEmployeeId             = TblEmployeeRequestUserSkill.FldEmployeeRequestEmployeeId,
                    FldEmployeeRequestEmployeeEditLogSection = "Skill-Delete"
                };

                _context.TblEmployeeRequestEmployeeEditLogs.Add(t);

                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("Index", new { id = TblEmployeeRequestUserSkill.FldEmployeeRequestEmployeeId }));
        }
コード例 #2
0
        public async Task <IActionResult> OnGetAsync(long?id)
        {
            string uid = HttpContext.Session.GetString("uid");

            if (uid == null)
            {
                return(RedirectToPage("../../Index"));
            }

            if (id == null)
            {
                return(NotFound());
            }

            TblEmployeeRequestUserSkill = await _context.TblEmployeeRequestUserSkills
                                          .Include(t => t.FldEmployeeRequestEmployee)
                                          .Include(t => t.FldEmployeeRequestSkills).FirstOrDefaultAsync(m => m.FldEmployeeRequestUserSkillId == id);

            if (TblEmployeeRequestUserSkill == null)
            {
                return(NotFound());
            }
            ViewData["FldEmployeeRequestSkillsId"] = new SelectList(_context.TblEmployeeRequestSkills, "FldEmployeeRequestSkillsId", "FldEmployeeRequestSkillsSkillTitle");
            return(Page());
        }
コード例 #3
0
        OnGetAsync(long?id)
        {
            string uid = HttpContext.Session.GetString("uid");

            if (uid == null)
            {
                return(RedirectToPage("../../Index"));
            }

            if (id == null)
            {
                return(NotFound());
            }

            TblEmployeeRequestUserSkill = await _context.TblEmployeeRequestUserSkills
                                          .Include(t => t.FldEmployeeRequestEmployee)
                                          .Include(t => t.FldEmployeeRequestSkills).FirstOrDefaultAsync(m => m.FldEmployeeRequestUserSkillId == id);

            if (TblEmployeeRequestUserSkill == null)
            {
                return(NotFound());
            }
            return(Page());
        }