
namespace FAS_LIB
{
    public class scPlants
    {
        private int _PlantId;
        private string _PlantDesin;
        private string _PlantName;
        private string _PlantCity;
        private string _PlantState;
        private byte _PlantValue;
        private byte _PlantActive;

        public int PlantId
        {
            get
            {
                return this._PlantId;
            }
            set
            {
                this._PlantId = value;
            }
        }

        public string PlantDesin
        {
            get
            {
                return this._PlantDesin;
            }
            set
            {
                this._PlantDesin = value;
            }
        }

        public string PlantName
        {
            get
            {
                return this._PlantName;
            }
            set
            {
                this._PlantName = value;
            }
        }

        public string PlantCity
        {
            get
            {
                return this._PlantCity;
            }
            set
            {
                this._PlantCity = value;
            }
        }

        public string PlantState
        {
            get
            {
                return this._PlantState;
            }
            set
            {
                this._PlantState = value;
            }
        }

        public byte PlantValue
        {
            get
            {
                return this._PlantValue;
            }
            set
            {
                this._PlantValue = value;
            }
        }

        public byte PlantActive
        {
            get
            {
                return this._PlantActive;
            }
            set
            {
                this._PlantActive = value;
            }
        }

        public bool PlantActiveBool
        {
            get
            {
                return (int)this._PlantActive != 0;
            }
            set
            {
                if (!value)
                    this._PlantActive = (byte)0;
                else
                    this._PlantActive = (byte)1;
            }
        }

        public scLevels PlantLevel
        {
            get
            {
                return new scLevels() { LevelId = this._PlantId, LevelAbbrv = this._PlantDesin, LevelName = this._PlantName, LevelActive = this._PlantActive, LevelValue = this._PlantValue };
            }
            set
            {
                this._PlantId = value.LevelId;
                this._PlantDesin = value.LevelAbbrv;
                this._PlantName = value.LevelName;
                this._PlantActive = value.LevelActive;
                this._PlantValue = value.LevelValue;
            }
        }

        public scPlants()
        {
            this._PlantId = 0;
            this._PlantDesin = "";
            this._PlantName = "";
            this._PlantCity = "";
            this._PlantState = "";
            this._PlantValue = (byte)0;
            this._PlantActive = (byte)0;
        }

        public override string ToString()
        {
            return this._PlantDesin + " " + this._PlantName + " - " + this._PlantCity + ", " + this._PlantState;
        }
    }
}
