示例#1
0
文件: Simulation.cs 项目: Ricium/Wetu
        private void SetCompanies()
        {
            int[] companies = GetCompanies();

            Company ins;
            for(int i=0; i<companies.Length; i++)
            {
                ins = new Company(companies[i], this.PostUrl);
                this.WetuSystem.Add(ins);
            }
        }
示例#2
0
文件: Simulation.cs 项目: Ricium/Wetu
        public void AddCompany()
        {
            string Name = GenerateRandomString(8);
            var values = new NameValueCollection();
            values["CompanyName"] = Name;

            int result = post.GetDataInstance<int>(this.PostUrl + URLs.AddCompany, values);

            if(result != 0)
            {
                Company ins = new Company(result, this.PostUrl);
                this.WetuSystem.Add(ins);
                Console.WriteLine("Company Added: " + result.ToString());
            }
            else
            {
                Console.WriteLine("Failed to insert Company");
            }
        }