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

using System.Data;

namespace WebApi
{
    class Z_Save_Position
    {
        public int ID;
        public string OpName;
        public string Value;
        public string OperationTime;
        public string ProjectCode;

        public Z_Save_Position() { }

        public static List<Z_Save_Position> DataTableToClass(DataTable dt_Z_Save_Position)
        {
            List<Z_Save_Position> z_Save_PositionList = new List<Z_Save_Position>();
            Z_Save_Position z_Save_Position;
            for (int i = 0; i < dt_Z_Save_Position.Rows.Count; i++)
            {
                z_Save_Position = new Z_Save_Position();
                var row = dt_Z_Save_Position.Rows[i];
                z_Save_Position.ID = Convert.ToInt32(row["ID"]);
                z_Save_Position.OpName = row["OpName"].ToString();
                z_Save_Position.Value = row["Value"].ToString();
                z_Save_Position.OperationTime = row["OperationTime"].ToString();
                z_Save_Position.ProjectCode = row["ProjectCode"].ToString();
                z_Save_PositionList.Add(z_Save_Position);
            }

            return z_Save_PositionList;
        }
    }
}
