I have the below procedure
- var userId = User.FindFirstValue(ClaimTypes.NameIdentifier);
- var orgid = await _context.UsersData.Where(s => s.Id == userId).Select(s => s.OrgID).FirstOrDefaultAsync();
- var roles = await (from a in _context.UsersData.Where(a => a.Id == userId)
- join b in _context.CompanyDatas on a.OrgID equals b.OrgID into TempData1
- from c in TempData1
- join d in _context.AppIdentityRoles on a.Id equals d.UserId into TempData2
- from e in TempData2
- join f in _context.UsersRole on e.RoleId equals f.Id into TempData3
- from g in TempData3
- select new
- {
- RoleName = g.Name
- }).ToListAsync();
- string myS = "WOCraftTL";
- var status = await _context.WOMains.Where(s => s.WOMainID == womainid).Select(s => s.WOStatus).SingleOrDefaultAsync();
- foreach (var a in roles)
- {
- if (a.RoleName.Contains(myS) && status == "In Progress")
- {
- return RedirectToPage("/WO/WOReport", new { womainid = womainid });
- }
- else
- {
- var womainidP = await _context.WOMains.Where(s => s.WONumber == won && s.WONumberS == 0).Select(s => s.WOMainID).FirstOrDefaultAsync();
- return RedirectToPage("/WO/WOForm", new { womainid = womainidP, woS = womainid, status = WOStatusT });
- }
- }

Sachin SinghPosted Feb 19, 2021, 9:39 AM
Marius VasilePosted Feb 19, 2021, 3:38 PM
Kiran MohantyPosted Feb 19, 2021, 1:21 PM
Marius VasilePosted Feb 19, 2021, 9:48 AM