protected void GeneraReporte(string opcion, int pos, bool nulo) { string ruta = ""; string nombredoc = ""; Reporte_General.CXC.cxcrepcobroadelantado01 Reporte = new Reporte_General.CXC.cxcrepcobroadelantado01(); if (nulo == false) { Reporte._Letrero_Copia = "COPIA"; } else { Reporte._Letrero_Copia = "<<NULO>> COPIA"; } Reporte._id = gridBase1.Rows[pos].Cells["dgvidcobro"].Value.ToString(); Reporte.Fun_Reporte(); if (opcion == "Imprimir") { Reporte.Show(); } else if (opcion == "Enviar") { nombredoc = gridBase1.Rows[pos].Cells["dgvsecuencia"].Value.ToString() + "-" + System.DateTime.Now.ToString("yyyyMMdd"); ruta = Funciones_Duke4.Funciones.Fun_Exportar_aPDF(@"C:\Reporte_Duke4\Reporte_CxC\Registros_Facturas\", nombredoc + ".pdf", Reporte.reportViewer1); mail.Attachments.Add(new Attachment(ruta)); } }
protected override void Imprimir() { base.Imprimir(); var Reporte = new Reporte_General.CXC.cxcrepcobroadelantado01(); Reporte._id = _secuencia; if (_nulo == false) { Reporte._Letrero_Copia = "COPIA"; } else { Reporte._Letrero_Copia = "<<NULO>> COPIA"; } Reporte.Show(); Reporte.Owner = this; }
protected override void Salvar() { base.Salvar(); Control[] array = { Txtcobro, Txtcodigocliente, Txtmonto, Txtconcepto, Cmbmoneda }; string id = ""; if (!Funciones.Fun_Validar_Campos_Vacios(array)) { Opcion_Pago.Proceso.genpropago pago = new Opcion_Pago.Proceso.genpropago(Txtmonto.Text, Txtcodigocliente.Text, 1); if (pago.ShowDialog() == DialogResult.OK) { string cmd = string.Format("exec Spr_cxc_cobro_adelantado '{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}'", _OpcionSQL, Properties.Settings.Default.idsesion, 1, Txtcobro.Text, Funciones.Fun_Convertir_Fecha_FormatoyyyMMdd(Dtpfecha), Txtreferencia.Text, Funciones.Fun_Convierte_String_aEntrero(Txtcodigocliente.Text), Funciones.Fun_Convierte_String_aDecimal(Txtmonto.Text), Cmbmoneda.SelectedValue, Txtconcepto.Text.Trim()); DataSet ds = FuncionesSQL.Fun_Sql_Ejecutar(cmd); if (_OpcionSQL == "Modificar") { id = ds.Tables[0].Rows[0][0].ToString(); } else { id = ds.Tables[1].Rows[0][0].ToString(); } string cmdpago = string.Format("exec Spr_gen_pago '{0}','{1}','{2}','{3}','{4}'", Properties.Settings.Default.idsesion, 1, id, Funciones.Fun_Convertir_Fecha_FormatoyyyMMdd(Dtpfecha), pago.cmd2); DataSet ds2 = FuncionesSQL.Fun_Sql_Ejecutar(cmdpago); if (Ckbimprimir.Checked == true) { var Reporte = new Reporte_General.CXC.cxcrepcobroadelantado01(); Reporte._montoescrito = Funciones.Fun_Numero_aLetras_ConDecimal(Txtmonto.Text); Reporte._id = id; Reporte.Show(); Reporte.Owner = this; } Funciones.Fun_Limpiar_Formulario(MainPanel); if (_OpcionSQL == "Insertar") { Crear(); } else { Modificar(); } Ckbimprimir.Checked = true; LblAlerta.Text = ""; } else { LblAlerta.Text = Mensajes.Stg_Campos_EnBlanco; } } else { LblAlerta.Text = Mensajes.Stg_Campos_EnBlanco; } }