UserconfirmPwd=DB.GetUserFromMysqlWhere($"userPassword = MD5('{pwdCurrentPassword.Password}')");//HAETAAN KYTTÄJÄ, JONKA SALASANA VASTAA CURRENT PASSWORD KENTÄN SISÄLTÖÄ
List<string>attributes=newList<string>();
List<string>attributes=newList<string>();//LUODAAN SQL QUERRY:N LUONTIA VARTEN APULISTA
txbMessages.Text=$"Here you can see tools, filtered by location: {cbCityFilter.SelectedValue.ToString()} and category: {cbToolCategory.SelectedValue.ToString()}.";
txbMessages.Text=$"Here you can see tools, filtered by category: {cbToolCategory.SelectedValue.ToString()}.";
}
else
if(cbCityFilter.SelectedValue!=null&&cbToolCategory.SelectedValue!=null)//SUODATTIMISSA ON OLETUKSENA VALITTU VALUE[0], JOKA ON 'All categories' JA 'All cities'
txbMessages.Text=$"Here you can see tools, filtered by location: {cbCityFilter.SelectedValue.ToString()} and category: {cbToolCategory.SelectedValue.ToString()}.";
}
elseif(location=="All cities"&&cbToolCategory.SelectedValue.ToString()!="All categories")//JOS KATEGORIA SUODATTIMESSA ON VALITTU JOTAIN
if(!string.IsNullOrEmpty(txtDays.Text)&&int.TryParse(txtDays.Text,outintnum))//TARKISTETAAN ETTÄ PÄIVIEN MÄÄRÄ ON SYÖTETTY OIKEIN
{
varresult=MessageBox.Show($"Do you really want to rent {toolName} for {txtDays.Text} and {txbTotalPrice.Text}?","iTool: Rent a Tool",MessageBoxButton.YesNo);
varresult=MessageBox.Show($"Do you really want to rent {toolName} for {txtDays.Text} and {txbTotalPrice.Text}?","iTool: Rent a Tool",MessageBoxButton.YesNo);//YES/NO VARMISTUSIKKUNA
if(result==MessageBoxResult.Yes)
if(result==MessageBoxResult.Yes)//JOS ON VASTATTU 'YES'