1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- 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 WindowsFormsAppGrishina
- {
- public partial class Form3 : Form
- {
- public Form3()
- {
- InitializeComponent();
- }
- private void textBox1_TextChanged(object sender, EventArgs e)
- {
- }
- private void button1_Click(object sender, EventArgs e)
- {
- if (string.IsNullOrEmpty(textBox1.Text) || string.IsNullOrEmpty(textBox2.Text))
- {
- MessageBox.Show("Введите логин и пароль");
- return;
- }
- using (var db = new grishinaEntities())
- {
- var user = db.grishinaDataSet
- .AsNoTracking()
- .FirstOrDefault(u => u.Login == TextBox1.Text && u.Pass == TextBox2.Text);
- if (user == null)
- {
- MessageBox.Show("Пользователь с такими данными не найден");
- return;
- }
- MessageBox.Show("Пользователь найден");
- }
- }
- private void label1_Click(object sender, EventArgs e)
- {
- }
- private void label2_Click(object sender, EventArgs e)
- {
- }
- private void PasswordBox_TextChanged(object sender, EventArgs e)
- {
- }
- private void button2_Click(object sender, EventArgs e)
- {
- }
- }
- }
|