using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;
using System.Data;
using System.Windows.Forms;

namespace WriteSample
{
    public class FH_Write
    {
        public FH_Write()
        {
        }

        public void FlowHeater_SetDataTable(DataTable dt)
        {
            /*
             *  This function is called when no parameters are defined
             */
            MessageBox.Show("WriteSample, " + dt.Rows.Count.ToString() + " rows processed", "WriteSample.DLL", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }

        public void FlowHeater_SetDataTable(DataTable dt, StringDictionary parameter)
        {
            /*
             * This function is called when there are parameters defined
             */

            StringBuilder sb = new StringBuilder();
            sb.AppendLine("WriteSample, " + dt.Rows.Count.ToString() + " rows procesed");
            sb.AppendLine();
            sb.AppendLine("Parameter:");

            string server = parameter["Server"];

            foreach (string key in parameter.Keys)
                sb.AppendLine(key + " = " + parameter[key]);            

            MessageBox.Show(sb.ToString(), "WriteSample.DLL", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
    }
}
