Exemplo n.º 1
0
        public BrickItem getInstructions(string number)
        {
            BricksetAPIv2SoapClient bsAPI = new BricksetAPIv2SoapClient();
            var ret = bsAPI.getSets(apikey, "", "", "", "", $"{number}", "", "", "", "", "", "", "");

            if (ret == null)
            {
                return(null);
            }
            BrickItem retitem = new BrickItem();

            retitem.Number = number;
            retitem.Name   = ret[0].name;
            if (ret[0].instructionsCount > 0)
            {
                var instruct = bsAPI.getInstructions(apikey, ret[0].setID);
                retitem.Instructions = new SetInstruction[ret[0].instructionsCount];
                for (int i = 0; i < instruct.Length; i++)
                {
                    retitem.Instructions[i]      = new SetInstruction();
                    retitem.Instructions[i].Name = instruct[i].description;
                    retitem.Instructions[i].URL  = instruct[i].URL;
                }
            }
            retitem.BrickService = ServiceProvider.Brickset;
            retitem.ItemType     = ItemType.Set;
            retitem.Theme        = ret[0].theme;
            retitem.ThumbnailUrl = ret[0].thumbnailURL;
            int years;

            int.TryParse(ret[0].year, out years);
            retitem.YearReleased = years;
            retitem.BrickURL     = ret[0].bricksetURL;
            return(retitem);
        }
Exemplo n.º 2
0
        public BrickItem getSets(string number)
        {
            BricksetAPIv2SoapClient bsAPI = new BricksetAPIv2SoapClient();
            var ret = bsAPI.getSets(apikey, "", "", "", "", $"{number}", "", "", "", "", "", "", "");

            if (ret == null)
            {
                return(null);
            }
            BrickItem retitem = new BrickItem();

            retitem.Number       = number;
            retitem.Name         = ret[0].name;
            retitem.BrickService = ServiceProvider.Brickset;
            retitem.ItemType     = ItemType.Set;
            retitem.Theme        = ret[0].theme;
            retitem.ThumbnailUrl = ret[0].thumbnailURL;
            retitem.BrickURL     = ret[0].bricksetURL;
            int years;

            int.TryParse(ret[0].year, out years);
            retitem.YearReleased = years;
            return(retitem);
        }