Guest User

Untitled

a guest
Jan 23rd, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. [Authorize(Roles = "Admin")]
  2. public ActionResult Details(int? id)
  3. {
  4. if (id == null)
  5. {
  6. return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
  7. }
  8. SCPersonnel sCPersonnel = db.SCPersonnels.Find(id);
  9. ViewBag.CreatedBy = db.AspNetUsers.Where(x => x.Id == sCPersonnel.CreatedBy).Select(x => x.UserName).FirstOrDefault();
  10. ViewBag.ModifiedBy = db.AspNetUsers.Where(x => x.Id == sCPersonnel.ModifiedBy).Select(x => x.UserName).FirstOrDefault();
  11.  
  12. if (sCPersonnel == null)
  13. {
  14. return HttpNotFound();
  15. }
  16. return View(sCPersonnel);
  17. }
Add Comment
Please, Sign In to add comment