public ActionResult ShowEmployee(int id) //[Bind(Include ="EmployeeID,Name,PhoneNo,EmailID")] { CSLERPEntities contxt = new CSLERPEntities(); Employee ba = contxt.Employees.Where(x => x.RowID == id).FirstOrDefault(); return(View(ba)); }
// GET: Employee public ActionResult Employee() { try { string uid = Session["Userid"].ToString(); } catch (Exception ex) { return(RedirectToAction("Login", "login")); } //if (uid == "") //{ // ; // } CSLERPEntities contxt = new CSLERPEntities(); List <Employee> ba = contxt.Employees.OrderBy(x => x.Name).ToList(); return(View(ba)); }