private void LoginButton_Click(object sender, EventArgs e) { User_info temp = new User_info(); temp.Email = this.textBoxEmail2.Text; temp.Password = this.textBoxHaslo.Text; User_info userLogin = new User_info(); logic.LoadUserInfo(userLogin, temp.Email); if (userLogin.Password == temp.Password) { int userLogged = userLogin.Id; Komunikator okno = new Komunikator(userLogged); okno.Show(); this.Hide(); } }
private void LoginButton_Click(object sender, EventArgs e) { Komunikator okno = new Komunikator(); okno.Show(); }
private void buttonRegister_Click(object sender, EventArgs e) { User_info info = new User_info(); try { List <string> birth = new List <string>(); birth.Add(textBoxR.Text); birth.Add(textBoxM.Text); birth.Add(textBoxD.Text); string bdate = string.Join("-", birth); DateTime dt = DateTime.Parse(bdate); info.Name = this.textBoxName.Text; info.Surname = this.textBoxSurname.Text; info.City = this.textBoxCity.Text; info.Email = this.textBoxEmail.Text; info.Password = this.textBoxPassword.Text; info.Birthdate = dt; //+ this.comboBoxMonth.SelectedText + this.comboBoxYear.SelectedText; info.isBusy = false; info.isConnected = false; if (radioButtonFemale.Checked) { info.Sex = this.radioButtonFemale.Text; } else if (radioButtonMale.Checked) { info.Sex = this.radioButtonMale.Text; } if (radioButtonUndefined.Checked) { info.Sex = "inny"; } } catch (Exception ex) { throw ex; } logic.AddUserInfo(info); logic.LoadUserInfo(info, info.Email); try{ if (checkBoxAnimals.Checked) { logic.AddInterest(info, 4); } if (checkBoxBlogs.Checked) { logic.AddInterest(info, 8); } if (checkBoxCuisine.Checked) { logic.AddInterest(info, 2); } if (checkBoxEntertaiment.Checked) { logic.AddInterest(info, 5); } if (checkBoxFashion.Checked) { logic.AddInterest(info, 3); } if (checkBoxGames.Checked) { logic.AddInterest(info, 7); } if (checkBoxMovies.Checked) { logic.AddInterest(info, 12); } if (checkBoxMusic.Checked) { logic.AddInterest(info, 10); } if (checkBoxRecreation.Checked) { logic.AddInterest(info, 14); } if (checkBoxSport.Checked) { logic.AddInterest(info, 1); } if (checkBoxTechnology.Checked) { logic.AddInterest(info, 6); } if (checkBoxTheatre.Checked) { logic.AddInterest(info, 13); } if (checkBoxTravels.Checked) { logic.AddInterest(info, 15); } if (checkBoxTV.Checked) { logic.AddInterest(info, 11); } /*if (checkBoxAnimals.Checked == false && * checkBoxBlogs.Checked == false && * checkBoxCuisine.Checked == false && * checkBoxEntertaiment.Checked == false && * checkBoxFashion.Checked == false && * checkBoxGames.Checked == false && * checkBoxMovies.Checked == false && * checkBoxMusic.Checked == false && * checkBoxPersonalGrowth.Checked == false && * checkBoxRecreation.Checked == false && * checkBoxSport.Checked == false && * checkBoxTechnology.Checked == false && * checkBoxTheatre.Checked == false && * checkBoxTravels.Checked == false && * checkBoxTV.Checked == false) * { * MessageBox.Show("Zaznacz CO NAJMNIEJ jedno"); * } */ MessageBox.Show("Zarejestrowano pomyślnie"); loggedUser = info.Id; Komunikator okno = new Komunikator(loggedUser); okno.Show(); this.Hide(); } catch (Exception exc) { throw exc; } }