Esempio n. 1
0
        public static void Initialise(BusyDialog busyDialog)
        {
            if (!Order.Initialise())
            {
                MessageLogger.Add("Error connecting to DB - see log file for details", MessageLogger.MsgLevel.critical);
            }

            Pack.Initialise();
            printer = new LabelPrinter();

            if (CommonData.localSettings.PullMaterialsAtStartup)
            {
                ReadMaterialsFromSAP(busyDialog);
            }
            else
            {
                ReadMaterialsFromDB(busyDialog);
            }

            if (CommonData.localSettings.PullOrdersAtStartup)
            {
                ReadOrdersFromSAP(busyDialog);
            }
            else
            {
                ReadOrdersFromDB(busyDialog);
            }
        }
Esempio n. 2
0
 public static void ReadOrdersFromDB(BusyDialog bd)
 {
     bd.SetTitle("Reading Production Orders from DB");
     Order.ReadOrdersFromDB(out CommonData.normalOrders, out CommonData.reworkOrders, out CommonData.slDates);
     MessageLogger.Add(CommonData.normalOrders.Count + " normal orders read from DB", MessageLogger.MsgLevel.info);
     MessageLogger.Add(CommonData.reworkOrders.Count + " re-work orders read from DB", MessageLogger.MsgLevel.info);
 }
Esempio n. 3
0
        public static void ReadMaterialsFromSAP(BusyDialog bd)
        {
            bd.SetTitle("Reading Material Master Data from SAP");

            if (Material.readMaterialsFromSAP(out CommonData.mats))
            {
                MessageLogger.Add(CommonData.mats.Count + " materials read from SAP", MessageLogger.MsgLevel.info);

                bd.SetTitle("Saving Material Master Data to Local DB");
                Material.saveMaterialsToDB(CommonData.mats, true);
            }
            else
            {
                // Error pulling updated material list from SAP - use local material master data instead.
                ReadMaterialsFromDB(bd);
            }
        }
Esempio n. 4
0
        public static void ReadOrdersFromSAP(BusyDialog bd)
        {
            bd.SetTitle("Sending unsent cartons to SAP");
            if (Pack.SendPacks())
            {
                bd.SetTitle("Reading Production Orders from SAP");
                if (Order.ReadOrdersFromSAP(out CommonData.normalOrders, out CommonData.reworkOrders, out CommonData.slDates))
                {
                    MessageLogger.Add(CommonData.normalOrders.Count + " normal orders read from SAP", MessageLogger.MsgLevel.info);
                    MessageLogger.Add(CommonData.reworkOrders.Count + " re-work orders read from SAP", MessageLogger.MsgLevel.info);

                    bd.SetTitle("Saving Production Orders to Local DB");
                    Order.SaveOrdersToDB(CommonData.normalOrders);
                    Order.SaveOrdersToDB(CommonData.reworkOrders);
                    Order.SavePackDatesToDB(CommonData.slDates);
                    return;
                }
            }
            // Didn't successfully read orders from SAP - read local copy of order data instead
            ReadOrdersFromDB(bd);
        }
Esempio n. 5
0
 public static void ReadMaterialsFromDB(BusyDialog bd)
 {
     bd.SetTitle("Reading Material Master Data from DB");
     CommonData.mats = Material.readMaterialsFromDB();
     MessageLogger.Add(CommonData.mats.Count + " materials read from DB", MessageLogger.MsgLevel.info);
 }