Ejemplo n.º 1
0
        public ActionLog RunSPCSync()
        {
            ActionLog actionLog = null;
            int       result    = 0;
            string    message   = "";
            bool      error     = false;

            ActionLog.ActionTypes actionTypeID = ActionLog.ActionTypes.Syncronisation;

            if (run_sync > 0)
            {
                try
                {
                    Classes.Synchroniser synchroniser = new Classes.Synchroniser();
                    result  = synchroniser.SynchroniseWithSPC((CloudStatusDB)Program.cloudStatusDB);
                    message = "Syncronisation successful";
                }
                catch (Exception ex)
                {
                    error   = true;
                    message = ex.Message;
                    ErrorHandler.Instance.HandleError(actionTypeID, "", "There was an error running the SPC Sync", ex.Message);
                }

                actionLog = new ActionLog(installation_id, ApplicationList.TUFStatus, actionTypeID, "", result, message, error);
            }
            return(actionLog);
        }
Ejemplo n.º 2
0
        private void buttonSPCSync_Click(object sender, EventArgs e)
        {
            Classes.Synchroniser synchroniser = new Classes.Synchroniser();
            int result = 0;

            Cursor.Current = Cursors.WaitCursor;
            result         = synchroniser.SynchroniseWithSPC((CloudStatusDB)Program.cloudStatusDB);
            Cursor.Current = Cursors.Default;
            MessageBox.Show("Finished");
        }