private void GrdFacturas_DoubleClick(object sender, EventArgs e) { if (grdInvoices.SelectedRows.Count > 0) { _FacturaEnCurso = (ARInvoiceAV)grdInvoices.SelectedRows[0].Cells[5].Value; ChangeCurrentInvoiceIndex(grdInvoices.SelectedRows[0].Index); BindViewFactura(); BindViewEmisor(); BindViewCliente(); } }
/// <summary> /// Reinicia la factura en curso. /// </summary> private void ResetFactura() { _FacturaEnCurso = new ARInvoiceAV { InvoiceType = InvoiceType.F1, // Factura normal ClaveRegimenEspecialOTrascendencia = ClaveRegimenEspecialOTrascendencia.RegimenComun, SellerParty = _Emisor, // El emisor de la factura BuyerParty = new Party() // El cliente }; // factura ChangeCurrentInvoiceIndex(-1); }
private void BindViewInvoices() { grdInvoices.Rows.Clear(); // Manera antigua de hacerlo //foreach (var invoice in _LoteDeFacturasEmitidas.ARInvoicesAV) // grdInvoices.Rows.Add(invoice.InvoiceNumber, invoice.IssueDate, // invoice.BuyerParty.TaxIdentificationNumber, invoice.BuyerParty.PartyName, // invoice.GrossAmount, invoice, MSeniorSII.Properties.Resources.Ribbon_New_32x32); foreach (IBatchItem item in _LoteDeFacturasEmitidas.BatchItems) { ARInvoiceAV facturaTmp = (ARInvoiceAV)item; grdInvoices.Rows.Add(facturaTmp.InvoiceNumber, facturaTmp.IssueDate, facturaTmp.BuyerParty.TaxIdentificationNumber, facturaTmp.BuyerParty.PartyName, facturaTmp.GrossAmount, facturaTmp, MSeniorSII.Properties.Resources.Ribbon_New_32x32); } if (_SeletedInvoiceIndex != -1) { grdInvoices.Rows[_SeletedInvoiceIndex].Selected = true; } }