Пример #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
        public List <WellTrajectory> ForWell(Well well)
        {
            List <WellTrajectory> records = new List <WellTrajectory>();

            try
            {
                WebImporter wi = new WebImporter();
                DataTable   dt = wi.LoadSurvey(dcInfo.WebServer, dcInfo.WebServerU, dcInfo.WebServerP, well.Uwi);
                foreach (DataRow dr in dt.Rows)
                {
                    var w = this.WellTrajectoryFromRow(dr);
                    records.Add(w);
                }
            }
            catch (Exception e)
            {
                PetrelLogger.InfoOutputWindow("Failed to load wells: " + e.ToString());
            }
            return(records);
        }
Пример #3
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();
        }