Exemple #1
0
        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"));
        }
Exemple #2
0
        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));
        }
Exemple #3
0
        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"));
            }
        }