daily pastebin goal
89%
SHARE
TWEET

Untitled

a guest Jan 23rd, 2019 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.         }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top