private void BuscarBoton_Click_1(object sender, EventArgs e) { if (string.IsNullOrEmpty(IdTextBox.Text)) { MessageBox.Show("Tienes el campo ID vacio"); } else { var fact = FacturasBll.Buscar(Convert.ToInt32(IdTextBox.Text)); if (fact != null) { NombreClienteTextBox.Text = fact.NombreCliente; FechaActualDateTimePicker.Text = fact.Fecha.ToString(); MontoAdicionalTextBox.Text = fact.MontoAdicional.ToString(); ImpuestoTextBox.Text = fact.Impuesto.ToString(); DescuentoTextBox.Text = fact.Descuento.ToString(); ComentarioRichTextBox.Text = fact.Comentario; ServiciosDataGridView.DataSource = null; ServiciosDataGridView.DataSource = fact.Service; TipoPagoTextBox.Text = fact.TipoPago; TotalTextBox.Text = fact.Total.ToString(); SubTotalTextBox.Text = fact.SubTotal.ToString(); } else { MessageBox.Show("Esta Factura no Existe"); } } }
public void BuscarTest() { // Assert.Fail(); int id = 1, id2 = 2; Assert.AreNotSame(FacturasBll.Buscar(id).Fecha, FacturasBll.Buscar(id2).Fecha); }