Open Robertalk072 opened 7 months ago
//async function btnSave_OnClick( sender, eventArgs ){
//const HealthInfo = {
//
// "PLAYER_ID": cboName.SelectedValue,
// "Blood" :txtBlood.Text.Trim(),
// "Heart" :txtHeart.Text.Trim(),
// "Bmi" :txtBmi.Text.Trim(),
// "FAT" :txtFAT.Text.Trim(),
// "Lung" :txtLung.Text.Trim(),
// "Flexibility" :txtFlex.Text.Trim(),
// "Strength" :txtStrength.Text.Trim(),
// "Balance" :txtBalance.Text.Trim(),
// "Agility" :txtAgy.Text.Trim(),
// "Reaction" :txtReact.Text.Trim(),
//
//
// };
//
// const HealthId = await lims.CallServerAsync("Player_Profile.SaveHealth.AddHealth", [HealthInfo]);
// alert("your report has been made")
// form.Close();
//
//}
Functie die wel werkt :
async function btnSave_OnClick(sender, eventArgs) { // Deactiveer de save button om herhaald klikken te voorkomen
try {
const HealthInfo = {
"PLAYER_ID": cboName.SelectedValue,
"Blood": txtBlood.Text.trim(),
"Heart": txtHeart.Text.trim(),
"Bmi": txtBmi.Text.trim(),
"FAT": txtFAT.Text.trim(),
"Lung": txtLung.Text.trim(),
"Flexibility": txtFlex.Text.trim(),
"Strength": txtStrength.Text.trim(),
"Balance": txtBalance.Text.trim(),
"Agility": txtAgy.Text.trim(),
"Reaction": txtReact.Text.trim()
};
const HealthId = await lims.CallServerAsync("Player_Profile.SaveHealth.AddHealth", [HealthInfo]);
alert("Your report has been saved successfully");
form.Close();
} catch (error) {
alert("An error occurred while saving the report: " + error);
}
} ``