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.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- using System.Data.SqlClient;
- namespace kursach
- {
- public partial class log_in_userF : Form
- {
- Form mainFForm;
- public log_in_userF(mainF form)
- {
- InitializeComponent();
- mainFForm = form;
- textPassword.UseSystemPasswordChar = true;
- this.ControlBox = false;
- }
- public bool BoolProperty { get; set; }
- private void come_inB_Click(object sender, EventArgs e)
- {
- con.Open();
- string query = "Select * from Arendator Where Login = '" + textLogin.Text.Trim() + "' and Password = '" + textPassword.Text.Trim() + "'";
- SqlDataAdapter sda = new SqlDataAdapter(query, con);
- DataTable dtl = new DataTable();
- sda.Fill(dtl);
- if (textLogin.Text == "" || textPassword.Text == "")
- {
- MessageBox.Show("Не все поля заполнены");
- }
- else if (dtl.Rows.Count == 1)
- {
- GlobalVars.Login_user = textLogin.Text.Trim();
- mainFForm.Show();
- textLogin.Clear();
- textPassword.Clear();
- BoolProperty = true;
- this.Close();
- }
- else
- {
- MessageBox.Show("Логин или пароль введены неправильно");
- }
- con.Close();
- }
- private void backB_Click(object sender, EventArgs e)
- {
- mainFForm.Show();
- BoolProperty = false;
- this.Close();
- textLogin.Clear();
- textPassword.Clear();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement