Exemplo n.º 1
0
        public ActionResult Index(TPOProductionEntryModel model)
        {
            try
            {
                using (TPO.Services.Application.SecurityService service = new Services.Application.SecurityService())
                {
                    model.SupervisorList = new SelectList(service.GetByRole(TPO.Common.Constants.Roles.ShiftSupervisor).OrderBy(u => u.Username).ToList(), "Username", "Username");
                }

                //model = FetchTPOFormulationGridData(model);
            }
            catch (Exception exc)
            {
                model.ResponseMessage = new Core.ResponseMessage();
                model.ResponseMessage.ActionMessage = exc.Message;
                model.ResponseMessage.ActionStatus  = "error";
            }
            return(View(model));
        }
        public JsonResult FetchSupervisors()
        {
            List <UserModel> supervisors = new List <UserModel>();

            using (TPO.Services.Application.SecurityService service = new Services.Application.SecurityService())
            {
                supervisors = AutoMapper.Mapper.Map <List <UserDto>, List <UserModel> >(service.GetByRole(TPO.Common.Constants.Roles.ShiftSupervisor).OrderBy(u => u.Username).ToList());
            }
            return(Json(supervisors, JsonRequestBehavior.AllowGet));
        }