Пример #1
0
        private void frmMain_Load(object sender, System.EventArgs e)
        {
            //Code cho form phủ kín màn hình kể cả task bar
            //FormBorderStyle = FormBorderStyle.FixedSingle;
            //Rectangle formrect = Screen.GetBounds(this);
            //Location = formrect.Location;
            //Size = formrect.Size;

            //
            frmChonNamHoc frm      = new frmChonNamHoc();
            frmLogIn      frmLogin = new frmLogIn();

            if (frmLogin.ShowDialog() == DialogResult.OK)
            {
                frm.ShowDialog();

                bbNamHoc.Caption = "Năm học: " + Program.NamHoc + " - Học kỳ: " + Program.HocKy.ToString();
                // lay quyen user login
                GetQuyen_Login(Program.objUserCurrent.Username);
                GetThongTinTruong();
                //PageBringToFront(UnimOs.Khoa.Properties.Settings.Default.PageDefault);
                if ("" + (new cBHT_ThamSoHeThong()).GetGiaTriByMaThamSo(" ") != "0")
                {
                    frmStartPage frmStart = new frmStartPage();
                    this.CreateMDIForm(frmStart);
                }
            }
            else
            {
                this.Close();
            }
        }
Пример #2
0
        private void LogOut()
        {
            foreach (Form frm in this.MdiChildren)
            {
                if (frm.Name != "frmStartPage")
                {
                    frm.Close();
                }
            }
            frmLogIn frmLogin = new frmLogIn();

            if (frmLogin.ShowDialog() == DialogResult.OK)
            {
                //Cập nhật lại quyền
                GetQuyen_Login(Program.objUserCurrent.Username);
            }
            else
            {
                this.Close();
                Application.Exit();
            }
        }