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

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

            //string sql = @"
            //    SELECT [business_partner_no], [product_no0], [product_no1], [product_no2], [actual_quantity_received], 
            //        [stock_receipt_date], [invoice_no], [seq_no], [order_no], [id] FROM [ExportInbound]
            //    WHERE status_export = " + StatusExport + @"              
            //    ";

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

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