﻿using System;
using System.Collections.Generic;
using System.Text;

namespace IndianHealthService.BMXNet.Tests
{
    public class TestTable
    {
        private string _commandRpc = "BMX TEST ADO";

        public string CommandRpc
        {
            get { return _commandRpc; }
            set { _commandRpc = value; }
        }

        private string _header = "";

        public string Header
        {
            get { return _header; }
            set { _header = value; }
        }
        private string _rowData = "";

        public string RowData
        {
            get { return _rowData; }
            set { _rowData = value; }
        }
        private int _repeat = 1;

        public int Repeat
        {
            get { return _repeat; }
            set { _repeat = value; }
        }
        private int _hangtime = 0;

        public int Hangtime
        {
            get { return _hangtime; }
            set { _hangtime = value; }
        }

        private String _asyncId = "";

        public String AsyncId
        {
            get { return _asyncId; }
            set { _asyncId = value; }
        }

        public static TestTable TypicalTableFetch()
        {

            TestTable typical = new TestTable();
            typical.Header = "D00010DOB|T00030NAME|T00010SEX";
            typical.RowData = "NOV 13, 2002|SMITH, JOHN|MALE";
            typical.Repeat = 10;
            return typical;
        }

        public string AsyncCommand(String anId,int aDelay) {
            this.AsyncId=anId;
            this.Hangtime=aDelay;

            return this.Command();
        }

        public String Command()
        {
            return this.CommandRpc + "^" + this.Header + "^" + this.RowData + "^" + this.Repeat + "^" + this.Hangtime.ToString() + "^" + this.AsyncId ;
        }
    }
}
