Exemple #1
0
        void Application_ApplicationExit(object sender, EventArgs e)
        {
            DeviceManager.DisconnectAll();
            this.Notify_Icon.Dispose();

            Settings.Default.Width       = this.Width;
            Settings.Default.Height      = this.Height;
            Settings.Default.WindowState = (int)this.WindowState;
            Settings.Default.Location    = this.Location;
            Settings.Default.Save();

            if (Program.User != null)
            {
                Event m_Event = new Event();
                m_Event.AuthorID    = Program.User.ID;
                m_Event.CategoryID  = 6; // oturum
                m_Event.CreatedAt   = DateTime.Now;
                m_Event.Description = "Kullanıcı oturumu sonlandırdı.";
                m_Event.OwnerID     = Program.User.WorksAtID;

                MuhasebeEntities m_Context = new MuhasebeEntities();
                m_Context.Events.Add(m_Event);
                m_Context.SaveChangesAsync();
            }
        }