Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Data.Linq;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace laba8
- {
- public partial class Form4 : Form
- {
- Table<User> users;
- Table<Priv> privs;
- Table<UserPriv> userPrivs;
- DataContext context;
- public Form4()
- {
- InitializeComponent();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- context = appcontext.GetDataContext();
- users = context.GetTable<User>();
- privs = context.GetTable<Priv>();
- userPrivs = context.GetTable<UserPriv>();
- var user = users.FirstOrDefault(v => v.UserName == textBox1.Text && v.Password == textBox2.Text);
- if (user != null)
- {
- Program.user = user;
- new Form1().Show();
- this.Hide();
- }
- else
- {
- MessageBox.Show("Неверный логин или пароль");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement