Example #1
0
        private void FormMain_Load(object sender, EventArgs e)
        {
            FormLogin f1 = new FormLogin();

            if (f1.ShowDialog() != DialogResult.OK)
            {
                Application.Exit();
            }
            UserInfo ui = UserInfo.GetInstance();

            tssInfo.Text = string.Format("欢迎'{0}',登录时间:'{1}'", ui.RealName, DateTime.Now.ToString());
        }
Example #2
0
        private void FormMain_Load(object sender, EventArgs e)
        {
            FormLogin f1 = new FormLogin();

            if (f1.ShowDialog() != DialogResult.OK)
            {
                Application.Exit();
            }
            userid = FormLogin.userid;
            if (userid != "admin")
            {
                CommonHelper.FailedReply("您没有权限修改该数据库!");
                btnAdd.Enabled       = false;
                btnDelete.Enabled    = false;
                btnLock.Enabled      = false;
                btnSearch.Enabled    = false;
                txtId.Enabled        = false;
                txtPassword.Enabled  = false;
                txtRealName.Enabled  = false;
                txtUserName.Enabled  = false;
                cmbIsDeleted.Enabled = false;
                cmbIsLocked.Enabled  = false;
            }
        }