using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Services;
using Microsoft.VisualBasic;
using System.Data.SqlClient;

using System.Net.Mail;

//using ESRI.ArcGIS;
//using ESRI.ArcGIS.esriSystem;
//using ESRI.ArcGIS.Geodatabase;
//using ESRI.ArcGIS.Geometry;
//using ESRI.ArcGIS.DataSourcesGDB;
//using ESRI.ArcGIS.DataSourcesFile;
using System.Data;
using System.Configuration;
using System.Threading;


//using ESRI.ArcGIS.ADF;
namespace VMT
{
    public partial class MapViewer : System.Web.UI.Page
    {
        
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        //private static double[] getfeatureMidpoint(IFeatureClass featureClass, string PROJECTCODE, string SECTIONCODE)
        //{

        //    double[] latlong = new double[] { 0, 0 };

        //    try
        //    {
        //        Polygon pPolygon = new Polygon();
        //        // Define a constraint on the features to be deleted.
        //        IQueryFilter queryFilter = new QueryFilterClass
        //        {
        //            WhereClause = "PROJECTCODE = '" + PROJECTCODE + "' AND SECTIONCODE '" + SECTIONCODE + "'" 
        //        };

        //        // Create a ComReleaser for cursor management.

        //        using (ComReleaser comReleaser = new ComReleaser())
        //        {
        //            // Create and manage a cursor.
        //            IFeatureCursor searchCursor = featureClass.Search(queryFilter, false);
        //            comReleaser.ManageLifetime(searchCursor);

        //            // Delete the retrieved features.
        //            IFeature feature = null;
        //            while ((feature = searchCursor.NextFeature()) != null)
        //            {
        //                // feature.Delete();


        //                Point ipoint;
        //                IArea pArea = (IArea)feature.Shape;
        //                ipoint = (Point)pArea.Centroid;

        //                IGeometry geom = (IGeometry)ipoint;
        //                ISpatialReferenceFactory pSpatialRefFactory = new SpatialReferenceEnvironmentClass();
        //                IGeographicCoordinateSystem pGeographicCoordSys = pSpatialRefFactory.CreateGeographicCoordinateSystem((int)esriSRGeoCSType.esriSRGeoCS_NAD1983);
        //                ISpatialReference pSpatialRef = (ISpatialReference)pGeographicCoordSys;

        //                geom.Project(pSpatialRef);

        //                double lat = System.Math.Round(ipoint.X, 5);
        //                double lng = System.Math.Round(ipoint.Y, 5);




        //                latlong = new double[] { lat, lng };
        //                return latlong;



        //            }
        //        }
        //        return latlong;
        //    }
        //    catch (Exception ex)
        //    {
        //       // ErrorMessage("Error in UGP_GIS()", "DeleteProject(string SQLSERVERPROJECTID) in UGP_GIS.ProjectViewer.aspx", ex);
        //        return latlong;
        //    }

        //}
    }
}