Example #1
0
        public string CreateWithMultiple(CustomUser user, List <int> product_ids)
        {
            string result;

            result = order_ctr.Create(user.Username, product_ids);
            rmq_special.NewOrders(user.Username);
            return(result);
        }
Example #2
0
        public string TestOrders(int index)
        {
            string     result;
            CustomUser user;

            Console.WriteLine("Creating User");
            user = new CustomUser
            {
                Username = "******" + index.ToString(),
                Password = "******",
                Email    = "*****@*****.**",
                Wallet   = 250000,
                IsActive = true,
                LoggedIn = false
            };

            Console.WriteLine("Saving User");
            ctr_user.Create(user);

            Console.WriteLine("saving order and send message");
            result = ctr_order.Create(user.Username, products);
            rmq_specialcalls.NewOrders(user.Username);

            return(result);
        }
Example #3
0
        /// <summary>
        /// Creates an order.
        /// </summary>
        /// <param name="informations"></param>
        public void CreateOrder(List <string> informations)
        {
            int        index    = 0;
            string     username = "";
            List <int> products = new List <int>();

            while (index < informations.Count)
            {
                if (index < 1)
                {
                    username = informations[index];
                }

                else
                {
                    products.Add(Int32.Parse(informations[index]));
                }

                index++;
            }

            Console.WriteLine("Create order: " + ctr_order.Create(username, products));
        }