protected void ClassDrop_SelectedIndexChanged(object sender, EventArgs e) { int TOTALPERSONS; int CLASSTYPE; int total; TOTALPERSONS = Convert.ToInt32(noofperson.SelectedItem.Text); CLASSTYPE = ClassDrop.SelectedIndex; trainscmd = new SqlCommand("select * from FARE where TRAIN_NO=" + TextBox2.Text, con); trainsda = new SqlDataAdapter(trainscmd); DataTable dtfare = new DataTable(); trainsda.Fill(dtfare); int nm; if (CLASSTYPE == 1) { Object o = dtfare.Rows[0]["SLEEPER"]; nm = Convert.ToInt32(o); total = TOTALPERSONS * nm; txttotal.Text = total.ToString(); } else if (CLASSTYPE == 2) { Object o = dtfare.Rows[0]["ACI"]; nm = Convert.ToInt32(o); total = TOTALPERSONS * nm; txttotal.Text = total.ToString(); } else if (CLASSTYPE == 3) { Object o = dtfare.Rows[0]["ACII"]; nm = Convert.ToInt32(o); total = TOTALPERSONS * nm; txttotal.Text = total.ToString(); } else if (CLASSTYPE == 4) { Object o = dtfare.Rows[0]["ACIII"]; nm = Convert.ToInt32(o); total = TOTALPERSONS * nm; txttotal.Text = total.ToString(); } Button2.Focus(); }
private void Button1_Click(object sender, RoutedEventArgs e) { try { Tip1.FadeOut(); Tip2.AfterFadeIn += (s, evt) => { Button2.Focus(); }; Tip2.FadeIn(); } catch (Exception ex) { Diagnostics.LogException(ex); OnError(); } }
private void button1_Click(object sender, EventArgs e) { //RECEBE O VALOR DOS TXTBOX E EXEBI NA CAIDA DE RESULADO SOMA int resultado = Convert.ToInt32(textBox1.Text) + Convert.ToInt32(textBox2.Text) + Convert.ToInt32(textBox3.Text); textBox5.Text = resultado.ToString(); Button2.Focus(); // ERRO PRA FAZER A MEDIA double media = (Convert.ToDouble(textBox1.Text) + Convert.ToDouble(textBox2.Text) + Convert.ToDouble(textBox3.Text)) / 3; //.ToString("F2") tanto de casa que vai aparecer depois da virgula (,) textBox4.Text = media.ToString("F2"); MessageBox.Show("acertou mizeravi"); }
protected void TextBox2_TextChanged(object sender, EventArgs e) { Button2.Focus(); }
protected void Button2_Click(object sender, EventArgs e) { string firstName, lastName, id, password, cellPhone, workPhone, cellProvider, category; bool encryption; Label2.Visible = true; string url = TextBox11.Text; if (url == null || url.Length == 0) { Label2.Text = "Enter Valid Url"; TextBox11.Focus(); return; } firstName = TextBox4.Text; if (firstName == null || firstName.Length == 0) { Label2.Text = "Enter First Name"; TextBox4.Focus(); return; } lastName = TextBox5.Text; if (lastName == null || lastName.Length == 0) { Label2.Text = "Enter Last Name"; TextBox5.Focus(); return; } id = TextBox6.Text; if (id == null || id.Length == 0) { Label2.Text = "Enter Id"; TextBox6.Focus(); return; } password = TextBox7.Text; if (password == null || password.Length == 0) { Label2.Text = "Enter Password"; TextBox7.Focus(); return; } workPhone = TextBox8.Text; if (workPhone == null || workPhone.Length == 0) { Label2.Text = "Enter Work Phone"; TextBox8.Focus(); return; } cellPhone = TextBox9.Text; if (cellPhone == null || cellPhone.Length == 0) { Label2.Text = "Enter Cell Phone"; TextBox9.Focus(); return; } cellProvider = TextBox10.Text; /* if (cellProvider == null || cellProvider.Length == 0) * { * Label2.Text = "Enter Cell Provider"; * TextBox10.Focus(); * return; * }*/ category = testSelect.Value; encryption = CheckBox1.Checked; Label2.Visible = true; List <String> data = new List <string>(); Label2.Text = category; data.Add(firstName); data.Add(lastName); data.Add(id); if (encryption) { EncryptionService.ServiceClient encryptSVC = new EncryptionService.ServiceClient(); data.Add(encryptSVC.Encrypt(password)); } else { data.Add(password); } data.Add(workPhone); data.Add(cellPhone); data.Add(category); data.Add(encryption.ToString()); data.Add(cellProvider); XmlService.Service1Client svc = new XmlService.Service1Client(); string response = svc.addPerson(data.ToArray(), url); Label2.Text = response; Button2.Focus(); }
protected void Button1_Click(object sender, EventArgs e) { Button2.Focus(); Label1.Text = "button1 clicked & button2 in focus"; }