Funcionalidad de mardar mails hecha
This commit is contained in:
@@ -16,9 +16,11 @@ namespace Vista.Informes
|
||||
public partial class FrmInformeFacturaPorFecha : Form
|
||||
{
|
||||
private ReadOnlyCollection<Factura>? facturas;
|
||||
private DateTime fecini, fecfin;
|
||||
public FrmInformeFacturaPorFecha()
|
||||
{
|
||||
InitializeComponent();
|
||||
if (ControladoraInformes.Instance.RecuperarConfig().Informar == false) btnEnviarEmail.Enabled = false;
|
||||
}
|
||||
|
||||
private void btnBuscar_Click(object sender, EventArgs e)
|
||||
@@ -28,6 +30,10 @@ namespace Vista.Informes
|
||||
MessageBox.Show("La fecha de inicio no puede ser mayor que la fecha final.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
//es por si mandas un email mantener el state de las fechas
|
||||
fecini = dateInicio.Value;
|
||||
fecfin = dateFin.Value;
|
||||
|
||||
facturas = ControladoraInformes.Instance.MostrarFacturasEnRangoDeFechas(dateInicio.Value, dateFin.Value);
|
||||
|
||||
@@ -79,5 +85,16 @@ namespace Vista.Informes
|
||||
column.Visible = column.Name == "Subtotal" || column.Name == "NombreProducto" || column.Name == "Cantidad";
|
||||
}
|
||||
}
|
||||
|
||||
private void btnEnviarEmail_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (facturas == null || facturas.Count <= 0)
|
||||
{
|
||||
MessageBox.Show("No hay facturas para mandar email");
|
||||
return;
|
||||
}
|
||||
string msg = ControladoraInformes.Instance.EnviarEmail($"Facturas del {fecini.ToString()} hasta {fecfin.ToString()}", facturas.ToList());
|
||||
MessageBox.Show(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user