private void Forms_pagos_Load(object sender, EventArgs e) { lbTotal.Text = ""; dtfecha.Format = DateTimePickerFormat.Custom; dtfecha.CustomFormat = "yyyy-MM-dd"; Folios folios = new Folios(); using (folios) { List <Folios> item = folios.getFolios(); lbFolio.Text = item[0].Pagos.ToString(); } txtCodigo.AutoCompleteCustomSource = cargadatos(); txtCodigo.AutoCompleteMode = AutoCompleteMode.Suggest; txtCodigo.AutoCompleteSource = AutoCompleteSource.CustomSource; txtDescripcion.AutoCompleteCustomSource = cargadatos2(); txtDescripcion.AutoCompleteMode = AutoCompleteMode.Suggest; txtDescripcion.AutoCompleteSource = AutoCompleteSource.CustomSource; txtidproveedor.AutoCompleteCustomSource = carga_proveedor1(); txtidproveedor.AutoCompleteMode = AutoCompleteMode.Suggest; txtidproveedor.AutoCompleteSource = AutoCompleteSource.CustomSource; txtproveedor.AutoCompleteCustomSource = carga_proveedor2(); txtproveedor.AutoCompleteMode = AutoCompleteMode.Suggest; txtproveedor.AutoCompleteSource = AutoCompleteSource.CustomSource; }
private void Transfer_forms_Load(object sender, EventArgs e) { this.txtFolios.AutoSize = true; txtCodigo.AutoCompleteCustomSource = cargadatos(); txtCodigo.AutoCompleteMode = AutoCompleteMode.Suggest; txtCodigo.AutoCompleteSource = AutoCompleteSource.CustomSource; //lbFecha.Visible = false; DataTable table = new DataTable(); DataRow row; table.Columns.Add("Text", typeof(string)); table.Columns.Add("Value", typeof(string)); row = table.NewRow(); row["Text"] = ""; row["Value"] = ""; table.Rows.Add(row); Offices oficinas = new Offices(); using (oficinas) { List <Offices> oficina = oficinas.GetOffices(); foreach (Offices ofi in oficina) { row = table.NewRow(); row["Text"] = ofi.Name; row["Value"] = ofi.Id; table.Rows.Add(row); } } cbOficinas.BindingContext = new BindingContext(); cbOficinas.DataSource = table; cbOficinas.DisplayMember = "Text"; cbOficinas.ValueMember = "Value"; cbOficinas.BindingContext = new BindingContext(); if (id_transfer != 0) { Transfers transferencias = new Transfers(); using (transferencias) { List <Transfers> lista = transferencias.getTransferbyid(id_transfer); Det_transfers detalles = new Det_transfers(); Product productos = new Product(); if (lista.Count > 0) { txtFolios.Text = lista[0].Folio.ToString(); lbFecha.Text = "Fecha: " + lista[0].Fecha.ToString(); cbOficinas.SelectedValue = lista[0].Sucursal; using (detalles) { List <Det_transfers> detallado = detalles.getDet_trans(id_transfer); if (detallado.Count > 0) { foreach (Det_transfers item in detallado) { using (productos) { List <Product> producto = productos.getProductById(item.Id_producto); double importe = item.Precio * item.Cantidad; dtProductos.Rows.Add(item.Id_producto, item.Cantidad, producto[0].Code1, producto[0].Description, item.Precio, importe); } } calcula(); nuCantidad.Enabled = false; txtCodigo.Enabled = false; txtDescripcion.Enabled = false; txtPrecio.Enabled = false; } } } } } else { Folios folio = new Folios(); using (folio) { List <Folios> transfer = folio.getFolios(); txtFolios.Text = transfer[0].Transferencia.ToString(); } } }