//SIGN IN private void btn_SignIn_Click(object sender, EventArgs e) { if (string.IsNullOrWhiteSpace(txtBox_Password.Text) || string.IsNullOrWhiteSpace(txtBox_Login.Text)) { MessageBox.Show("There are an empty field!!!"); } else { DataBaseOperations db_operation = DataBaseOperations.getSample(); CustomerInfo customerInfo = db_operation.SelectUser(txtBox_Login.Text, txtBox_Password.Text); if (customerInfo != null) { MessageBox.Show(customerInfo.Customerid.ToString()); db_operation.InsertLogger(0); this.Hide(); MessageBox.Show("You have entered!!!"); MessageBox.Show("" + customerInfo.Customeraddress); MainAppForm mainForm = new MainAppForm(); mainForm.ShowDialog(); mainForm = null; txtBox_Login.Clear(); txtBox_Password.Clear(); } } }
// SIGN UP private void btn_SignUp_Click(object sender, EventArgs e) { if (CheckValidity()) { MemoryStream memStream = new MemoryStream(); picBox_ProfileImage.Image.Save(memStream, picBox_ProfileImage.Image.RawFormat); byte[] ImageData = memStream.ToArray(); DataBaseOperations db_operation = DataBaseOperations.getSample(); bool result = db_operation.InsertUser(tB_SignUp_Adress.Text, tB_SignUp_Email.Text, tB_SignUp_Login.Text, tB_SignUp_Name.Text, tB_SignUp_Password.Text, rB_SignUp_male.Checked, ImageData ); if (result) { MessageBox.Show("You was succesfully registrated"); } } }