ポップアウトメッセージボックスがあります。クリックすると常にブラウザの前にメッセージボックスが飛び出しますが、問題はブラウザの後ろに飛び出すことがあることです。メッセージボックスが常にブラウザの前に表示されるようにするためにできることはありますか?ありがとう。
protected void Button1_Click(object sender, EventArgs e)
{
string appointmentdate = Convert.ToString(DropDownListDay.Text + "-" + DropDownListMonth.Text + "-" + DropDownListYear.Text);
string appointmenttime = Convert.ToString(DropDownListTime.Text);
using (SqlConnection con = new SqlConnection("Data Source=USER-PC;Initial Catalog=webservice_database;Integrated Security=True"))
{
con.Open();
SqlCommand data = new SqlCommand("Select COUNT(*) from customer_registration where adate='" + appointmentdate + "'AND atime='" + appointmenttime + "'", con);
Int32 count = (Int32)data.ExecuteScalar();
if (count == 0)
{
SqlConnection con1 = new SqlConnection("Data Source=USER-PC;Initial Catalog=webservice_database;Integrated Security=True");
SqlCommand cmd = new SqlCommand("UPDATE customer_registration SET servicetype = @servicetype, comment = @comment, adate = @adate, atime = @atime where username='" + Session["username"] + "'", con1);
con1.Open();
cmd.Parameters.AddWithValue("@servicetype", DropDownListServicetype.Text);
cmd.Parameters.AddWithValue("@comment", TextBoxComment.Text);
cmd.Parameters.AddWithValue("@adate", DropDownListDay.Text + "-" + DropDownListMonth.Text + "-" + DropDownListYear.Text);
cmd.Parameters.AddWithValue("@atime", DropDownListTime.Text);
cmd.ExecuteNonQuery();
con1.Close();
Response.Redirect("MakeAppointmentSuccess.aspx");
}
else
{
MessageBox.Show("This appointment is not available. Please choose other date & time.");
con.Close();
}
}
}