Пример #1
0
 private void label11_Click(object sender, EventArgs e)
 {
     using (var context = new MitBankDBEntities())
     {
         var result = context.insertLastLogin(DataManagement.getIdUsername(), DateTime.Now.ToString());
     }
     Application.Exit();
 }
Пример #2
0
        private void logoutButton_Click(object sender, EventArgs e)
        {
            var result = MessageBox.Show("Are you sure?", "Info",
                                         MessageBoxButtons.YesNo,
                                         MessageBoxIcon.Question);

            if (result == DialogResult.Yes)
            {
                using (var context = new MitBankDBEntities())
                {
                    var result2 = context.insertLastLogin(DataManagement.getIdUsername(), DateTime.Now.ToString());
                }
                this.Hide();
                Form1 frm = new Form1();
                this.Refresh();
                this.Invalidate();
                frm.Refresh();
                frm.Invalidate();
                frm.Show();
            }
        }