Esempio n. 1
0
        private bool LoadForehist()
        {
            forehistTable.Columns.Add("Reference", System.Type.GetType("System.String"));
            forehistTable.Columns[0].MaxLength = 17;                //  1
            forehistTable.Columns.Add("Location", System.Type.GetType("System.String"));
            forehistTable.Columns[1].MaxLength = 3;                 //  18
            forehistTable.Columns.Add("Reference_Modling", System.Type.GetType("System.String"));
            forehistTable.Columns[2].MaxLength = 25;                //  21
            forehistTable.Columns.Add("Fournisseur", System.Type.GetType("System.String"));
            forehistTable.Columns[3].MaxLength = 8;                 //  46
            forehistTable.Columns.Add("Skip_Field3", System.Type.GetType("System.String"));
            forehistTable.Columns[4].MaxLength = 963;               //  54
            forehistTable.Columns.Add("Vendor", System.Type.GetType("System.String"));
            forehistTable.Columns[5].MaxLength = 8;                 //  1017
            forehistTable.Columns.Add("Planner", System.Type.GetType("System.String"));
            forehistTable.Columns[6].MaxLength = 8;                 //  1025
            forehistTable.Columns.Add("Multiple", System.Type.GetType("System.String"));
            forehistTable.Columns[7].MaxLength = 12;                //  1033
            forehistTable.Columns.Add("Skip_Field4", System.Type.GetType("System.String"));
            forehistTable.Columns[8].MaxLength = 18;                //  1045
            forehistTable.Columns.Add("ABC_Code", System.Type.GetType("System.String"));
            forehistTable.Columns[9].MaxLength = 1;                 //  1063
            forehistTable.Columns.Add("Skip_Field5", System.Type.GetType("System.String"));
            forehistTable.Columns[10].MaxLength = 57;               //  1064
            forehistTable.Columns.Add("On_Hand", System.Type.GetType("System.String"));
            forehistTable.Columns[11].MaxLength = 8;                //  1121

            return(VmiIO.LoadFile(customerDatabaseFolder + "\\" + FOREHIST_FILENAME, ref forehistTable));
        }
Esempio n. 2
0
        private bool LoadStock()
        {
            stockTable.Columns.Add("Reference", System.Type.GetType("System.String"));
            stockTable.Columns[0].MaxLength = 17;
            stockTable.Columns.Add("Skip_Field", System.Type.GetType("System.String"));
            stockTable.Columns[1].MaxLength = 3;               //  20

            for (int i = 0; i < 61; i++)
            {
                stockTable.Columns.Add("Stock_" + i.ToString().PadLeft(2, '0'), System.Type.GetType("System.String"));
                stockTable.Columns[2 + i].MaxLength = 8;
                stockTable.Columns[2 + i].Caption   = "Number";
            }

            return(VmiIO.LoadFile(customerDatabaseFolder + "\\EXPORT\\" + STOCK_FILENAME, ref stockTable));
        }
Esempio n. 3
0
        private bool LoadReceipts()
        {
            receiptsTable.Columns.Add("Reference", System.Type.GetType("System.String"));
            receiptsTable.Columns[0].MaxLength = 17;
            receiptsTable.Columns.Add("Location", System.Type.GetType("System.String"));
            receiptsTable.Columns[1].MaxLength = 3;
            receiptsTable.Columns.Add("Quantity", System.Type.GetType("System.String"));
            receiptsTable.Columns[2].MaxLength = 8;
            receiptsTable.Columns[2].Caption   = "Number";
            receiptsTable.Columns.Add("Filler", System.Type.GetType("System.String"));
            receiptsTable.Columns[3].MaxLength = 1;
            receiptsTable.Columns.Add("PO_Number", System.Type.GetType("System.String"));
            receiptsTable.Columns[4].MaxLength = 9;
            receiptsTable.Columns.Add("Description", System.Type.GetType("System.String"));
            receiptsTable.Columns[5].MaxLength = 51;
            receiptsTable.Columns.Add("Date", System.Type.GetType("System.String"));
            receiptsTable.Columns[6].MaxLength = 6;

            return(VmiIO.LoadFile(customerDatabaseFolder + "\\" + RECEIPTS_FILENAME, ref receiptsTable));
        }
Esempio n. 4
0
        private bool LoadCustords()
        {
            custordsTable.Columns.Add("Reference", System.Type.GetType("System.String"));
            custordsTable.Columns[0].MaxLength = 17;
            custordsTable.Columns.Add("Location", System.Type.GetType("System.String"));
            custordsTable.Columns[1].MaxLength = 3;
            custordsTable.Columns.Add("Quantity", System.Type.GetType("System.String"));
            custordsTable.Columns[2].MaxLength = 8;
            custordsTable.Columns[2].Caption   = "Number";
            custordsTable.Columns.Add("Filler", System.Type.GetType("System.String"));
            custordsTable.Columns[3].MaxLength = 1;
            custordsTable.Columns.Add("CO_Number", System.Type.GetType("System.String"));
            custordsTable.Columns[4].MaxLength = 13;
            custordsTable.Columns.Add("Customer_Number", System.Type.GetType("System.String"));
            custordsTable.Columns[4].MaxLength = 8;
            custordsTable.Columns.Add("Description", System.Type.GetType("System.String"));
            custordsTable.Columns[5].MaxLength = 34;
            custordsTable.Columns.Add("Date", System.Type.GetType("System.String"));
            custordsTable.Columns[6].MaxLength = 6;

            return(VmiIO.LoadFile(customerDatabaseFolder + "\\" + CUSTORDS_FILENAME, ref receiptsTable));
        }
Esempio n. 5
0
        private bool LoadOrdPlan()
        {
            ordPlanTable.Columns.Add("Skip_field1", System.Type.GetType("System.String"));
            ordPlanTable.Columns[0].MaxLength = 11;                //  1
            ordPlanTable.Columns.Add("Period", System.Type.GetType("System.String"));
            ordPlanTable.Columns[1].MaxLength = 2;                 //  2
            ordPlanTable.Columns[1].Caption   = "Number";
            ordPlanTable.Columns.Add("Skip_field2", System.Type.GetType("System.String"));
            ordPlanTable.Columns[2].MaxLength = 1;                 //  1
            ordPlanTable.Columns.Add("Reference", System.Type.GetType("System.String"));
            ordPlanTable.Columns[3].MaxLength = 17;                //  1
            ordPlanTable.Columns.Add("Priority", System.Type.GetType("System.String"));
            ordPlanTable.Columns[4].MaxLength = 1;                 //  1
            ordPlanTable.Columns[4].Caption   = "Number";
            ordPlanTable.Columns.Add("Quantity", System.Type.GetType("System.String"));
            ordPlanTable.Columns[5].MaxLength = 8;                 //  1
            ordPlanTable.Columns[5].Caption   = "Number";
            ordPlanTable.Columns.Add("Skip_field3", System.Type.GetType("System.String"));
            ordPlanTable.Columns[6].MaxLength = 104;               //  1
            ordPlanTable.Columns.Add("Date", System.Type.GetType("System.String"));
            ordPlanTable.Columns[7].MaxLength = 7;                 //  1

            return(VmiIO.LoadFile(customerDatabaseFolder + "\\" + ORDPLAN_FILENAME, ref ordPlanTable));
        }
Esempio n. 6
0
        private bool ImportOnHand()
        {
            bool success = false;

            string inFileName  = customerFileFolder + "\\" + DOWNLOAD_FILENAME;
            string outFileName = customerBaseFolder + "\\" + ONHAND_FILENAME;

            if (File.Exists(inFileName))
            {
                DataTable onHandInTable = new DataTable();

                onHandInTable.Columns.Add("Date", System.Type.GetType("System.String"));
                onHandInTable.Columns[0].MaxLength = 8;
                onHandInTable.Columns.Add("Filler1", System.Type.GetType("System.String"));
                onHandInTable.Columns[1].MaxLength = 1;
                onHandInTable.Columns.Add("Reference", System.Type.GetType("System.String"));
                onHandInTable.Columns[2].MaxLength = 18;
                onHandInTable.Columns[2].Caption   = "Number";
                onHandInTable.Columns.Add("Filler2", System.Type.GetType("System.String"));
                onHandInTable.Columns[3].MaxLength = 1;
                onHandInTable.Columns.Add("Last_Conso", System.Type.GetType("System.String"));
                onHandInTable.Columns[4].MaxLength = 14;
                onHandInTable.Columns.Add("Filler3", System.Type.GetType("System.String"));
                onHandInTable.Columns[5].MaxLength = 1;
                onHandInTable.Columns.Add("Last_Total", System.Type.GetType("System.String"));
                onHandInTable.Columns[6].MaxLength = 14;
                onHandInTable.Columns.Add("Filler4", System.Type.GetType("System.String"));
                onHandInTable.Columns[7].MaxLength = 1;
                onHandInTable.Columns.Add("MTD", System.Type.GetType("System.String"));
                onHandInTable.Columns[8].MaxLength = 14;
                onHandInTable.Columns[8].Caption   = "Number";
                onHandInTable.Columns.Add("Filler5", System.Type.GetType("System.String"));
                onHandInTable.Columns[9].MaxLength = 1;
                onHandInTable.Columns.Add("Total", System.Type.GetType("System.String"));
                onHandInTable.Columns[10].MaxLength = 14;
                onHandInTable.Columns.Add("Filler6", System.Type.GetType("System.String"));
                onHandInTable.Columns[11].MaxLength = 1;
                onHandInTable.Columns.Add("Stock", System.Type.GetType("System.String"));
                onHandInTable.Columns[12].MaxLength = 14;
                onHandInTable.Columns.Add("Filler7", System.Type.GetType("System.String"));
                onHandInTable.Columns[13].MaxLength = 1;
                onHandInTable.Columns.Add("Supplier_ral", System.Type.GetType("System.String"));
                onHandInTable.Columns[14].MaxLength = 14;
                onHandInTable.Columns.Add("Filler8", System.Type.GetType("System.String"));
                onHandInTable.Columns[15].MaxLength = 1;
                onHandInTable.Columns.Add("Customer_ral", System.Type.GetType("System.String"));
                onHandInTable.Columns[16].MaxLength = 14;
                onHandInTable.Columns.Add("Filler9", System.Type.GetType("System.String"));
                onHandInTable.Columns[17].MaxLength = 1;
                onHandInTable.Columns.Add("Mini_stock", System.Type.GetType("System.String"));
                onHandInTable.Columns[18].MaxLength = 14;
                onHandInTable.Columns.Add("Filler10", System.Type.GetType("System.String"));
                onHandInTable.Columns[19].MaxLength = 1;
                onHandInTable.Columns.Add("Classe", System.Type.GetType("System.String"));
                onHandInTable.Columns[20].MaxLength = 1;
                onHandInTable.Columns.Add("Filler11", System.Type.GetType("System.String"));
                onHandInTable.Columns[21].MaxLength = 1;
                onHandInTable.Columns.Add("Mini_stock_entered", System.Type.GetType("System.String"));
                onHandInTable.Columns[22].MaxLength = 14;
                onHandInTable.Columns.Add("Filler12", System.Type.GetType("System.String"));
                onHandInTable.Columns[23].MaxLength = 1;
                onHandInTable.Columns.Add("Multiple", System.Type.GetType("System.String"));
                onHandInTable.Columns[24].MaxLength = 14;

                success = VmiIO.LoadFile(inFileName, ref onHandInTable);

                if (success)
                {
                    DataTable onHandOutTable = new DataTable();

                    onHandOutTable.Columns.Add("Reference", System.Type.GetType("System.String"));
                    onHandOutTable.Columns[0].MaxLength = 17;
                    onHandOutTable.Columns.Add("Location", System.Type.GetType("System.String"));
                    onHandOutTable.Columns[1].MaxLength = 3;
                    onHandOutTable.Columns.Add("Stock_Quantity", System.Type.GetType("System.String"));
                    onHandOutTable.Columns[2].MaxLength = 8;
                    onHandOutTable.Columns[2].Caption   = "Number";
                    onHandOutTable.Columns.Add("Weight", System.Type.GetType("System.String"));
                    onHandOutTable.Columns[3].MaxLength = 12;
                    onHandOutTable.Columns.Add("Cube", System.Type.GetType("System.String"));
                    onHandOutTable.Columns[4].MaxLength = 12;
                    onHandOutTable.Columns.Add("MTD", System.Type.GetType("System.String"));
                    onHandOutTable.Columns[5].MaxLength = 8;
                    onHandOutTable.Columns[5].Caption   = "Number";
                    onHandOutTable.Columns.Add("Minimum_Order", System.Type.GetType("System.String"));
                    onHandOutTable.Columns[6].MaxLength = 8;
                    onHandOutTable.Columns[6].Caption   = "Number";
                    onHandOutTable.Columns.Add("Multiple", System.Type.GetType("System.String"));
                    onHandOutTable.Columns[7].MaxLength = 8;
                    onHandOutTable.Columns[7].Caption   = "Number";

                    foreach (DataRow row in onHandInTable.Rows)
                    {
                        if (row[2].ToString() != "")
                        {
                            try
                            {
                                DataRow newRow = onHandOutTable.NewRow();

                                newRow[0] = row[2].ToString();
                                newRow[1] = customerTrigram;
                                newRow[2] = row[12].ToString();
                                newRow[3] = "";
                                newRow[4] = "";
                                newRow[5] = row[8].ToString();
                                newRow[6] = "";
                                newRow[7] = "";

                                onHandOutTable.Rows.Add(newRow);
                            }
                            catch (Exception)
                            {
                            }
                        }
                    }

                    success &= VmiIO.WriteFile(outFileName, onHandOutTable);
                }
            }

            return(success);
        }
Esempio n. 7
0
        private bool ImportCustords()
        {
            bool success = false;

            string inFileName  = customerFileFolder + "\\" + FO_FILENAME;
            string outFileName = customerBaseFolder + "\\" + CUSTORDS_FILENAME;

            if (File.Exists(inFileName))
            {
                DataTable custordsInTable = new DataTable();

                custordsInTable.Columns.Add("Reference", System.Type.GetType("System.String"));
                custordsInTable.Columns[0].MaxLength = 18;
                custordsInTable.Columns[0].Caption   = "Number";
                custordsInTable.Columns.Add("Filler", System.Type.GetType("System.String"));
                custordsInTable.Columns[1].MaxLength = 1;
                custordsInTable.Columns.Add("FO_Number", System.Type.GetType("System.String"));
                custordsInTable.Columns[2].MaxLength = 10;
                custordsInTable.Columns.Add("Filler2", System.Type.GetType("System.String"));
                custordsInTable.Columns[3].MaxLength = 1;
                custordsInTable.Columns.Add("Quantity", System.Type.GetType("System.String"));
                custordsInTable.Columns[4].MaxLength = 10;
                custordsInTable.Columns[4].Caption   = "Number";
                custordsInTable.Columns.Add("Filler3", System.Type.GetType("System.String"));
                custordsInTable.Columns[5].MaxLength = 1;
                custordsInTable.Columns.Add("Date", System.Type.GetType("System.String"));
                custordsInTable.Columns[6].MaxLength = 8;

                success = VmiIO.LoadFile(inFileName, ref custordsInTable);

                if (success)
                {
                    DataTable custordsOutTable = new DataTable();

                    custordsOutTable.Columns.Add("Reference", System.Type.GetType("System.String"));
                    custordsOutTable.Columns[0].MaxLength = 17;
                    custordsOutTable.Columns.Add("Location", System.Type.GetType("System.String"));
                    custordsOutTable.Columns[1].MaxLength = 3;
                    custordsOutTable.Columns.Add("Quantity", System.Type.GetType("System.String"));
                    custordsOutTable.Columns[2].MaxLength = 8;
                    custordsOutTable.Columns[2].Caption   = "Number";
                    custordsOutTable.Columns.Add("Filler", System.Type.GetType("System.String"));
                    custordsOutTable.Columns[3].MaxLength = 1;
                    custordsOutTable.Columns.Add("Order_Number", System.Type.GetType("System.String"));
                    custordsOutTable.Columns[4].MaxLength = 13;
                    custordsOutTable.Columns.Add("Customer_Number", System.Type.GetType("System.String"));
                    custordsOutTable.Columns[5].MaxLength = 8;
                    custordsOutTable.Columns.Add("Direct", System.Type.GetType("System.String"));
                    custordsOutTable.Columns[6].MaxLength = 1;
                    custordsOutTable.Columns.Add("Customer_Name", System.Type.GetType("System.String"));
                    custordsOutTable.Columns[7].MaxLength = 29;
                    custordsOutTable.Columns.Add("Status", System.Type.GetType("System.String"));
                    custordsOutTable.Columns[8].MaxLength = 4;
                    custordsOutTable.Columns.Add("Date", System.Type.GetType("System.String"));
                    custordsOutTable.Columns[9].MaxLength = 6;

                    foreach (DataRow row in custordsInTable.Rows)
                    {
                        if (row[0].ToString() != "")
                        {
                            try
                            {
                                DataRow newRow = custordsOutTable.NewRow();

                                DateTime foDate = Convert.ToDateTime(row[6]);

                                newRow[0] = row[0].ToString();
                                newRow[1] = customerTrigram;
                                newRow[2] = row[4].ToString();
                                newRow[3] = "";
                                newRow[4] = row[2].ToString().PadRight(13, ' ');
                                newRow[5] = "";
                                newRow[6] = "";
                                newRow[7] = "";
                                newRow[8] = "";
                                newRow[9] = foDate.ToString("yyMMdd");

                                custordsOutTable.Rows.Add(newRow);
                            }
                            catch (Exception)
                            {
                            }
                        }
                    }

                    success &= VmiIO.WriteFile(outFileName, custordsOutTable);
                }
            }

            return(success);
        }
Esempio n. 8
0
        private bool ImportReceipts()
        {
            bool success = false;

            string inFileName  = customerFileFolder + "\\" + PO_FILENAME;
            string outFileName = customerBaseFolder + "\\" + RECEIPTS_FILENAME;

            if (File.Exists(inFileName))
            {
                DataTable receiptsInTable = new DataTable();

                receiptsInTable.Columns.Add("Reference", System.Type.GetType("System.String"));
                receiptsInTable.Columns[0].MaxLength = 18;
                receiptsInTable.Columns[0].Caption   = "Number";
                receiptsInTable.Columns.Add("Filler", System.Type.GetType("System.String"));
                receiptsInTable.Columns[1].MaxLength = 1;
                receiptsInTable.Columns.Add("PO_Number", System.Type.GetType("System.String"));
                receiptsInTable.Columns[2].MaxLength = 10;
                receiptsInTable.Columns[2].Caption   = "Number";
                receiptsInTable.Columns.Add("Filler2", System.Type.GetType("System.String"));
                receiptsInTable.Columns[3].MaxLength = 1;
                receiptsInTable.Columns.Add("Quantity", System.Type.GetType("System.String"));
                receiptsInTable.Columns[4].MaxLength = 10;
                receiptsInTable.Columns[4].Caption   = "Number";
                receiptsInTable.Columns.Add("Filler3", System.Type.GetType("System.String"));
                receiptsInTable.Columns[5].MaxLength = 1;
                receiptsInTable.Columns.Add("Date", System.Type.GetType("System.String"));
                receiptsInTable.Columns[6].MaxLength = 8;

                success = VmiIO.LoadFile(inFileName, ref receiptsInTable);

                if (success)
                {
                    DataTable receiptsOutTable = new DataTable();

                    receiptsOutTable.Columns.Add("Reference", System.Type.GetType("System.String"));
                    receiptsOutTable.Columns[0].MaxLength = 17;
                    receiptsOutTable.Columns.Add("Location", System.Type.GetType("System.String"));
                    receiptsOutTable.Columns[1].MaxLength = 3;
                    receiptsOutTable.Columns.Add("Quantity", System.Type.GetType("System.String"));
                    receiptsOutTable.Columns[2].MaxLength = 8;
                    receiptsOutTable.Columns[2].Caption   = "Number";
                    receiptsOutTable.Columns.Add("Filler", System.Type.GetType("System.String"));
                    receiptsOutTable.Columns[3].MaxLength = 1;
                    receiptsOutTable.Columns.Add("PO_Number", System.Type.GetType("System.String"));
                    receiptsOutTable.Columns[4].MaxLength = 9;
                    receiptsOutTable.Columns.Add("Description", System.Type.GetType("System.String"));
                    receiptsOutTable.Columns[5].MaxLength = 51;
                    receiptsOutTable.Columns.Add("Date", System.Type.GetType("System.String"));
                    receiptsOutTable.Columns[6].MaxLength = 6;

                    foreach (DataRow row in receiptsInTable.Rows)
                    {
                        if (row[0].ToString() != "")
                        {
                            try
                            {
                                DataRow newRow = receiptsOutTable.NewRow();

                                DateTime poDate = Convert.ToDateTime(row[6]);

                                newRow[0] = row[0].ToString();
                                newRow[1] = customerTrigram;
                                newRow[2] = row[4].ToString();
                                newRow[3] = "";
                                newRow[4] = row[2].ToString().PadLeft(9, '0');
                                newRow[5] = "";
                                newRow[6] = poDate.ToString("yyMMdd");

                                receiptsOutTable.Rows.Add(newRow);
                            }
                            catch (Exception)
                            {
                            }
                        }
                    }

                    success &= VmiIO.WriteFile(outFileName, receiptsOutTable);
                }
            }

            return(success);
        }