public ActionResult Delete(int id) { try { CRUDOperation dataOperations = new CRUDOperation(); var UserProfile = (UserProfileSessionData)this.Session["UserProfile"]; if (UserProfile != null) { dataOperations.DeleteEmployee(id, (int)UserProfile.UserId); } return(RedirectToAction("Index")); } catch (Exception ex) { return(View("Error", new HandleErrorInfo(ex, "Error", "Error"))); } }