public async Task <IActionResult> Auth(string username, string password) { var data = await HttpClientAsync.Async(AuthenticationRoute.Auth, new { username, password }); data.isSuccess = true; return(this.Json(data)); }
public async Task TestGetWithMultipleParameterAsync() { dynamic model = await HttpClientAsync.Async(AuthenticationRoute.Auth, "admin", "111111"); int code = model.code; Assert.AreEqual(code, (int)HttpStatusCode.OK); }
/// <summary> /// The index page. /// </summary> /// <returns>A IActionResult.</returns> public async Task <IActionResult> Index() { var response = await HttpClientAsync.Async <IList <MenuModel> >(MenuRoute.Index); MenuIndex <MenuModel, MenuPostModel> index = new MenuIndex <MenuModel, MenuPostModel>(response); return(this.SearchGridConfiguration(index)); }
public async Task <IActionResult> GridStateChange(UserPostModel model) { HttpResponseModel response = await HttpClientAsync.Async <IList <UserModel> >(UserRoute.Search, model); UserViewConfiguration <UserModel> configuration = new UserViewConfiguration <UserModel>(response); return(this.GridConfiguration(configuration)); }
public async Task <IActionResult> MenuDataList(string name) { HttpResponseModel model = await HttpClientAsync.Async <IList <MenuModel> >(DataListRoute.GetMenuDataList, name); IList <MenuModel> users = (IList <MenuModel>)model.Data; return(this.DataListContent(users, o => o.Id, o => o.Name)); }
public async Task <IActionResult> EditDialog(int id) { HttpResponseModel model = await HttpClientAsync.Async <UserModel>(UserRoute.FindById, id); EditUserDialogConfiguration <UserEditPostModel, UserModel> dialog = new EditUserDialogConfiguration <UserEditPostModel, UserModel>((UserModel)model.Data); return(this.Dialog(dialog)); }
/// <summary> /// The Index. /// </summary> /// <returns>A IActionResult.</returns> public async Task <IActionResult> Index() { var model = await HttpClientAsync.Async <IList <RoleModel> >(RoleRoute.Index); RoleIndex <RoleModel, RolePostModel> table = new RoleIndex <RoleModel, RolePostModel>(model); return(this.SearchGridConfiguration(table)); }
public async Task <IActionResult> GridStateChange(IconPostModel model) { var response = await HttpClientAsync.Async <IList <Icon> >(IconRoute.Search, model); IconGridConfiguration configuration = new IconGridConfiguration(response); return(GridConfiguration(configuration)); }
public async Task <IActionResult> GridStateChange(LogPostModel model) { HttpResponseModel response = await HttpClientAsync.Async <IList <LogModel> >(LogRoute.Search, model); LogGridConfiguration <LogModel> configuration = new LogGridConfiguration <LogModel>(response); return(this.GridConfiguration(configuration)); }
public async Task <IActionResult> GridStateChange(PermissionPostModel model) { HttpResponseModel response = await HttpClientAsync.Async <IList <Permission> >(PermissionRoute.Search, model); PermissionGridConfiguration configuration = new PermissionGridConfiguration(response); return(this.GridConfiguration(configuration)); }
/// <summary> /// The Index. /// </summary> /// <returns>A IActionResult.</returns> public async Task <IActionResult> Index() { var model = await HttpClientAsync.Async <IList <LogModel> >(LogRoute.Index); LogIndex <LogModel, LogPostModel> table = new LogIndex <LogModel, LogPostModel>(model); return(this.SearchGridConfiguration(table)); }
public async Task <IActionResult> Index() { var model = await HttpClientAsync.Async <IList <UserModel> >(UserRoute.Index, this.Authentication); UserIndex <UserModel, UserPostModel> table = new UserIndex <UserModel, UserPostModel>(model); return(this.SearchGridConfiguration(table)); }
/// <summary> /// The Index. /// </summary> /// <returns>A IActionResult.</returns> public async Task <IActionResult> Index() { var model = await HttpClientAsync.Async <IList <Permission> >(PermissionRoute.Index); PermissionIndex table = new PermissionIndex(model); return(this.SearchGridConfiguration(table)); }
public async Task <IActionResult> RoleDataList(string name) { HttpResponseModel model = await HttpClientAsync.Async <IList <Role> >(DataListRoute.GetRoleDataList, name); IList <Role> roles = (IList <Role>)model.Data; return(this.DataListContent(roles, o => o.Id, o => o.Name)); }
public async Task TestGetTokenWithDynamicObject() { var data = await HttpClientAsync.Async(AuthenticationRoute.Auth, new { username = "******", password = "******" }); int code = data.code; Assert.AreEqual(code, (int)HttpStatusCode.OK); }
/// <summary> /// The index page. /// </summary> /// <returns>A IActionResult.</returns> public async Task <IActionResult> Index() { var responseModel = await HttpClientAsync.Async <IList <Icon> >(IconRoute.Index); IconIndex <IconPostModel> index = new IconIndex <IconPostModel>(responseModel); return(SearchGridConfiguration(index)); }
public async Task <IActionResult> GridStateChange(RolePostModel model) { var response = await HttpClientAsync.Async <IList <RoleModel> >(RoleRoute.Search, model); RoleViewConfiguration <RoleModel> configuration = new RoleViewConfiguration <RoleModel>(response); return(this.GridConfiguration(configuration)); }
public async Task <IActionResult> EditDialog(int id) { HttpResponseModel model = await HttpClientAsync.Async <RoleModel>(RoleRoute.FindById, id); RoleModel user = (RoleModel)model.Data; EditRoleDialogConfiguration <RoleEditPostModel, RoleModel> dialog = new EditRoleDialogConfiguration <RoleEditPostModel, RoleModel>(user); return(this.Dialog(dialog)); }
public async Task <IActionResult> EditDialog(int id) { HttpResponseModel model = await HttpClientAsync.Async <MenuModel>(MenuRoute.FindById, id); MenuModel menuModel = (MenuModel)model.Data; EditMenuDialogConfiguration <MenuEditPostModel, MenuModel> dialog = new EditMenuDialogConfiguration <MenuEditPostModel, MenuModel>(menuModel); return(this.Dialog(dialog)); }
public async Task TestUserIndexAsync() { HttpResponseModel model = await HttpClientAsync.Async <IList <UserModel> >(UserRoute.Index, this.authentication); IList <UserModel> menus = (IList <UserModel>)model.Data; Assert.GreaterOrEqual(menus.Count, 0); Assert.AreEqual(model.Code, (int)HttpStatusCode.OK); }
public async Task TestUnAuthenticate() { using (HttpClient client = HttpClientAsync.CreateInstance()) { HttpResponseMessage response = await client.GetAsync(TestRoute.TestAuthentication); Assert.AreEqual(response.StatusCode, HttpStatusCode.Unauthorized); } }
public async Task TestAuthentication() { dynamic data = await HttpClientAsync.Async(TestRoute.TestAuthentication, this.authentication); Console.WriteLine(data); bool isAuthenticated = data.isAuthenticated; Assert.IsTrue(isAuthenticated); }
public async Task TestRoleFindByIdAsync() { HttpResponseModel model = await HttpClientAsync.Async <RoleModel>(RoleRoute.FindById, 1); RoleModel user = (RoleModel)model.Data; Assert.IsNotNull(user); Assert.AreEqual(model.Code, (int)HttpStatusCode.OK); }
public async Task TestLogIndexAsync() { HttpResponseModel model = await HttpClientAsync.Async <IList <LogModel> >(LogRoute.Index); IList <LogModel> menus = (IList <LogModel>)model.Data; Assert.GreaterOrEqual(menus.Count, 0); Assert.AreEqual(model.Code, (int)HttpStatusCode.OK); }
public async Task <IActionResult> RowContextMenu(int id) { HttpResponseModel model = await HttpClientAsync.Async <RoleModel>(RoleRoute.FindById, data : id); RoleModel user = (RoleModel)model.Data; RoleRowContextMenu menu = new RoleRowContextMenu(user); return(this.Content(menu.Render(), "text/html", Encoding.UTF8)); }
public async Task TestPostWithParameterAsync() { HttpResponseModel model = await HttpClientAsync.Async <IList <LogModel> >(LogRoute.Search, new LogPostModel() { PageSize = 10, PageIndex = 1 }); Assert.AreEqual(model.Code, (int)HttpStatusCode.OK); }
public async Task TestGetMenuDataListAsync() { HttpResponseModel model = await HttpClientAsync.Async <IList <MenuModel> >(DataListRoute.GetMenuDataList); IList <MenuModel> menus = (IList <MenuModel>)model.Data; Assert.GreaterOrEqual(menus.Count, 0); Assert.AreEqual(model.Code, (int)HttpStatusCode.OK, UnitTestResource.TestGetMenuDataList); }
public async Task <IActionResult> RowContextMenu(int id) { HttpResponseModel model = await HttpClientAsync.Async <MenuModel>(MenuRoute.FindById, id); MenuModel menuModel = (MenuModel)model.Data; MenuRowContextMenu menu = new MenuRowContextMenu(menuModel); return(this.Content(menu.Render(), "text/html", Encoding.UTF8)); }
public static async Task <T> ShowAllServicesAsync <T>() { var routeInfo = new RouteInfo { HttpMethods = "GET", Path = ShowAllServices, }; return(await HttpClientAsync.Async <T>(routeInfo)); }
public static async Task <T> Get_0_Constraint_0_ParamerterAsync <T>() { var routeInfo = new RouteInfo { HttpMethods = "GET", Path = Get_0_Constraint_0_Paramerter, }; return(await HttpClientAsync.Async <T>(routeInfo)); }