//BOTÓN BUSCAR POR ID private void BtnBuscarID_Click(object sender, System.Windows.RoutedEventArgs e) { int id; if (int.TryParse(TxtID.Text, out id) == true) { personasBusquedas.Clear(); DtgClientes.ItemsSource = null; /*Recorre el Array de personas y si encuentra el ID que escribimos * agrega la persona*/ foreach (Persona i in Contenedor.ArrayPersonas) { if (i.IdPersona.ToString() == TxtID.Text) { personasBusquedas.Add(i); } } MessageBox.Show(personasBusquedas.Count.ToString() + " clientes encontrados"); //Muestra el Array DtgClientes.ItemsSource = null; DtgClientes.ItemsSource = personasBusquedas; TxtID.Clear(); TxtBuscar.IsEnabled = true; BtnBuscar.IsEnabled = true; } else { MessageBox.Show("Verificar ID"); } }
private void BtnReset_Click(object sender, EventArgs e) { TxtID.Clear(); TxtName.Clear(); ChkClose.Checked = false; ChkOpen.Checked = false; }
private void BtGuardar_Click(object sender, EventArgs e) { try { MemoryStream ms = new System.IO.MemoryStream(); PBImage.Image.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg); DataBaseControl DbControl = new DataBaseControl(DataBaseControl.cPath, "ProjectDataBase.mdf"); string[] parameters = { "@id", "@nombre", "@image" }; string[] values = { TxtID.Text, TxtNombre.Text }; if (DbControl.Insertar("Insert into Maestros values (@id,@nombre,@image)", parameters, values, ms)) { MessageBox.Show(string.Format("{0} agregado", TxtNombre.Text)); TxtID.Clear(); TxtNombre.Clear(); PBImage.Image = Image.FromFile("intec.png"); Verificar(); } else { MessageBox.Show(string.Format("{0} no agregado", TxtNombre.Text)); } } catch (Exception) { MessageBox.Show("Por favor, revisar los valores agregados"); } }
/// <summary>Clears all TextBoxes.</summary> private void Clear() { TxtID.Clear(); TxtFirstName.Clear(); TxtLastName.Clear(); TxtID.Focus(); }
} // end method BtnAddClear_Click() /// <summary> /// To clear the add course fields /// </summary> private void AddClear() { //Clear all Add fields CBxInstitution.ResetText(); TxtID.Clear(); TxtDescription.Clear(); CBxGrade.SelectedIndex = -1; CBxGrade.Text = string.Empty; CBxCredits.SelectedIndex = -1; CBxCredits.Text = string.Empty; } // end method AddClear()
} // end method TxtID_Leave() /// <summary> /// To reset all controls on the add_emp form to their defaults /// </summary> private void ResetFields() { //Clear all txtboxes and reset radioBtns to HOURLY TxtID.Clear(); TxtFirstName.Clear(); TxtLastName.Clear(); TxtHourlyRate.Clear(); TxtMonthlySalary.Clear(); TxtCommissionRate.Clear(); TxtContractWage.Clear(); RBtnHourly.Checked = true; } // end method ResetFields()
private void BtnTemizle_Click(object sender, EventArgs e) { TxtYil.Clear(); TxtAy.Clear(); TxtTarih.Clear(); TxtFirma.Clear(); TxtSube.Clear(); TxtTutar1.Clear(); TxtTutar2.Clear(); TxtTtutar3.Clear(); TxtID.Clear(); TxtYil.Focus(); }
public void ClearTextBoxes() { TxtID.Clear(); TxtName.Clear(); TxtUnitMeasure.Clear(); TxtQuantity.Clear(); TxtUnitValue.Clear(); TxtIVA.Clear(); TxtWarehouseQuantity.Clear(); TxtDiscount.Clear(); TxtID.Focus(); }
/// <summary>Clears all TextBoxes.</summary> private void Clear() { TxtID.Clear(); CmbCourse.SelectedIndex = -1; CmbTeacher.SelectedIndex = -1; TxtDaily.Clear(); TxtHomework.Clear(); TxtProject.Clear(); TxtQuiz.Clear(); TxtReport.Clear(); TxtTest.Clear(); TxtStartTime.Text = "9:00 AM"; TxtEndTime.Text = "9:50 AM"; TxtID.Focus(); TxtError.Visibility = Visibility.Collapsed; }
/// <summary> /// actually clears each textbox in the form /// </summary> private void ClearNewEmpForm() { EpForm.Clear(); TxtID.Clear(); TxtFirstName.Clear(); TxtLastName.Clear(); TxtAddress.Clear(); TxtCity.Clear(); CBxState.SelectedIndex = -1; CBxEmpType.SelectedIndex = -1; TxtZip.Clear(); TxtHireDate.Clear(); CBxMarriageStatus.SelectedIndex = -1; TxtDept.Clear(); TxtJobTitle.Clear(); LblAfterSubmitMsg.Text = ""; TxtPayAmount.Visible = false; LblPayAmount.Visible = false; LblSecondInput.Visible = false; TxtSecondInput.Visible = false; }
private void TxtID_GotFocus(object sender, System.Windows.RoutedEventArgs e) { TxtID.Clear(); TxtBuscar.IsEnabled = false; BtnBuscar.IsEnabled = false; }
} // end method Search() /// <summary> /// To clear the ID and last name search fields /// </summary> /// <param name="sender">The object generating the event</param> /// <param name="e">The event args</param> private void BtnClear_Click(object sender, EventArgs e) { //Clear search fields TxtID.Clear(); TxtLName.Clear(); } // end method BtnClear_Click()