Exemplo n.º 1
0
        public ActionResult Add()
        {
            List <SelectListItem> roleSelectList = new List <SelectListItem>();

            (_rolebusiness.GetList() as List <RoleModel>).
            ForEach(r => roleSelectList.Add(new SelectListItem {
                Text = r.Name, Value = r.Id.ToString()
            }
                                            ));
            ViewBag.Rolelist = roleSelectList;
            return(View());
        }
Exemplo n.º 2
0
        public JsonResult GetList()
        {
            var list = _business.GetList();

            return(Json(list, JsonRequestBehavior.AllowGet));
        }