using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace SMAT_CE
{
    public partial class FrmSelectMonitor : FormBase
    {
        public FrmSelectMonitor()
        {
            InitializeComponent();
            test();
            this.Text = "Selected Monitor";
        }

        public void setData(string lat,string lon, string field,double value)
        {
            _lat = lat;
            _long = lon;
            fieldName = field;
            fieldValue = value;
            test();
            
        }

        private string id = "000";
        private string _lat = "000";
        private string _long = "000";
        private string fieldName = "000";
        private double fieldValue = 0;
        private string fileName = "000";

        private void test()
        {
            DataTable dt = new DataTable();
            dt.Columns.Add("Field", typeof(string));
            dt.Columns.Add("Value", typeof(string));
            
            DataRow _dr = dt.NewRow();
            //_dr[0] = "id";
            //_dr[1] = id;
            //dt.Rows.Add(_dr);

            //_dr = dt.NewRow();
            _dr[0] = "lat";
            _dr[1] = _lat;
            dt.Rows.Add(_dr);

            _dr = dt.NewRow();
            _dr[0] = "long";
            _dr[1] = _long;
            dt.Rows.Add(_dr);

            _dr = dt.NewRow();
            _dr[0] = fieldName;
            _dr[1] = fieldValue;
            dt.Rows.Add(_dr);

            dgvGridInfo.DataSource = dt;
            dgvGridInfo.AutoResizeColumn(0);
        }

        private void FrmSelectMonitor_Paint(object sender, PaintEventArgs e)
        {
            //this.Text = this.Location.X + ", " + this.Location.Y;
        }

        private void FrmSelectMonitor_Move(object sender, EventArgs e)
        {
            //this.Text = this.Location.X + ", " + this.Location.Y;
        }

        private void FrmSelectMonitor_Deactivate(object sender, EventArgs e)
        {
            this.Close();
        }

        private void FrmSelectMonitor_Leave(object sender, EventArgs e)
        {

        }
    }
}
