管理员可查看所有人 可以修改指定用户指定权限
满足标题就可以了
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Q691926
{
public partial class LoginDialog : Form
{
public LoginDialog()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
var db = new Q691926DBClassDataContext();
if (db.UserInfos.Any(x => x.username == textBox1.Text && x.pwd == textBox2.Text))
{
this.Hide();
Session.UserName = textBox1.Text;
var f = new MainForm();
f.FormClosed += new FormClosedEventHandler(f_FormClosed);
f.Show();
}
else
{
MessageBox.Show("wrong password!");
}
}
void f_FormClosed(object sender, FormClosedEventArgs e)
{
this.Show();
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Q691926
{
public partial class MainForm : Form
{
public MainForm()
{
InitializeComponent();
}
private void MainForm_Load(object sender, EventArgs e)
{
var db = new Q691926DBClassDataContext();
string query = db.UserInfos.First(x => x.username == Session.UserName).info;
label1.Text = query;
}
}
}