示例#1
0
        public bool TestConnection(bool notify)
        {
            Cursor.Current = Cursors.WaitCursor;
            WebImporter wi  = new WebImporter();
            bool        bok = wi.TestWebServer(this.WebServer);

            if (notify)
            {
                if (!bok)
                {
                    MessageBox.Show("Cannot connect to the server!");
                }
                else
                {
                    MessageBox.Show("Connection Successful!");
                }
            }
            return(bok);
        }
示例#2
0
        static void Main(string[] args)
        {
            WebImporter wi = new WebImporter();

            Console.WriteLine("Enter web address:");
            string web = Console.ReadLine();

            if (string.IsNullOrEmpty(web))
            {
                web = @"http://*****:*****@"C:\Users\svan\Downloads\Petrel\wells2.txt", @"C:\Users\svan\Downloads\Petrel\PetrelTest.mig");

            Console.WriteLine("Task ID:" + taskid);

            Console.WriteLine("Session ID:");
            Console.WriteLine(wi.GetSession(web, usr, pas));

            Console.WriteLine("Output name:");
            string output = Console.ReadLine();

            if (string.IsNullOrEmpty(output))
            {
                output = "PetrelSource";
            }

            Console.WriteLine("Output:");
            DataTable dt = wi.GetOutput(web, usr, pas, output);

            OutputTable(dt);

            Console.WriteLine("Well UWI:");
            string uwi = Console.ReadLine();

            if (string.IsNullOrEmpty(uwi))
            {
                uwi = dt.Rows[0][dt.Columns["UWI"].Ordinal].ToString();
            }

            Console.WriteLine("using uwi:" + uwi);
            string id = wi.GetWellID(web, usr, pas, uwi);

            Console.WriteLine("Found ID:" + id);

            Console.WriteLine("Survey - press key");
            Console.ReadKey();
            dt = wi.LoadSurvey(web, usr, pas, uwi);
            OutputTable(dt);

            Console.WriteLine("Production Monthly - press key");
            Console.ReadKey();
            dt = wi.LoadMonthlyProduction(web, usr, pas, uwi);
            OutputTable(dt);

            Console.WriteLine("Production Daily - press key");
            Console.ReadKey();
            dt = wi.LoadDailyProduction(web, usr, pas, uwi);
            OutputTable(dt);

            Console.ReadKey();
        }