﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace xEntry
{
    public class Dataexploitation
    {
        private int _id_dataexp;

        public int Id_dataexp
        {
            get { return _id_dataexp; }
            set { _id_dataexp = value; }
        }

        private string _id_asso;

        public string Id_asso
        {
            get { return _id_asso; }
            set { 
                if(value.ToString().Equals("")) throw new Exception("L\'id association ne peut etre null");
                _id_asso = value; }
        }
        private string _id_season;

        public string Id_season
        {
            get { return _id_season; }
            set { 
                if(value.ToString().Equals("")) throw new Exception("L\'id de la saison ne peut etre null");
                _id_season = value; }
        }
        private double _age_plant;

        public double Age_plant
        {
            get { return _age_plant; }
            set { _age_plant = value; }
        }
        private string _id_agent;

        public string Id_agent
        {
            get { return _id_agent; }
            set {
                if (value.ToString().Equals("")) throw new Exception("L\'id agent ne peut etre null");
                _id_agent = value; }
        }

        private DateTime? _datefield;
        public DateTime? Datefield
        {
            get { return _datefield; }
            set
            {
                DateTime d = new DateTime(2007, 1, 1);
                if (value.HasValue)
                {
                    if (DateTime.Compare(value.Value, d) < 0)
                        throw new Exception("La date ne peut etre inferieur a 2007 !");
                    if (DateTime.Compare(value.Value, DateTime.Today) < 0)
                        throw new Exception("La date de prise ne peut etre superieur a la date /n d'aujourd'hui !");
                }
                _datefield = value;
            }
        }
        private double _superficie;

        public double Superficie
        {
            get { return _superficie; }
            set { _superficie = value; }
        }
        private int _lignenumero;

        public int Lignenumero
        {
            get { return _lignenumero; }
            set { _lignenumero = value; }
        }
        private double _longueurligne;

        public double Longueurligne
        {
            get { return _longueurligne; }
            set { _longueurligne = value; }
        }
        private string _pentefield;

        public string Pentefield
        {
            get { return _pentefield; }
            set { _pentefield = value; }
        }
        private string _relieffield;

        public string Relieffield
        {
            get { return _relieffield; }
            set { _relieffield = value; }
        }
        private string _solfield;

        public string Solfield
        {
            get { return _solfield; }
            set { _solfield = value; }
        }

        

        

        

    }
}
