public ActionResult Index() { var data = _appRoleService.GetAll(); //var user1 = new AppUser() //{ // UserName = "******", // Password = "******", // Email = "*****@*****.**", // IsActive = true //}; //var usr1 = _appUserService.Add(user1); //var manager1 = new SchoolManager() //{ // FirstName="YoneticiAd1", // LastName="YoneticiSoyad", // Id=usr1.Id //}; //var mngr = _corporationManagerService.Add(manager1); return(View()); }
public HttpResponseMessage GetListPaging(HttpRequestMessage request, int page, int pageSize, string filter = null) { return(CreateHttpResponse(request, () => { HttpResponseMessage response = null; int totalRow = 0; var model = _appRoleService.GetAll(page, pageSize, out totalRow, filter); IEnumerable <AppRoleViewModel> modelVm = Mapper.Map <IEnumerable <AppRole>, IEnumerable <AppRoleViewModel> >(model); PaginationSet <AppRoleViewModel> pagedSet = new PaginationSet <AppRoleViewModel>() { Page = page, TotalCount = totalRow, TotalPages = (int)Math.Ceiling((decimal)totalRow / pageSize), Items = modelVm }; response = request.CreateResponse(HttpStatusCode.OK, pagedSet); return response; })); }
//[Permission("Administrator")] public JsonResult GetAll() { List <AppRole> result = _appRoleService.GetAll(); return(Json(result, _jsonSerializerSettings)); }