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

namespace lib.datasource
{
    internal class ExportOutbound
    {
        private static IniFile ini = new IniFile("Linkage_data.ini");
        private static string strTableName = ini.Read("FCT91", "Table");
        private readonly string TABLE = strTableName; //"ExportOutbound";
        public static List<Object[]> GetExportOutboundDataSelect(Int16 StatusExport)
        {
            DbTableExportOutbound dbTable = new DbTableExportOutbound();

            //string sql = @"
            //    SELECT [order_no], [routing_no], [product_no0], [product_no1], [product_no2], [qty_actual_goods_issued], 
            //        [output_date], [production_date], [work_instructions_no], [seq_no], [id] FROM [ExportOutbound]
            //    WHERE status_export = " + StatusExport + @"              
            //    ";

            string sql = @"
                SELECT " + ini.Read("Col2", "ColFCT91") + @", " + ini.Read("Col3", "ColFCT91") + @", " +
                    ini.Read("Col4", "ColFCT91") + @", " + ini.Read("Col5", "ColFCT91") + @", " +
                    ini.Read("Col6", "ColFCT91") + @", " + ini.Read("Col7", "ColFCT91") + @", " +
                    ini.Read("Col8", "ColFCT91") + @", " + ini.Read("Col9", "ColFCT91") + @", " +
                    ini.Read("Col10", "ColFCT91") + @", " + ini.Read("Col11", "ColFCT91") + @", " +
                    ini.Read("Col1", "ColFCT91") + @" FROM " + strTableName +
                    @" WHERE " + ini.Read("Col12", "ColFCT91") + @" = " + StatusExport + @"              
                ";

            List<Object[]> rows = dbTable.executeQuery(sql);
            return rows;
        }
    }
}
