示例#1
0
文件: Events.cs 项目: lr030/ML
        internal static void Start()
        {
            AutoService.Add();

            Status.SetState(Status.EState.Starting);

            Instances.ServiceData.StartTimeStamp = DateTime.Now;

            foreach (var ba in StartupSequence.Actions)
            {
                try
                {
                    ba();
                }
                catch (Exception e)
                {
                    Current.Log.Add(e);
                }
            }

            AppDomain.CurrentDomain.ProcessExit += CurrentDomain_ProcessExit;

            DumpStartInfo();

            Status.SetState(Status.EState.Running);
        }
示例#2
0
 public void Save()
 {
     if (CheckData())
     {
         AutoService service = new AutoService();
         if ((this.DataContext as AutoEntity).Id == -1 && !CheckDoppione())
         {
             if (service.Add(this.DataContext as AutoEntity) == 0)
             {
                 MessageBox.Show("Salvato!");
                 this.DataContext = new AutoEntity();
             }
             else
             {
                 MessageBox.Show("Errore durante il salvataggio!");
             }
         }
         else
         {
             if (service.Update(this.DataContext as AutoEntity) == 0)
             {
                 MessageBox.Show("Salvato!");
             }
             else
             {
                 MessageBox.Show("Errore durante il salvataggio!");
             }
         }
     }
 }