Exemplo n.º 1
0
 private void bntSignOut_Click(object sender, EventArgs e)
 {
     try
     {
         // Biến "Giờ ra" lưu thời gian đăng xuất của NV
         //DateTime gioRa = DateTime.Now;
         //int doanhthu = DAL.DAL_PhanAn.LayDuLieuDoanhThu(gioRa.ToString("yyyy-MM-dd"), Gvar.MaNvDungCa);
         // Ghi dữ liệu đăng xuất vào CSDL
         //if (DAL.DAL_PhanAn.GhiDuLieuDangXuat(gioRa.TimeOfDay.ToString(), doanhthu, Gvar.MaNvDungCa))
         //{
         // Trả Mã NV hiện tại về mặc đinh (rỗng)
         Gvar.MaNvDungCa = "";
         // Đóng form chính và hiện form đăng nhập
         this.Hide();
         var frm = new PhanAn.frmDangNhapNhanVien();
         frm.Closed += (s, args) => this.Close();
         frm.Show();
         //}
         //else
         //{
         //    MessageBox.Show("Đăng xuất KHÔNG thành công!", "Đăng xuất lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
         //}
     }
     catch
     {
         Application.Exit();
     }
 }
Exemplo n.º 2
0
 private void prgTimer_Tick(object sender, EventArgs e)
 {
     // Loading (nhưng chưa thực tế)
     prgLoad.Visible = false;
     prgLoad.Increment(32);//32
     if (prgLoad.Value == 96)
     {
         // CHạy nhạc Intro
         SoundPlayer simpleSound = new SoundPlayer(Properties.Resources.splashSND);
         simpleSound.PlaySync();
         tmrPrg.Stop();
         // Hiệu ứng Fade out
         for (float f = 0.0F; f < 1F; f = f + 0.03F)
         {
             this.Opacity = 1 - f;
             Thread.Sleep(10);
         }
         this.Opacity = 0;
         // Đóng Splash, hiện form đăng nhập
         var frm = new PhanAn.frmDangNhapNhanVien();
         frm.Closed += (s, args) => this.Close();
         frm.Show();
     }
 }