protected void ImageButtonClearFields_Click(object sender, ImageClickEventArgs e) { //lets clear some fields... //reset it to the default text TextBoxSec3EmailBody.Text = @"Thanks for including me in the planning of your vacation. I think a Carnival cruise would be a great choice for your next trip. Carnival offers a broad range of options for onboard fun, including a Waterworks(tm) water park, a luxury spa, award-winning youth programs, and gourmet and casual dining options. There truly is something for everyone. Please let me knmow if you have any questions. I look forward to helping you plan a fantastic vacation."; TextBoxSec3Subject.Text = "Your Carnival cruise eBrochure"; //clear the rest TextBoxOfferPrice.Text = TextBoxSec2Recipients.Text = TextBoxSec4AgencyName.Text = TextBoxSec4AgencyWebsite.Text = TextBoxSec4City.Text = TextBoxSec4EmailAddress.Text = TextBoxSec4FaxNumber.Text = TextBoxSec4FirstName.Text = TextBoxSec4LastName.Text = TextBoxSec4PhoneExt.Text = TextBoxSec4PhonePart1.Text = TextBoxSec4PhonePart2.Text = TextBoxSec4PhonePart3.Text = TextBoxSec4State.Text = TextBoxSec4Street.Text = TextBoxSec4TollFreeNumber.Text = TextBoxSec4Zip.Text = String.Empty; DropDownListDays.ClearSelection(); DropDownListDestinations.ClearSelection(); CheckBoxSend.Checked = true; //defaul is true }
public void UpdateGridviewDentist() { SqlConnection conn = new SqlConnection(@"data source = .\sqlexpress; integrated security = true; database = Dentist"); SqlCommand cmd = null; SqlDataReader rdr = null; try { conn.Open(); cmd = conn.CreateCommand(); cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "ShowDentistAll"; rdr = cmd.ExecuteReader(); GridViewRes.DataSource = rdr; GridViewRes.DataBind(); } catch (Exception ex) { LabelMessage.Text = ex.Message; } finally { conn.Close(); } SqlDataAdapter da = null; DataSet ds = null; DataTable dt = null; string sqlsel = "select * from Patient"; try { da = new SqlDataAdapter(); da.SelectCommand = new SqlCommand(sqlsel, conn); ds = new DataSet(); da.Fill(ds, "MyTreatments"); dt = ds.Tables["MyTreatments"]; DropDownListPatients.DataSource = dt; DropDownListPatients.DataTextField = "P_Id"; DropDownListPatients.DataValueField = "P_Id"; DropDownListPatients.DataBind(); DropDownListPatients.Items.Insert(0, "Select a Patient"); } catch (Exception ex) { LabelMessage.Text = ex.Message; } finally { conn.Close(); } string sqlselday = "select * from Reservations"; try { da = new SqlDataAdapter(); da.SelectCommand = new SqlCommand(sqlselday, conn); ds = new DataSet(); da.Fill(ds, "MyRes"); dt = ds.Tables["MyRes"]; DropDownListDays.DataSource = dt; DropDownListDays.DataTextField = "R_Date"; DropDownListDays.DataValueField = "R_Date"; DropDownListDays.DataBind(); DropDownListDays.Items.Insert(0, "Select a Day"); } catch (Exception ex) { LabelMessage.Text = ex.Message; } finally { conn.Close(); } }