Пример #1
0
 private void FrmChinh_Load(object sender, EventArgs e)
 {
     if (isDangNhap == false)
     {
         FrmDangNhap fdn = new FrmDangNhap();
         fdn.MdiParent       = this;
         fdn.Dock            = DockStyle.Fill;
         fdn.FormBorderStyle = FormBorderStyle.None;
         fdn.StartPosition   = FormStartPosition.CenterScreen;
         fdn.Show();
     }
     else
     {
     }
 }
Пример #2
0
        private void đĂNGXUÂTToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DongFrmCon();
            lsNDDTO = new LichSuNguoiDungDTO()
            {
                MAND     = nvDangNhap.MAND,
                MANV     = nvDangNhap.MANV,
                THOIGIAN = DateTime.Parse(DateTime.Now.ToString("dd/MM/yyy HH:mm")),
                SUKIEN   = "Đăng Xuất Khỏi Hệ Thống"
            };
            try
            {
                List <LichSuNguoiDungDTO> LichSuSauMotNgay = lsNDBUS.DSLichSuHoatDong().FindAll(o => o.THOIGIAN.Day < lsNDDTO.THOIGIAN.Day);
                if (LichSuSauMotNgay != null)
                {
                    lsNDBUS.GhiFile(LichSuSauMotNgay, Utils.MaHoaMD5(LichSuSauMotNgay[LichSuSauMotNgay.Count() - 1].THOIGIAN.ToString()));
                }

                bool ktls = lsNDBUS.ThemLichSuNguoiDung(lsNDDTO);
            }
            catch
            {
            }

            dn = null;
            f1 = null;
            FrmDangNhap fdn = new FrmDangNhap();

            fdn.MdiParent       = this;
            fdn.Dock            = DockStyle.Fill;
            fdn.FormBorderStyle = FormBorderStyle.None;
            fdn.StartPosition   = FormStartPosition.CenterScreen;
            fdn.Show();
            đĂNGXUÂTToolStripMenuItem.Visible = false;
            menuStrip1.Enabled = false;
            tAIKHOANCUATÔIToolStripMenuItem.Text = "TÀI KHOẢN CỦA TÔI";
        }