public ActionResult ShowEmployeeDetails(int id) { Employee emp = null; using (EmployeeProfileObject Employeeprofile = new EmployeeProfileObject()) { emp = Employeeprofile.GetProfilebyID(id).FirstOrDefault(); } return(View(emp)); }
public ActionResult UpdateProfile() { Employee emp = null; using (EmployeeProfileObject Employeeprofile = new EmployeeProfileObject()) { int EmployeeID = Session["EmployeeID"] == null ? 0 : Convert.ToInt32(Session["EmployeeID"]); if (EmployeeID == 0) { return(RedirectToAction("CreateProfile")); } IEnumerable <Employee> empees = Employeeprofile.GetProfilebyID(EmployeeID); emp = empees.FirstOrDefault(); } ViewData.Model = emp; return(View()); }