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 Orar3
- {
- public partial class OrarLogin : Form
- {
- public OrarLogin()
- {
- InitializeComponent();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- private void MinimizeButton_Click(object sender, EventArgs e)
- {
- this.WindowState = FormWindowState.Minimized;
- }
- private void MaximizeButton_Click_1(object sender, EventArgs e)
- {
- if (this.WindowState == FormWindowState.Normal)
- this.WindowState = FormWindowState.Maximized;
- else
- this.WindowState = FormWindowState.Normal;
- }
- private void LoginButton_Click(object sender, EventArgs e)
- {
- SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=C:\Users\Andrei\Desktop\LogIn Files SQL\LogInData.mdf;Integrated Security=True;Connect Timeout=30;");
- SqlDataAdapter sda = new SqlDataAdapter("Select Count(*) From Login where USERNAME='" + UsernameBox.Text + "' and PASSWORD='" + PasswordBox.Text + "'", con);
- DataTable dt = new DataTable();
- sda.Fill(dt);
- if (dt.Rows[0][0].ToString() == "1")
- {
- this.Hide();
- OrarMenu menu = new OrarMenu();
- menu.Show();
- }
- else
- MessageBox.Show("Greseala, te rog incearca inca o data");
- }
- }
- }
Add Comment
Please, Sign In to add comment