IOInfo.cs 1.5 KB
using System;

namespace Model
{
    public class IOInfo
    {
        public string Name { private set; get; }
        public string Type { private set; get; }
        public int Address { private set; get; }
        public string Key { private set; get; }
        public bool State { set; get; }
        public DateTime FinalDate { private set; get; }

        public IOInfo(string name, string type, string address, string key)
        {
            Name = name;
            Type = type.ToUpper();
            Address = Convert.ToInt32(address);
            Key = key;
            State = false;
            FinalDate = DateTime.Now;
        }

        public string ToText()
        {
            return string.Format("{0},{1},{2:yyyy-MM-dd HH:mm:ss}", Key, State, FinalDate);
        }
    }

    public class LineIOInfo
    {
        public string Name { private set; get; }
        public string IP { private set; get; }
        public int Address { private set; get; }
        public string Key { private set; get; }
        public bool LineCall { set; get; }
        public bool ShelfExist { set; get; }
        public DateTime FinalDate { set; get; }


        public LineIOInfo(string name, string ip, string address, string key)
        {
            Name = name;
            IP = ip;
            Address = Convert.ToInt32(address);
            Key = key;
            LineCall = false;
            ShelfExist = true;
            FinalDate = DateTime.Now;
        }
    }
}