protected void btnGuardar_Click(object sender, EventArgs e)
        {
            var factura = new Factura
            {
                FacturaId    = Factura.FacturaId,
                Codigo       = txtCodigo.Text,
                Total        = double.Parse(txtTotal.Text),
                TipoId       = int.Parse(ddlTipo.SelectedValue),
                Igv          = double.Parse(txtIgv.Text),
                Fecha        = DateTime.Parse(txtFecha.Text),
                FormaPagoId  = int.Parse(ddlFormaPago.SelectedValue),
                ProveedorId  = int.Parse(ddlProveedor.SelectedValue),
                ContactoId   = int.Parse(ddlContacto.SelectedValue),
                PlazoEntrega = int.Parse(txtPlazoEntrega.Text),
                LugarEntrega = txtLugarEntrega.Text
            };
            var facturaOld = Facturas.FirstOrDefault(x => x.FacturaId == factura.FacturaId);

            if (facturaOld == null)
            {
                Facturas.Add(factura);
            }
            else
            {
                var index = Facturas.IndexOf(facturaOld);
                Facturas[index] = factura;
            }
        }