private void IdTextBox_TextChanged(object sender, EventArgs e) { if (IdTextBox.Text.Trim() == string.Empty) { IdTextBox.Focus(); } else { SqlConnection cnn = new SqlConnection(); cnn.ConnectionString = @"Data Source=AMINE-PC\CHA;Initial Catalog=gestion;Persist Security Info=True;User ID=sa;Password=2510"; SqlCommand cmd = new SqlCommand(); cmd.CommandType = CommandType.Text; cmd.CommandText = "select ID,DATE_POINTAGE,HEURE_ENTRE,HEURE_SORTIE,PAUSE,HEURE_CUMULE from pointage where ID = '" + IdTextBox.Text + "' AND MOIS = '" + MoisComboBox.Text + "' AND ANNEE = '" + AnneeTextBox.Text + "'"; cmd.Connection = cnn; sda.SelectCommand = cmd; DataTable dt = new DataTable(); sda.Fill(dt); BindingSource bSource = new BindingSource(); bSource.DataSource = dt; dataGridView1.DataSource = bSource; sda.Update(dt); SqlCommand cmd1 = new SqlCommand("select prenom from pointage where id = '" + IdTextBox.Text + "'", cnn); cnn.Open(); string prenom = Convert.ToString(cmd1.ExecuteScalar()); NomLabel.Text = prenom; NomLabel.ForeColor = Color.Red; } }
private void BuscarButton_Click(object sender, EventArgs e) { Prestamos prestamo = new Prestamos(); if (IdTextBox.Text.Trim() == "") { PrestamoserrorProvider.SetError(IdTextBox, "Especifica el Cliente Id"); IdTextBox.Focus(); } else { PrestamoserrorProvider.Clear(); } if (IdTextBox.TextLength > 0) { if (prestamo.Buscar(Validacion.ConvertirToInt(IdTextBox.Text))) { DevolverDatos(prestamo); GuardarButton.Enabled = true; EliminarButton.Enabled = true; } else { MessageBox.Show("El id que busca no existe"); } } }
private bool Validar() { bool paso = true; if (string.IsNullOrWhiteSpace(IdTextBox.Text)) { MessageBox.Show("No puedes dejar el campo del Id vacio"); IdTextBox.Focus(); paso = false; } if (string.IsNullOrWhiteSpace(NombreTextBox.Text)) { MessageBox.Show("No puedes dejar el campo del Nombre vacio"); NombreTextBox.Focus(); paso = false; } if (string.IsNullOrWhiteSpace(MontoTextBox.Text)) { MessageBox.Show("No puedes dejar el campo del Monto vacio"); MontoTextBox.Focus(); paso = false; } if (string.IsNullOrWhiteSpace(PagoTextBox.Text)) { MessageBox.Show("No puedes dejar el campo del Pago vacio"); PagoTextBox.Focus(); paso = false; } return(paso); }
private void BuscarButton_Click(object sender, EventArgs e) { Rutas ruta = new Rutas(); if (IdTextBox.Text.Trim() == "") { RutaerrorProvider.SetError(IdTextBox, "Especifica el Cliente Id"); IdTextBox.Focus(); } else { RutaerrorProvider.Clear(); } if (IdTextBox.TextLength > 0) { if (ruta.Buscar(Validacion.ConvertirToInt(IdTextBox.Text))) { DevolverDatos(ruta); GuardarButton.Enabled = true; EliminarButton.Enabled = true; } else { MessageBox.Show("NO EXISTE RUTA ID "); } } }
} // Фильтрация записей оценки private async void DeleteBtn_Click(object sender, EventArgs e) { try { if (!string.IsNullOrEmpty(IdTextBox.Text) && !string.IsNullOrWhiteSpace(IdTextBox.Text)) { SqlCommand command = new SqlCommand("DELETE FROM [ocenka] WHERE [id_ocenka]=@id_ocenka", sqlConnection); command.Parameters.AddWithValue("id_ocenka", IdTextBox.Text); await command.ExecuteNonQueryAsync(); MessageBox.Show("Результат оценки сотрудника: " + SotrComBox.Text.ToString() + " удален!"); } else { MessageBox.Show("Код должен быть заполнен!"); } } catch (Exception) { MessageBox.Show("Ошибка: Введено неверное значение!"); } IdTextBox.Clear(); LoadDataOcenka(); } // Удаление записи оценки
private void AgregarButton_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(IdTextBox.Text)) { if (!string.IsNullOrEmpty(NombreTextBox.Text)) { int IdGrupo; int.TryParse(IdTextBox.Text, out IdGrupo); estudiantes.Add(BLL.EstudiantesBLL.Buscar((int)EstudiantesComboBox.SelectedValue)); GrupoEstudiante.Add(new GruposEstudiantes() { Id = 1, EstudianteId = (int)EstudiantesComboBox.SelectedValue, GrupoId = IdGrupo }); EstudiantesDataGridView.DataSource = null; EstudiantesDataGridView.DataSource = estudiantes; } else { MessageBox.Show(this, "No Puedes dejar campos vacíos", "-- AVISO --", MessageBoxButtons.OK, MessageBoxIcon.Warning); if (string.IsNullOrEmpty(NombreTextBox.Text)) { NombreTextBox.Focus(); } else { IdTextBox.Text = (BLL.GruposBLL.UltimoId() + 1).ToString(); IdTextBox.Focus(); } } } }
public void Limpiar() { IdTextBox.Clear(); NombreEstudianteTextBox.Clear(); GrupoTextBox.Clear(); IdEsttextBox.Clear(); }
private void BuscarButton_Click(object sender, EventArgs e) { Clientes cliente = new Clientes(); if (IdTextBox.Text.Trim() == "") { ClienteerrorProvider.SetError(IdTextBox, "Especifica el Cliente Id"); IdTextBox.Focus(); } else { ClienteerrorProvider.Clear(); } if (IdTextBox.TextLength > 0) { if (cliente.Buscar(Validacion.ConvertirToInt(IdTextBox.Text))) { LlenarCampos(cliente); GuardarButton.Enabled = true; EliminarButton.Enabled = true; } else { MessageBox.Show("El id que busca no existe"); } } }
private void Buscarbutton_Click(object sender, EventArgs e) { Cuestionario cues = new Cuestionario(); bool exito = false; int Id = 0; try { if (String.IsNullOrWhiteSpace(IdTextBox.Text).Equals(false)) { Id = Utility.ConvierteEntero(IdTextBox.Text); exito = cues.Buscar(Id); } if (exito) { LlenarCampos(cues); DespuesConsultaBotones(true); ActivarBotones(false); Utility.ActivarTbx(this, false); } else { Utility.Mensajes(this, 1, "No existe!"); IdTextBox.Focus(); } } catch (Exception ex) { Utility.Mensajes(this, 3, ex.Message); } }
private bool Validar() { bool paso = true; if (string.IsNullOrWhiteSpace(CobrosIdTextBox.Text)) { MessageBox.Show("EL campo cobroId no puede estar vacio", "Aviso", MessageBoxButton.OKCancel, MessageBoxImage.Information); CobrosIdTextBox.Focus(); paso = false; } if (string.IsNullOrWhiteSpace(CantidadTextBox.Text)) { MessageBox.Show("EL campo Cantidad no puede estar vacio", "Aviso", MessageBoxButton.OKCancel, MessageBoxImage.Information); CantidadTextBox.Focus(); paso = false; } if (string.IsNullOrWhiteSpace(PreciotextBox.Text)) { MessageBox.Show("Debe realizar un Presio", "Aviso", MessageBoxButton.OKCancel, MessageBoxImage.Information); PreciotextBox.Focus(); paso = false; } if (this.cobro.Detalle.Count == 0) { MessageBox.Show("Debe llenar todos los campos", "Aviso", MessageBoxButton.OKCancel, MessageBoxImage.Information); IdTextBox.Focus(); CobroidTextBox.Focus(); ventaIdtextBox.Focus(); MontooTextBox.Focus(); paso = false; } return(paso); }
private bool verifier() { if (IdTextBox.Text == string.Empty) { MessageBox.Show("Identifiant est Obligatoire", "Erreur", MessageBoxButtons.OK, MessageBoxIcon.Error); IdTextBox.Focus(); } if (EntrerTextBox.Text == string.Empty) { MessageBox.Show("Veuillez entrer l'heure d'entrer", "Erreur", MessageBoxButtons.OK, MessageBoxIcon.Error); EntrerTextBox.Focus(); } if (SortieTextBox.Text == string.Empty) { MessageBox.Show("Veuillez entrer l'heure de sortie", "Erreur", MessageBoxButtons.OK, MessageBoxIcon.Error); SortieTextBox.Focus(); } if (PauseTextBox.Text == string.Empty) { MessageBox.Show("Veuillez entrer la durée du pause", "Erreur", MessageBoxButtons.OK, MessageBoxIcon.Error); PauseTextBox.Focus(); } return(true); }
private void Clear() { _cache.Clear(); _entries.Clear(); idListView.Items.Clear(); IdTextBox.Clear(); totalIdBox.Value = 0; _changed = false; }
private void CleanCampos() { IdTextBox.Clear(); NombresTextBox.Clear(); GruposDataGridView.DataSource = null; GruposGroupBox.Visible = false; IdTextBox.Text = (BLL.EstudiantesBLL.UltimoId()).ToString(); IdTextBox.Focus(); }
private void CleanCampos() { IdTextBox.Clear(); NombresTextBox.Clear(); estudiantes = new List <Estudiantes>(); EstudiantesDataGridView.DataSource = null; IdTextBox.Text = (BLL.GruposBLL.UltimoId()).ToString(); IdTextBox.Focus(); }
private bool verifier() { if (IdTextBox.Text.Trim() == string.Empty) { MessageBox.Show("Identifiant est Obligatoire", "Erreur", MessageBoxButtons.OK, MessageBoxIcon.Error); IdTextBox.Focus(); } return(true); }
//ovde implementiramo sta ce se raditi svaki sekund kada otkuca! private void dtTicker(object sender, EventArgs e) { if (!popunioId) { IdTextBox.Focus(); i++; IdTextBox.Text += i.ToString(); if (i == 7) { popunioId = true; i = 0; } } else if (!popunioBoju) { ColorPicker.Focus(); i++; if (i == 1) { Boja_Click(this, null); } else { Color c = new Color(); c = Color.FromRgb(0, 255, 0); ColorPicker.SelectedColor = c; popunioBoju = true; i = 0; } } else if (!popunioOpis) { OpisPolje.Focus(); i++; OpisPolje.Text += i.ToString(); if (i == 7) { popunioOpis = true; i = 0; } } else if (!selektovanoDodajDugme) { i++; DodajDugme.Focus(); if (i == 3) { selektovanoDodajDugme = true; } } else { DodajDugme_Click(this, null);//na kraju zatvaramo prozor } }
private void Limpiar() { IdTextBox.Clear(); NombreRutatextBox.Clear(); CobradorIdcomboBox.SelectedValue = 0; IdTextBox.Enabled = false; BuscarButton.Enabled = false; GuardarButton.Enabled = true; EliminarButton.Enabled = false; }
//----------------------------------[ AGREGAR FILA - Registro Detallado ]---------------------------------- private void AgregarFilaButton_Click(object sender, RoutedEventArgs e) { var filaDetalle = new MorasDetalle(Convert.ToInt32(IdTextBox.Text), moras.MoraId, Convert.ToInt32(PrestamoIdDetalleTextBox.Text), FechaDetalleaDataPicker.DisplayDate, Convert.ToSingle(ValorTextBox.Text)); moras.Detalle.Add(filaDetalle); Cargar(); IdTextBox.Clear(); ValorTextBox.Clear(); }
private void button5_Click(object sender, EventArgs e) { IdTextBox.Clear(); NameTextBox.Clear(); FnameTextBox.Clear(); AgeTextBox.Clear(); AdreesTextBox.Clear(); TeltextBox.Clear(); CsaltextBox.Clear(); }
public void LimpiarCampos() { IdTextBox.Clear(); NombreTextBox.Clear(); ServicioTextBox.Clear(); CedulaTextBox.Clear(); DireccionTextBox.Clear(); SueldoFijoTextBox.Clear(); ServicioTextBox.Clear(); TelefonoTextBox.Clear(); }
void Limpiar() { IdTextBox.Clear(); pregunta.Text = ""; AradioButton.Text = ""; BradioBtn.Text = ""; CradioBtn.Text = ""; DradioBtn.Text = ""; RepuestaLb.Text = ""; Aceptarbutton.Visible = false; IdTextBox.Focus(); }
private void Limpiar() { IdTextBox.Clear(); NombretextBox.Clear(); ApellidotextBox.Clear(); NombreUsuariotextBox.Clear(); ContrasenatextBox.Clear(); TipoUsuariocomboBox.Text = null; IdTextBox.Enabled = false; BuscarButton.Enabled = false; GuardarButton.Enabled = true; EliminarButton.Enabled = false; }
private void Limpiar() { IdTextBox.Clear(); NombretextBox.Clear(); ApellidotextBox.Clear(); DirecciontextBox.Clear(); TelefonotextBox.Clear(); CelulartextBox.Clear(); CedulatextBox.Clear(); IdTextBox.Enabled = false; BuscarButton.Enabled = false; GuardarButton.Enabled = true; EliminarButton.Enabled = false; }
private bool numeric() { int tempId; bool isNumeric = int.TryParse(IdTextBox.Text.Trim(), out tempId); if (!isNumeric) { MessageBox.Show("L'identifiant doit être une valeur Numerique", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); IdTextBox.Clear(); IdTextBox.Focus(); return(false); } return(true); }
private void displayValidation() { DescriptionTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource(); IdTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource(); NameTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource(); ImageTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource(); TypesComboBox.GetBindingExpression(ComboBox.SelectedValueProperty).UpdateSource(); EraComboBox.GetBindingExpression(ComboBox.SelectedValueProperty).UpdateSource(); IconTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource(); TouristicComboBox.GetBindingExpression(ComboBox.SelectedValueProperty).UpdateSource(); IncomeTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource(); DateTextBox.GetBindingExpression(Xceed.Wpf.Toolkit.MaskedTextBox.TextProperty).UpdateSource(); DateComboBox.GetBindingExpression(ComboBox.SelectedValueProperty).UpdateSource(); }
private void Limpiar() { IdTextBox.Clear(); ClientecomboBox.SelectedIndex = 0; MontotextBox.Clear(); CuotaPtextBox.Clear(); FechaIdateTimePicker.Text = string.Empty; FechaFdateTimePicker.Text = string.Empty; SemanaNotextBox.Clear(); PagoTotaltextBox.Clear(); IdTextBox.Enabled = false; BuscarButton.Enabled = false; GuardarButton.Enabled = true; EliminarButton.Enabled = false; }
public MedicineWindow(Medicine medicine) { InitializeComponent(); DataContext = medicine; if (medicine.Id == 0) { IdTextBox.Focus(); } else { NameTextBox.Focus(); } }
private bool verifier() { if (IdTextBox.Text == string.Empty) { MessageBox.Show("Veuillez entrer un Idenfifiant", "Erreur", MessageBoxButtons.OK, MessageBoxIcon.Error); IdTextBox.Focus(); } if (PauseTextBox.Text == string.Empty) { MessageBox.Show("Durée de pause est Obligatoire", "Erreur", MessageBoxButtons.OK, MessageBoxIcon.Error); PauseTextBox.Focus(); } return(true); }
public void Limpiar() { DescuentoTextBox.Text = 0.ToString(); PorcientoDescuentoTextBox.Text = 0.ToString(); IdTextBox.Clear(); ImpuestoTextBox.Text = 18.ToString(); MontoAdicionalTextBox.Text = 0.ToString(); ComentarioRichTextBox.Text = "Comentario"; TipoPagoTextBox.Clear(); ServiciosDataGridView.DataSource = null; NombreClienteTextBox.Clear(); TotalTextBox.Text = 0.00m.ToString(); SubTotalTextBox.Text = 0.00.ToString(); f = new Facturas(); }
private void EditTagButton_Click(object sender, RoutedEventArgs e) { newTag.Description = DescriptionTextBox.Text; TagColor = ColorPickerCP.SelectedColor.Value; IdTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource(); DescriptionTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource(); ColorPickerCP.GetBindingExpression(ColorPicker.SelectedColorProperty).UpdateSource(); bool validation = ValidateForm(); if (validation == false) { return; } newTag.Color = new models.Color(TagColor); EditTagCallback(newTag); EditTagButton.IsCancel = true; }