static void Main_TestATPCTPConfirm()
        {
            String ConStrCustom;
            String ConstrStd;
            string WarningMsg = string.Empty;

            Cls_Connection t = new Cls_Connection();

            ConStrCustom = t.GetConnectionString_Custom();
            ConstrStd    = t.GetConnectionString_Std();

            d = new ATPCTP(ConStrCustom, ConstrStd);
            clsDTConfirm DTConfirm = new clsDTConfirm {
                SolutionId = 3296, Quantity = 35
            };

            DTConfirm.AddRow();

            if (d.Confirm(DTConfirm, UserID: 0, ref WarningMsg) == true)
            {
                Console.WriteLine($"Confirm process is success");
            }
            else
            {
                Console.WriteLine($"WarningMsg:{WarningMsg}");
            }
        }
        static void Main_TestSplitItem()
        {
            DataSet ds;
            string  Msg = string.Empty;
            String  ConStrCustom;
            String  ConstrStd;

            Cls_Connection t = new Cls_Connection();

            ConStrCustom = t.GetConnectionString_Custom();
            ConstrStd    = t.GetConnectionString_Std();

            clsDTSplitItem dtInput = new clsDTSplitItem();

            dtInput.OrderItemId    = 1000000245;
            dtInput.ItemNo         = 10;
            dtInput.RequestReamQty = 40;
            // dtInput.RequestDate = DateTime.Parse("2019/9/7");
            dtInput.AddRow();

            dtInput.OrderItemId    = -1;
            dtInput.ItemNo         = 0;
            dtInput.RequestReamQty = 40;
            dtInput.RequestDate    = DateTime.Parse("2019/9/7");
            dtInput.AddRow();

            SplitItem sp = new SplitItem(ConStrCustom, ConstrStd);

            ds = sp.Request(dtInput, 0, ref Msg);

            if (Msg.Length > 0)
            {
                Console.WriteLine($@"{Msg}");
            }
        }
        static void Main_TestATPCTPRequest()
        {
            String ConStrCustom;
            String ConstrStd;
            int    @UserID;

            UserID = 99;

            Cls_Connection t = new Cls_Connection();

            ConStrCustom = t.GetConnectionString_Custom();
            ConstrStd    = t.GetConnectionString_Std();
            DateTime OrderreqDate = DateTime.Today.AddDays(-1); // DateTime.Parse("2019/8/31"); //DateTime.Today.AddDays(1d);

            d = new ATPCTP(ConStrCustom, ConstrStd);


            clsDTOrder dtOrder = new clsDTOrder {
                Id = 1000000290, Ordernumber = "TON19082401", OrderHierarchyID = 1000000065, BillToID = 1000036, PoNumber = "PO-xxx", ShipToID = 222, ContractID = 123, Remark = "Test Remark", UserID = UserID
            };

            dtOrder.AddRow();

            clsDTOrderItem dtOrderItem = new clsDTOrderItem {
                Id = -1, OrderID = 1000000290, ItemNumber = 10, MaterialID = 1000009520, ShiptoID = 111, ContractID = 222, RequestQTY_OrdU = 20, RequestDate = OrderreqDate, UserID = UserID
            };

            dtOrderItem.AddRow();

            //ds = d.Request(1, 10, new DateTime (2019,6/7), 1, 0); old one 1000009524
            try
            {
                string ErrMsg = String.Empty;
                ds = d.Request(dtOrder, dtOrderItem, 1000000002, ref ErrMsg);

                Console.WriteLine("done for " + ConStrCustom);
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error found:" + ex.Message);
            }
        }
        static void Main_TestPLSRelease()
        {
            String ConStrCustom;
            String ConstrStd;
            string WarningMsg = string.Empty;


            Cls_Connection t = new Cls_Connection();

            ConStrCustom = t.GetConnectionString_Custom();
            ConstrStd    = t.GetConnectionString_Std();
            PLSInterface d = new PLSInterface(ConStrCustom, ConstrStd);

            d.OperationID = 1000000110; d.AddRow();
            //d.OperationID = 1000000049; d.AddRow();
            if (d.ExportData(ref WarningMsg) == false)
            {
                Console.WriteLine($"Export problem with reason:{WarningMsg}");
            }
        }
        static void Main_TestATPCTPForceUpdate()
        {
            String ConStrCustom;
            String ConstrStd;
            int    UserID = 0;

            Cls_Connection t = new Cls_Connection();

            ConStrCustom = t.GetConnectionString_Custom();
            ConstrStd    = t.GetConnectionString_Std();
            DateTime OrderreqDate = DateTime.Today.AddDays(5d);

            d = new ATPCTP(ConStrCustom, ConstrStd);



            clsDTOrder dtOrder = new clsDTOrder
            {
                Id               = 1000000290,
                Ordernumber      = "TON19082401",
                OrderHierarchyID = 1000000065,
                BillToID         = 3,
                PoNumber         = "po-ssss",
                ShipToID         = 0,
                ContractID       = 0,
                Remark           = "Test Remark",
                UserID           = UserID
            };

            dtOrder.AddRow();

            clsDTOrderItem dtOrderItem = new clsDTOrderItem
            {
                Id              = 1000001305,
                OrderID         = 1000000290,
                ItemNumber      = 10,
                MaterialID      = 1000009605,
                ShiptoID        = 0,
                ContractID      = 0,
                RequestQTY_OrdU = 60,
                RequestDate     = OrderreqDate,
                UserID          = UserID
            };

            dtOrderItem.AddRow();


            try
            {
                string ErrMsg = string.Empty;
                ds = d.Request(dtOrder, dtOrderItem, 1000000008, ref ErrMsg);
                if (ErrMsg.Length > 0)
                {
                    Console.WriteLine($"Warning:{ErrMsg}");
                }
                else
                {
                    Console.WriteLine("done for " + ConStrCustom);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error found:" + ex.Message);
            }
        }
        static void Main_TestATPCTPRequest2()
        {
            String ConStrCustom;
            String ConstrStd;
            int    UserID = 0;

            Cls_Connection t = new Cls_Connection();

            ConStrCustom = t.GetConnectionString_Custom();
            ConstrStd    = t.GetConnectionString_Std();
            DateTime OrderreqDate = DateTime.Today.AddDays(1d);

            d = new ATPCTP(ConStrCustom, ConstrStd);


            //clsDTOrder dtOrder = new clsDTOrder { Id = 1000000070, Ordernumber = "OD-190727-0004", OrderHierarchyID = 1000000065, BillToID = 5, PoNumber = "PO-xxx", ShipToID = 222, ContractID = 123, Remark = "Test Remark", UserID = 99 };
            //dtOrder.AddRow();

            //clsDTOrderItem dtOrderItem = new clsDTOrderItem { Id = -1, OrderID = 1000000070, ItemNumber = 10, MaterialID = 1000000034, ShiptoID = 111, ContractID = 222, RequestQTY_OrdU = 20, RequestDate = OrderreqDate };
            //dtOrderItem.AddRow();

            //ds = d.Request(1, 10, new DateTime (2019,6/7), 1, 0);

            //clsDTOrder dtOrder = new clsDTOrder
            //{
            //    Id = 1000000070,
            //    Ordernumber = "OD-190727-0004",
            //    OrderHierarchyID = 1000000065,
            //    BillToID = 5,
            //    PoNumber = "po-ppppp",
            //    ShipToID = 0,
            //    ContractID = 0,
            //    Remark = "ssss",
            //    UserID = UserID
            //};
            //dtOrder.AddRow();

            //clsDTOrderItem dtOrderItem = new clsDTOrderItem
            //{
            //    Id = -1,
            //    OrderID = 1000000070,
            //    ItemNumber = 10,
            //    MaterialID = 1000000034,
            //    ShiptoID = 111,
            //    ContractID = 222,
            //    RequestQTY_OrdU = 20,
            //    RequestDate = OrderreqDate,
            //    InsertUserID = UserID

            //};
            //dtOrderItem.AddRow();

            clsDTOrder dtOrder = new clsDTOrder
            {
                Id               = 1000000147,
                Ordernumber      = "OD-190731-0014",
                OrderHierarchyID = 1000000065,
                BillToID         = 3,
                PoNumber         = "po-ssss",
                ShipToID         = 0,
                ContractID       = 0,
                Remark           = "Test Remark",
                UserID           = UserID
            };

            dtOrder.AddRow();

            clsDTOrderItem dtOrderItem = new clsDTOrderItem
            {
                Id              = -1,
                OrderID         = 1000000128,
                ItemNumber      = 0,
                MaterialID      = 1000000034,
                ShiptoID        = 0,
                ContractID      = 0,
                RequestQTY_OrdU = 10,
                RequestDate     = new DateTime(2019, 8, 9),
                UserID          = UserID
            };

            dtOrderItem.AddRow();


            try
            {
                string ErrMsg = string.Empty;
                ds = d.Request(dtOrder, dtOrderItem, 1000000002, ref ErrMsg);
                if (ErrMsg.Length > 0)
                {
                    Console.WriteLine($"Warning:{ErrMsg}");
                }
                else
                {
                    Console.WriteLine("done for " + ConStrCustom);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error found:" + ex.Message);
            }
        }