// GET: Employee public ActionResult Index() { ReportViewModel model; if (Session["userId"] == null) { return(RedirectToAction("Index", "Home")); } var empEntity = _de.GetEmployeeByEmpID(Convert.ToInt32(Session["userId"])); if (TempData["model"] == null) { model = new ReportViewModel(); } else { model = (ReportViewModel)TempData["model"]; } model.EmpId = Convert.ToInt32(Session["userId"]); model.Name = empEntity.FirstName + " " + empEntity.Lastname; model.RoleId = empEntity.RoleId; return(View(model)); }
public EmpRole GetUserRole(int?empId) { return(_de.GetEmployeeByEmpID(empId).EmpRole); }