Ejemplo n.º 1
0
        public void button2_Click(object sender, EventArgs e)
        {
            string        conString = @"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\bogda\Documents\Data.mdf;Integrated Security=True;Connect Timeout=30";
            SqlConnection con       = new SqlConnection(conString);

            try
            {
                con.Open();
            }
            catch (Exception)
            {
                MessageBox.Show("couldn't open database");
            }
            SqlDataAdapter sda = new SqlDataAdapter("Select  Count(*) FROM login where username ='******'and password ='******'", con);

            DataTable dt = new DataTable();

            sda.Fill(dt);
            if (dt.Rows[0][0].ToString() == "1")
            {
                this.Hide();
                Main ss = new Main(textBox1.Text.ToString());

                ss.Show();
            }
            else
            {
                MessageBox.Show("This account doesn't exist.Please signup!");
                this.Hide();
                Signup sign = new Signup();
                sign.Show();
            }
        }
Ejemplo n.º 2
0
        private void button5_Click(object sender, EventArgs e)
        {
            Signup sgn = new Signup();

            this.Hide();
            sgn.Show();
        }
Ejemplo n.º 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            SqlConnection con   = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=F:\EDUCATION\1 Year SEM 3\Object Oriented Programming with C#\Assigments\SEM END Project\All-IN-CARE-FORM-APPLICATION\AllInCare.mdf;Integrated Security=True;Connect Timeout=30");
            string        query = "insert into RiderSettings(Username,FirstName,LastName,BirthDate,AdressLine1,AdressLine2,ZipCode,Province,Email,MobileNo1,LicensePlate,Password,ConfirmPassword) values ('" + unameTxt.Text + "','" + fnameTxt.Text + "','" + lnameTxt.Text + "','" + bdayCal.Value + "','" + ad1Txt.Text + "','" + ad2Txt.Text + "','" + zipTxt.Text + "','" + provCmb.Text + "','" + emailTxt.Text + "','" + mobileTxt.Text + "','" + licpTxt.Text + "','" + pwTxt.Text + "','" + conpwTxt + "')";
            SqlCommand    cmd   = new SqlCommand(query, con);

            try
            {
                if (pwTxt.Text == conpwTxt.Text)
                {
                    con.Open();
                    cmd.ExecuteNonQuery();
                    MessageBox.Show("Thank you for choosing ALL-IN-CARE");
                    this.Hide();
                    PRLogin log = new PRLogin();
                    log.Show();
                }
                else
                {
                    MessageBox.Show("The password you entered is not matching with the previous one try again");
                    Signup log = new Signup();
                    log.Show();
                }
            }
            catch (SqlException ex)
            {
                MessageBox.Show("Form Submission Failed");
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                con.Close();
            }
        }
Ejemplo n.º 4
0
 public StartUpForm()
 {
     InitializeComponent();
     loginform  = new LoginForm(this);
     signupform = new Signup(this);
     MainPanel.Controls.Add(loginform);
     MainPanel.Controls.Add(signupform);
     loginform.Show();
     signupform.Show();
     loginform.BringToFront();
 }
Ejemplo n.º 5
0
 public StartUpForm()
 {
     InitializeComponent();
     //Creates the File..
     File_Creator();
     //Setting up the main panel...
     loginform  = new LoginForm(this);
     signupform = new Signup(this);
     MainPanel.Controls.Add(loginform);
     MainPanel.Controls.Add(signupform);
     loginform.Show();
     signupform.Show();
     loginform.BringToFront();
 }