示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.DropDownList1.SelectedValue == "name")
            {
                DDL = "select * from 旅游预约表 where 游客姓名='" + TextBox10.Text + "'";
            }
            else
            {
                DDL = "select * from 旅游预约表 where 游客编号=" + TextBox10.Text;
            }

            if (!IsPostBack)
            {
                string        connStr = "server=ZHOUKE-PC;database=旅游自助系统;Integrated Security=true";
                SqlConnection conn    = new SqlConnection(connStr);
                //打开连接
                conn.Open();
                string     sql = "select * from 旅游预约表";
                SqlCommand cmd = new SqlCommand(sql, conn);
                using (SqlDataReader dr = cmd.ExecuteReader())
                {
                    TextBox10.DataBind();
                }
                conn.Close();
            }
        }
示例#2
0
 public void clear()
 {
     TextBox9.Clear();
     TextBox7.Clear();
     TextBox15.Clear();
     TextBox13.Clear();
     TextBox11.Clear();
     TextBox10.Clear();
     comboBox1.Text = "";
     comboBox2.Text = "";
 }
示例#3
0
 public void ClearTextBoxes()
 {
     TextBox1.Clear();
     TextBox2.Clear();
     TextBox3.Clear();
     TextBox4.Clear();
     TextBox5.Clear();
     TextBox6.Clear();
     TextBox7.Clear();
     TextBox8.Clear();
     TextBox9.Clear();
     TextBox10.Clear();
     TextBox11.Clear();
     TextBox12.Clear();
     TextBoxID.Clear();
 }
        protected void TextBox9_TextChanged(object sender, EventArgs e)
        {
            string spec = TextBox9.Text;

            if (spec != null || spec != "")
            {
                SqlCommand command = conn.CreateCommand();
                command.CommandText = "update Doctors set speciality=@speciality where name=@name";
                command.Parameters.AddWithValue("name", TextBox8.Text);
                command.Parameters.AddWithValue("speciality", TextBox9.Text);
                conn.Open();
                command.ExecuteNonQuery();
                conn.Close();
            }
            TextBox10.Focus();
        }
    protected void TextBox9_TextChanged(object sender, EventArgs e)
    {
        da = new SqlDataAdapter("select count(uname) from tbl_login where uname='" + TextBox9.Text + "' ", con);
        ds = new DataSet();
        da.Fill(ds, "tbl_login");

        if (ds.Tables["tbl_login"].Rows.Count == 1 && ds.Tables["tbl_login"].Rows[0][0].ToString() == "1")
        {
            Label17.Text      = "Username is not Available.";
            Label17.BackColor = System.Drawing.Color.Red;
            TextBox9.Focus();
        }
        else
        {
            Label17.Text      = "Username is Available.";
            Label17.BackColor = System.Drawing.Color.Green;
            TextBox10.Focus();
        }
    }
示例#6
0
 private void Button2_Click(object sender, EventArgs e)
 {
     TextBox1.Clear();
     TextBox2.Clear();
     TextBox3.Clear();
     TextBox4.Clear();
     TextBox5.Clear();
     TextBox6.Clear();
     TextBox7.Clear();
     TextBox8.Clear();
     TextBox9.Clear();
     TextBox10.Clear();
     ComboBox1.Text       = "Selecione...";
     ComboBox2.Text       = "Selecione...";
     CheckBox1.Checked    = false;
     CheckBox2.Checked    = false;
     CheckBox3.Checked    = false;
     RadioButton1.Checked = false;
     RadioButton2.Checked = false;
     TextBox1.Focus();
 }
示例#7
0
 protected void TextBox9_TextChanged(object sender, EventArgs e)
 {
     item_name2 = TextBox9.Text;
     TextBox10.Focus();
 }
 protected void DropDownList3_SelectedIndexChanged(object sender, EventArgs e)
 {
     TextBox10.Focus();
 }