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 }));
        }
        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());
        }
        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());
        }