예제 #1
0
        public static async Task <List <User> > GetAllUsers(string role)
        {
            var res = await FetchApi.GetAsync <List <User>, UserErrorMessage>("user");

            if (res == null || !res.IsSuccess)
            {
                return(null);
            }

            List <User> users = new List <User>();

            foreach (User item in res.Data)
            {
                if (item.RoleName.Equals(role))
                {
                    users.Add(item);
                }
            }

            return(users);
        }
        public static async Task <ServerResponse <Order, OrderErrorMessage> > GetOrderByID(int orderID)
        {
            var res = await FetchApi.GetAsync <Order, OrderErrorMessage>($"orders/{orderID}");

            return(res);
        }
        public static async Task <ServerResponse <List <Order>, OrderErrorMessage> > GetAllOrders()
        {
            var res = await FetchApi.GetAsync <List <Order>, OrderErrorMessage>("orders");

            return(res);
        }
        public static async Task <ServerResponse <Catalog, CatalogErrorMessage> > GetCatalogByID(int catalogID)
        {
            var res = await FetchApi.GetAsync <Catalog, CatalogErrorMessage>($"catalogs/{catalogID}");

            return(res);
        }
        public static async Task <ServerResponse <List <Catalog>, CatalogErrorMessage> > GetAllCatalogs()
        {
            var res = await FetchApi.GetAsync <List <Catalog>, CatalogErrorMessage>("catalogs");

            return(res);
        }
예제 #6
0
        public static async Task <ServerResponse <User, UserErrorMessage> > GetUserByID(int userID)
        {
            var res = await FetchApi.GetAsync <User, UserErrorMessage>($"user/{userID}");

            return(res);
        }
        public static async Task <ServerResponse <Product, ProductErrorMessage> > GetProductByID(int productID)
        {
            var res = await FetchApi.GetAsync <Product, ProductErrorMessage>($"products/{productID}");

            return(res);
        }
        public static async Task <ServerResponse <List <Product>, ProductErrorMessage> > GetAllProducts()
        {
            var res = await FetchApi.GetAsync <List <Product>, ProductErrorMessage>("products");

            return(res);
        }
예제 #9
0
        public static async Task <ServerResponse <Combo, ComboErrorMessage> > GetComboByID(int comboID)
        {
            var res = await FetchApi.GetAsync <Combo, ComboErrorMessage>($"combos/{comboID}");

            return(res);
        }
예제 #10
0
        public static async Task <ServerResponse <List <Combo>, ComboErrorMessage> > GetAllCombos()
        {
            var res = await FetchApi.GetAsync <List <Combo>, ComboErrorMessage>("combos");

            return(res);
        }