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 MenuDal : WebDataAccess, IMenuDal { public Task GetMenus(int roleId) { return this.GetDatas($"{domain}menu/list?roleid={roleId}"); } public Task GetAllMenus() { return this.GetDatas($"{domain}menu/all"); } public Task SaveMenu(string data) { StringContent content = new StringContent(data); content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/json"); return this.PostDatas($"{domain}menu/save", content); } public Task DeleteMenu(int menuId) { Dictionary values = new Dictionary(); values.Add("menuId", new StringContent(menuId.ToString())); return this.PostDatas($"{domain}menu/del", this.GetFormData(values)); } } }