public void LoginFreshShow() { if (SelectDao.UserLogion(this.textName.Text, this.textPsw.Text)) { this.DialogResult = DialogResult.OK; UserRight instance = UserRight.GetInstance(); instance.GetUserRight(this.textName.Text); string appPath = System.AppDomain.CurrentDomain.BaseDirectory + "FootConfig.xml"; XmlUtil.SavaDataInfo(appPath, "User", this.textName.Text); //加密 if (this.checkEdit1.Checked) { string password = XmlUtil.Encryption(this.textPsw.Text); XmlUtil.SavaDataInfo(appPath, "Password", password); XmlUtil.SavaDataInfo(appPath, "Remember", "true"); } this.Close(); } else { progressBarControl1.Position = 0; backgroundWorker1.CancelAsync(); XtraMessageBox.Show("登录失败!"); } }
private void OperatSetting_Load(object sender, EventArgs e) { GridViewUtil.InitGridView(this.gridView1, typeof(PermissionVo)); GridViewUtil.InitGridView(this.gridView2, typeof(UserRoleVo)); this.gridView2.Columns["Psword"].Visible = false; this.gridView2.Columns["Id"].Visible = false; FillPermission(); FillUser(); UserRight instance = UserRight.GetInstance(); foreach (Control ctr in this.Controls) { instance.CheckControl(ctr); } }