Esempio n. 1
0
 public void AutoUpdate(string type)
 {
     try
     {
         AddLog("Auto Update", "Update Agent", "");
         autoUpdateService = new AutoUpdateService();
         autoUpdateService.Command(type);
     }
     catch (Exception ex)
     {
         throw new RMSAppException(this, "0500", "AutoUpdate failed. " + ex.Message, ex, true);
     }
 }
Esempio n. 2
0
        private void AddAutoUpdateLog(object sender, EventArgs e)
        {
            try
            {
                UpdateService.AutoUpdateResultEventArgs args = (UpdateService.AutoUpdateResultEventArgs)e;

                string strUpdateVersion = string.IsNullOrEmpty(args.updateVersion) ? "" : " (" + args.updateVersion + ")";

                var path    = System.Reflection.Assembly.GetEntryAssembly().Location;
                var appName = System.IO.Path.GetFileNameWithoutExtension(path);

                var service = new BSL.AutoUpate.AutoUpdateService();
                service.UpdateResult(clientCode, appName, _updateService.currentVerionOnClient.ToString(), args.updateVersion, args.isComplete, args.errorMessage);
            }
            catch (Exception ex)
            {
                new RMSAppException(this, "0500", "AddAutoUpdateLog failed. " + ex.Message, ex, true);
            }
        }