Exemplo n.º 1
0
        public IBoxCommand AddBoxCommand(string id)
        {
            var cmd = new BoxCommand();

            commands.Add(id, cmd);
            return(cmd);
        }
Exemplo n.º 2
0
        public static string HandleBoxCmd(string cmd, bool withproduct, string jlid, string boxip, int slidenumber)
        {
            BoxCommand commandToBeSent = default(BoxCommand);
            Random rnd = new Random();

            String thejlid = null;
            if ((!withproduct))
            {
                thejlid = "";
            }
            else
            {
                if ((jlid.Equals("")))
                {
                    thejlid = rnd.Next(1000, 100000).ToString();
                }
                else
                {
                    thejlid = jlid;
                }
            }

            ProductInBoxInfo theproduct = new ProductInBoxInfo
            {
                jlid = thejlid,
                test_result = "not_tested"
            };
            commandToBeSent = new BoxCommand
            {
                cmd = cmd,
                products = new ProductInBoxInfo[] { theproduct }
            };
            String response = PostCmd(string.Format("http://{0}/slide{1}/command", boxip, slidenumber.ToString()), commandToBeSent);
            return response;
        }
 public void setcommand(BoxCommand command)
 {
     this.taxes_command = command;
 }