private void SetInfoInControls() { try { txtID.Text = info.IdDocumento.ToString(); txtTipo.Text = info.Tipo; txtCodDocumento.Text = info.CodDocumento; txtEstablecimiento.Text = info.Establecimiento; txtPuntoEmision.Text = info.PuntoEmision; txtNumDocumento.Text = info.NumeroDocumento; txtClaveAcceso.Text = info.ClaveAcceso; txtIdentificacion.Text = info.emi_Ruc; txtRazonSocial.Text = info.emi_RazonSocial; txtNombreComercial.Text = info.emi_NombreComercial; txtDireccion.Text = info.emi_DireccionMatriz; txtSubtotal0.Text = info.Subtotal0.ToString(); txtSubtotalIVA.Text = info.SubtotalIVA.ToString(); txtPorcentaje.Text = info.Porcentaje.ToString(); txtIVA.Text = info.ValorIVA.ToString(); txtTotal.Text = info.Total.ToString(); deFecha.DateTime = Convert.ToDateTime(info.FechaEmision).Date; txtContribuyente.Text = info.emi_ContribuyenteEspecial; txtRetEstablecimiento.Text = info.ret_Establecimiento; txtRetPuntoEmision.Text = info.ret_PuntoEmision; txtRetNumeroDocumento.Text = info.ret_NumeroDocumento; txtRetAutorizacion.Text = info.ret_NumeroAutorizacion; deRetFechaAutorizacion.DateTime = info.ret_FechaAutorizacion ?? DateTime.Now.Date; deRetFecha.DateTime = info.ret_Fecha ?? DateTime.Now.Date; cmbFormaPago.EditValue = info.FormaPago; deRetFecha.DateTime = Convert.ToDateTime(info.FechaEmision).Date; blst = new BindingList <cp_XML_Documento_Retencion_Info>(bus_det.GetList(param.IdEmpresa, info.IdDocumento)); gcRetencion.DataSource = blst; if (!string.IsNullOrEmpty(info.ret_NumeroDocumento)) { btnEliminarRetencion.Visible = true; } else { btnEliminarRetencion.Visible = false; } gcDetalleXML.DataSource = bus_xml_det.GetList(param.IdEmpresa, info.IdDocumento); var MicroEmpresa = busMicroEmpresa.GetInfo(info.emi_Ruc); lblMicroEmpresa.Visible = MicroEmpresa == null ? false : true; } catch (Exception) { throw; } }
private void cmbImagen_Click(object sender, EventArgs e) { try { cp_XML_Documento_Info row = (cp_XML_Documento_Info)gvDetalle.GetFocusedRow(); if (row == null) { return; } if (row.Estado && !string.IsNullOrEmpty(row.ret_NumeroDocumento) && string.IsNullOrEmpty(row.ret_NumeroAutorizacion)) { var lst = busRet.GetList(row.IdEmpresa, row.IdDocumento); if (lst.Count > 0) { string MensajeError = ""; if (!bus_xml.Generacion_xml_SRI(row.IdEmpresa, row.IdDocumento, ref MensajeError)) { MessageBox.Show("No se ha podido generar el XML de la retención del documento " + row.Comprobante + " de " + row.RazonSocial, param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else { MessageBox.Show("Generación de XML de la retención del documento " + row.Comprobante + " de " + row.RazonSocial + " exitoso", param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } } else { MessageBox.Show("No se ha podido generar el XML de la retención del documento " + row.Comprobante + " de " + row.RazonSocial + " debido a que no tiene detalle", param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); MessageBox.Show("No se ha podido generar el XML de la retención del documento " + row.Comprobante + " de " + row.RazonSocial, param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } } catch (Exception) { throw; } }