Exemplo n.º 1
0
        public ActionResult Add(int id = 0)
        {
            #region Check Rights
            bool hasRights;
            if (id == 0)
            {
                hasRights = AdminHelper.CheckUserAction(ScreenEnum.Employee, ActionEnum.Add);
            }
            else
            {
                hasRights = AdminHelper.CheckUserAction(ScreenEnum.Employee, ActionEnum.Edit);
            }

            if (!hasRights)
            {
                return(RedirectToAction("UnAuthorized", "Home", new { area = "" }));
            }

            #endregion
            ViewBag.DepartmentList = ListCommonHelper.GetDepartmentList();
            var empObj = EmployeeHelper.GetEmployeeVm(id);
            return(View(empObj));
        }