using System; using System.Collections.Generic; using System.Linq; using System.Net.Http; using System.Text; using System.Threading.Tasks; using Txgy.EWS.Client.IDAL; namespace Txgy.EWS.Client.DAL { public class RoleDal : WebDataAccess, IRoleDal { public Task GetAll() { return this.GetDatas($"{domain}role/all"); } public Task GetAllByUserId(int userId) { return this.GetDatas($"{domain}role/all/{userId}"); } public Task GetAllUsers(int roleId) { return this.GetDatas($"{domain}role/all_users/{roleId}"); } public Task Save(string role, string users, string menus) { Dictionary param = new Dictionary(); param.Add("role", new StringContent(role)); param.Add("users", new StringContent(users)); param.Add("menus", new StringContent(menus)); return this.PostDatas($"{domain}role/save", this.GetFormData(param)); } } }