Пример #1
0
 private void ItemMnuSystemLogin_Click(object sender, EventArgs e)
 {
     if (!MyApp.gConnected)
     {
         frmLogin digForm = new frmLogin();
         digForm.ShowDialog();
     }
     else
     {
         if (MessageBox.Show("Có chắc chắn bỏ kết nối?", "Đăng xuất",
                             MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
         {
             MyApp.gConnected = false;
             frmMain.Current.ItemMnuLoginChange = "Đăng nhập";
             #region "Members"
             UserInformation.Code      = "";
             UserInformation.Pass      = "";
             UserInformation.MaNV      = "";
             UserInformation.MaDV      = "";
             UserInformation.Name      = "";
             UserInformation.CheckPass = "";
             UserInformation.PQ        = "";
             #endregion
             PhanQuyen.HideAll(); //ẩn tất cả các menu
             frmLogin digForm = new frmLogin();
             digForm.ShowDialog();
         }
     }
 }
Пример #2
0
 private void frmMain_Load(object sender, EventArgs e)
 {
     this.Show();
     foreach (Control ctrl in this.Controls)
     {
         if (ctrl is MdiClient)
         {
             ctrl.BackColor = Color.White;
         }
     }
     MyApp.gConnected = false;
     //truyền đối tượng This (frmMain) cho class PhanQuyen
     PhanQuyen.frmmain = this;
     //gọi HideAll để ẩn menu trong class PhanQuyen
     PhanQuyen.HideAll();
     //
     //gọi form kết nối
     if (!MyApp.gConnected)
     {
         frmLogin digForm = new frmLogin();
         digForm.ShowDialog();
     }
     //(new frmLogin()).Show();
 }