public ActionResult Details(int id) { var clienteBuscar = clien.BuscarCliente(id); var clienteMostrar = Mapper.Map <Models.Cliente>(clienteBuscar); return(View(clienteMostrar)); }
private void btnFacturar_Click(object sender, EventArgs e) { try { var cliente = cli.BuscarCliente((int)nupIdCliente.Value); if (cliente != null) { var factura = new Factura { Id_Cliente = cliente.Id_Cliente, PrecioTotal = 0, Fecha = hoy }; fac.Facturar(factura); MessageBox.Show("Seleccionemos los productos", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information); frmCompra form = new frmCompra(); form.Show(); Hide(); } else { MessageBox.Show("Cliente no existente", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch (Exception ex) { MessageBox.Show(string.Format("Ocurrió un error: {0}", ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error)); } }
protected void btnBuscar_Click(object sender, EventArgs e) { try { var cliente = clie.BuscarCliente(Convert.ToInt32(txtCedula1.Text)); if (cliente != null) { txtCedula1.Text = cliente.IdCliente.ToString(); txtCedula.Text = cliente.Cedula.ToString(); txtNombre.Text = cliente.Nombre; txtApellidos.Text = cliente.Apellido.ToString(); txtDireccion.Text = cliente.Direccion.ToString(); txtTelefono.Text = cliente.Telefono.ToString(); divMantenimiento.Visible = true; txtCedula1.Enabled = false; } else { MostarMensajeError("El cliente no existe"); } } catch (Exception) { MostarMensajeError("Ocurrio un error"); } }
protected void BtnBuscar_Click(object sender, EventArgs e) { try { var descProducto = ds.BuscarDescProducto(txtBuscarPlaca.Text); var auto = aut.BuscarAuto(txtBuscarPlaca.Text); var cliente = cli.BuscarCliente(txtBuscarPlaca.Text); if (auto != null) { LbRCorreo.Text = cliente.Correo; LbRMovil.Text = cliente.Movil.ToString(); LbRMarca.Text = auto.Marca; LbRPlaca.Text = auto.Placa; TxtNombreCliente.Text = cliente.NombreCliente; LbRKm.Text = auto.KM.ToString(); LbRCedula.Text = cliente.Cedula.ToString(); TextBox3.Text = descProducto.Cantidad.ToString(); TextBox2.Text = descProducto.Descripcion; TextBox1.Text = descProducto.Precio.ToString(); } else { MostarMensajeError("El auto no existe"); } } catch (Exception) { MostarMensajeError("Ocurrio un error"); } }
private void frmPago_Load(object sender, EventArgs e) { var factura = fact.ListarFacturas(); var factura2 = factura.Last(); var cliente = cli.BuscarCliente(factura2.Id_Cliente); txtFecha.Text = factura2.Fecha.ToString(); txtFactura.Text = factura2.Id_Factura.ToString(); txtCliente.Text = cliente.Nombre; txtTotal.Text = factura2.PrecioTotal.ToString(); }
protected void BtnBuscarAuto_Click(object sender, EventArgs e) { try { var cliente = cli.BuscarCliente(TxtBusplaIngVeh.Text); var auto = aut.BuscarAuto(TxtBusplaIngVeh.Text); if (auto != null) { TxtCedula.Text = cliente.Cedula.ToString(); TxtProVeh.Text = auto.ProblemasVehiculo; TxtPlaca.Text = auto.Placa; TxtEstilo.Text = auto.Estilo; TxtMarca.Text = auto.Marca; TxtAno.Text = auto.Ano.ToString(); TxtNota.Text = auto.Nota; TxtBin.Text = auto.Bin.ToString(); TxtKM.Text = auto.KM.ToString(); TxtRevInt.Text = auto.RevisionIntervalos; TxtManPrev.Text = auto.MantenimientoPrevio; TxtDanVeh.Text = auto.DanosVehiculo; TxtNCliente.Text = cliente.NombreCliente; TxtTelefono.Text = cliente.Telefono.ToString(); TxtMovil.Text = cliente.Movil.ToString(); TxtCorreo.Text = cliente.Correo; TxtPlaca.Text = cliente.Placa; } else { MostarMensajeError("El auto no existe"); } } catch (Exception) { MostarMensajeError("Ocurrio un error"); } }