Beispiel #1
0
        private bool LoadDsjour()
        {
            if (dsFormat.Equals("ORIGINAL"))
            {
                dsjourTable.Columns.Add("Reference", System.Type.GetType("System.String"));
                dsjourTable.Columns[0].MaxLength = 20;
                dsjourTable.Columns.Add("Description", System.Type.GetType("System.String"));
                dsjourTable.Columns[1].MaxLength = 24;
                dsjourTable.Columns.Add("Filler", System.Type.GetType("System.String"));
                dsjourTable.Columns[2].MaxLength = 1;
                dsjourTable.Columns.Add("Cost", System.Type.GetType("System.String"));
                dsjourTable.Columns[3].MaxLength = 10;
                dsjourTable.Columns[3].Caption   = "Decimal";
                dsjourTable.Columns.Add("Price", System.Type.GetType("System.String"));
                dsjourTable.Columns[4].MaxLength = 10;
                dsjourTable.Columns[4].Caption   = "Decimal";
                dsjourTable.Columns.Add("Machine", System.Type.GetType("System.String"));
                dsjourTable.Columns[5].MaxLength = 8;
                dsjourTable.Columns.Add("Cell", System.Type.GetType("System.String"));
                dsjourTable.Columns[6].MaxLength = 8;
                dsjourTable.Columns.Add("Class", System.Type.GetType("System.String"));
                dsjourTable.Columns[7].MaxLength = 8;
                dsjourTable.Columns.Add("MTD", System.Type.GetType("System.String"));
                dsjourTable.Columns[8].MaxLength = 8;
                dsjourTable.Columns[8].Caption   = "Number";
            }
            else if (dsFormat.Equals("10"))
            {
                dsjourTable.Columns.Add("Reference", System.Type.GetType("System.String"));
                dsjourTable.Columns[0].MaxLength = 78;
                dsjourTable.Columns.Add("Description", System.Type.GetType("System.String"));
                dsjourTable.Columns[1].MaxLength = 24;
                dsjourTable.Columns.Add("Filler", System.Type.GetType("System.String"));
                dsjourTable.Columns[2].MaxLength = 1;
                dsjourTable.Columns.Add("Cost", System.Type.GetType("System.String"));
                dsjourTable.Columns[3].MaxLength = 10;
                dsjourTable.Columns[3].Caption   = "Decimal";
                dsjourTable.Columns.Add("Price", System.Type.GetType("System.String"));
                dsjourTable.Columns[4].MaxLength = 10;
                dsjourTable.Columns[4].Caption   = "Decimal";
                dsjourTable.Columns.Add("Machine", System.Type.GetType("System.String"));
                dsjourTable.Columns[5].MaxLength = 8;
                dsjourTable.Columns.Add("Cell", System.Type.GetType("System.String"));
                dsjourTable.Columns[6].MaxLength = 8;
                dsjourTable.Columns.Add("Class", System.Type.GetType("System.String"));
                dsjourTable.Columns[7].MaxLength = 8;
                dsjourTable.Columns.Add("MTD", System.Type.GetType("System.String"));
                dsjourTable.Columns[8].MaxLength = 8;
                dsjourTable.Columns[8].Caption   = "Number";
            }
            else
            {
                return(false);
            }

            return(DSPrioritiesIO.LoadFile(customerDatabase + "\\" + DSJOUR_FILENAME, ref dsjourTable));
        }
Beispiel #2
0
        public bool SaveDsPO()
        {
            System.Data.DataTable dataTable = new System.Data.DataTable();

            dataTable.Columns.Add("Article", System.Type.GetType("System.String"));
            dataTable.Columns[0].MaxLength = 17;
            dataTable.Columns.Add("Quantite", System.Type.GetType("System.String"));
            dataTable.Columns[1].MaxLength = 8;
            dataTable.Columns.Add("Date", System.Type.GetType("System.String"));
            dataTable.Columns[2].MaxLength = 8;
            dataTable.Columns.Add("Code_ABC", System.Type.GetType("System.String"));
            dataTable.Columns[3].MaxLength = 1;


            foreach (DataRow row in dsPoTable.Rows)
            {
                int dayCount = 0;

                if (DateTime.Now.DayOfWeek == 0)
                {
                    dayCount = 6;
                }
                else
                {
                    dayCount = ((int)DateTime.Now.DayOfWeek) - 1;
                }

                dayCount = -dayCount;


                DateTime date = DateTime.Now.AddDays(dayCount);

                for (int i = 0; i < horizon + 1; i++)
                {
                    if ((Convert.ToInt32(row[2 + i])) > 0)
                    {
                        DataRow newRow = dataTable.NewRow();

                        newRow[0] = row[0].ToString();
                        newRow[1] = row[2 + i].ToString().PadLeft(8, '0');
                        newRow[2] = date.AddDays(-7).ToString("ddMMyyyy");
                        newRow[3] = row[1].ToString();

                        dataTable.Rows.Add(newRow);
                    }

                    date = date.AddDays(7);
                }
            }

            return(DSPrioritiesIO.WriteFile(dsPOFolder + "\\" + PO_RESULT_FILENAME, dataTable));
        }
Beispiel #3
0
        private bool LoadExport()
        {
            int columnCount = 0;

            if (dsFormat.Equals("ORIGINAL"))
            {
                exportTable.Columns.Add("Reference", System.Type.GetType("System.String"));
                exportTable.Columns[0].MaxLength = 20;
                columnCount++;
            }
            else if (dsFormat.Equals("10"))
            {
                exportTable.Columns.Add("Reference", System.Type.GetType("System.String"));
                exportTable.Columns[0].MaxLength = 66;
                columnCount++;
            }
            else
            {
                return(false);
            }

            exportTable.Columns.Add("MINIMUM_STOCK", System.Type.GetType("System.String"));
            exportTable.Columns[columnCount].MaxLength = 8;
            exportTable.Columns[columnCount].Caption   = "Number";
            columnCount++;

            for (int i = 0; i < horizon + 1; i++)
            {
                exportTable.Columns.Add("GRRQMTS_" + i.ToString(), System.Type.GetType("System.String"));
                exportTable.Columns[columnCount].MaxLength = 8;
                exportTable.Columns[columnCount].Caption   = "Number";
                columnCount++;
            }

            for (int i = 0; i < horizon + 1; i++)
            {
                exportTable.Columns.Add("ENDINV_" + i.ToString(), System.Type.GetType("System.String"));
                exportTable.Columns[columnCount].MaxLength = 8;
                exportTable.Columns[columnCount].Caption   = "Number";
                columnCount++;
            }

            exportTable.Columns.Add("SCHREC_0", System.Type.GetType("System.String"));
            exportTable.Columns[columnCount].MaxLength = 8;
            exportTable.Columns[columnCount].Caption   = "Number";
            columnCount++;

            return(DSPrioritiesIO.LoadFile(exportDsPrioritiesFileName, ref exportTable));
        }
Beispiel #4
0
        public bool LoadDsPO()
        {
            int columnCount = 0;

            dsPoTable.Columns.Add("Reference", System.Type.GetType("System.String"));
            columnCount++;
            dsPoTable.Columns.Add("ABC", System.Type.GetType("System.String"));
            columnCount++;

            for (int i = 0; i < horizon + 1; i++)
            {
                dsPoTable.Columns.Add("PO_" + i.ToString(), System.Type.GetType("System.String"));
                dsPoTable.Columns[columnCount].Caption = "Number";
                columnCount++;
            }

            return(DSPrioritiesIO.LoadTabFile(exportDsPOFileName, ref dsPoTable));
        }
Beispiel #5
0
        private bool LoadReceipts()
        {
            if (dsFormat.Equals("ORIGINAL"))
            {
                receiptsTable.Columns.Add("Reference", System.Type.GetType("System.String"));
                receiptsTable.Columns[0].MaxLength = 20;
                receiptsTable.Columns.Add("Quantity", System.Type.GetType("System.String"));
                receiptsTable.Columns[1].MaxLength = 8;
                receiptsTable.Columns[1].Caption   = "Number";
                receiptsTable.Columns.Add("Filler", System.Type.GetType("System.String"));
                receiptsTable.Columns[2].MaxLength = 1;
                receiptsTable.Columns.Add("PO_Number", System.Type.GetType("System.String"));
                receiptsTable.Columns[3].MaxLength = 9;
                receiptsTable.Columns.Add("Description", System.Type.GetType("System.String"));
                receiptsTable.Columns[4].MaxLength = 51;
                receiptsTable.Columns.Add("Date", System.Type.GetType("System.String"));
                receiptsTable.Columns[5].MaxLength = 6;
            }
            else if (dsFormat.Equals("10"))
            {
                receiptsTable.Columns.Add("Reference", System.Type.GetType("System.String"));
                receiptsTable.Columns[0].MaxLength = 78;
                receiptsTable.Columns.Add("Quantity", System.Type.GetType("System.String"));
                receiptsTable.Columns[1].MaxLength = 8;
                receiptsTable.Columns[1].Caption   = "Number";
                receiptsTable.Columns.Add("Filler", System.Type.GetType("System.String"));
                receiptsTable.Columns[2].MaxLength = 1;
                receiptsTable.Columns.Add("PO_Number", System.Type.GetType("System.String"));
                receiptsTable.Columns[3].MaxLength = 9;
                receiptsTable.Columns.Add("Description", System.Type.GetType("System.String"));
                receiptsTable.Columns[4].MaxLength = 51;
                receiptsTable.Columns.Add("Date", System.Type.GetType("System.String"));
                receiptsTable.Columns[5].MaxLength = 8;
            }
            else
            {
                return(false);
            }

            return(DSPrioritiesIO.LoadFile(customerDatabase + "\\" + RECEIPTS_FILENAME, ref receiptsTable));
        }
Beispiel #6
0
        private bool SaveDsPriorities()
        {
            System.Data.DataTable dataTable = new System.Data.DataTable();

            dataTable.Columns.Add("OF", System.Type.GetType("System.String"));
            dataTable.Columns[0].MaxLength = 7;
            dataTable.Columns.Add("Priorité", System.Type.GetType("System.String"));
            dataTable.Columns[1].MaxLength = 2;

            foreach (DataGridViewRow row in dgvReceipts.Rows)
            {
                if (Convert.ToBoolean(row.Cells[0].Value))
                {
                    DataRow newRow = dataTable.NewRow();

                    newRow[0] = row.Cells[1].Value.ToString().PadLeft(7, '0');
                    newRow[1] = row.Cells[2].Value.ToString().PadLeft(2, '0');

                    dataTable.Rows.Add(newRow);
                }
            }

            return(DSPrioritiesIO.WriteFile(dsPrioritiesFolder + "\\" + PRIORITIES_RESULT_FILENAME, dataTable));
        }