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

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

            //string sql = @"
            //    SELECT [warehouse_code1], [warehouse_code2], [warehouse_code3], [product_no0], [product_no1], [product_no2], 
            //        [production_date], [qty_in_stock], [stock_measurement_date], [shelf_bin], [stock_unit], [id] FROM [ExportInventory]
            //    WHERE status_export = " + StatusExport + @"              
            //    ";

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

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

    }
}
