using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WebApi
{
    class Z_Save_Tag
    {
        public int ID;
        public string OpName;
        public string TagID;
        public string Value;
        public string KeepTime;
        public string OperationTime;
        public string ProjectCode;
        public Z_Save_Tag()
        {

        }
        public static List<Z_Save_Tag> DataTableToClass(DataTable dt_Z_Save_Tag)
        {
            List<Z_Save_Tag> z_Save_TagList = new List<Z_Save_Tag>();
            Z_Save_Tag z_Save_Tag;
            for (int i = 0; i < dt_Z_Save_Tag.Rows.Count; i++)
            {
                z_Save_Tag = new Z_Save_Tag();
                
                var row = dt_Z_Save_Tag.Rows[i];
                z_Save_Tag.ID = Convert.ToInt32(row["ID"]);
                z_Save_Tag.OpName = row["OpName"].ToString();
                z_Save_Tag.TagID = row["TagID"].ToString();
                z_Save_Tag.Value = row["Value"].ToString();
                z_Save_Tag.KeepTime = row["KeepTime"].ToString();
                z_Save_Tag.OperationTime = row["OperationTime"].ToString();
                z_Save_Tag.ProjectCode = row["ProjectCode"].ToString();

                z_Save_TagList.Add(z_Save_Tag);
            }

            return z_Save_TagList;
        }
    }
}
