public ActionResult Active(long id) { //create new BS.clients, because when find one by id I can't update the entity employees _newEmployees = new employees(); data.employee employee = _newEmployees.GetOneById(id); employee.isActive = true; _employees.Update(employee); return(RedirectToAction("InActives")); }
public ActionResult Profile() { var employeeId = Int64.Parse(Session["employeeId"].ToString()); var employee = _employees.GetOneById(employeeId); var rols = (byte[])Session["rols"]; ViewBag.rols = rols.ToList(); return(View(employee)); }
public ActionResult Update(long id) { var rols = (byte[])Session["rols"]; if (rols == null) //redirect to SinIn { return(RedirectToAction("Index", "Home")); } else if (rols.Contains <byte>(1)) { var employee = _employees.GetOneById(id); users_x_rols _users_x_rols = new users_x_rols(); ViewBag.rols = _users_x_rols.GetAllByUserId(employee.users.FirstOrDefault().userId); return(View(employee)); } else//redirect to Home { return(RedirectToAction("Home", "Home")); } }