Ejemplo n.º 1
0
        public ActionResult Create()
        {
            EmployeeDetailModels model = new EmployeeDetailModels();

            model.GetListRole(CurrentUser.RoleLevel);
            model.ListRole    = model.ListRole.Where(w => w.Value != CurrentUser.RoleID).ToList();
            model.CreateUser  = CurrentUser.UserId;
            model.ListCountry = _factory.GetListCountry();
            //get local country
            model.Country = model.ListCountry.Where(ww => ww.Alpha2Code == CurrentCountryCode).Select(ss => ss.Name).FirstOrDefault();
            return(View(model));
        }
Ejemplo n.º 2
0
        public PartialViewResult Edit(string id)
        {
            EmployeeDetailModels model = GetDetail(id);

            model.GetListRole(CurrentUser.RoleLevel);
            // Current user can not change role
            if (model.RoleID == CurrentUser.RoleID)
            {
                model.ListRole = model.ListRole.Where(w => w.Value == CurrentUser.RoleID).ToList();
            }
            else
            {
                model.ListRole = model.ListRole.Where(w => w.Value != CurrentUser.RoleID).ToList();
            }
            model.CreateUser  = CurrentUser.UserId;
            model.ListCountry = _factory.GetListCountry();
            return(PartialView("_Edit", model));
        }