();
// string Usuario = DdlUsuario.SelectedValue.ToEntero() > 0 ? DdlUsuario.SelectedItem.Text : "Todos";
// RepParams.Add(new ReportParameter("Fecha", DateTime.Today.ToString()));
// RepParams.Add(new ReportParameter("AsignadoA", Usuario));
// RepParams.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Nombre));
// ImprimirPDF($"Empresas/{UsuarioActual.CveEmpresa}/Formatos/EntregasPorRealizar.rdlc", DtPaqueteriasGuias, RepParams, "Entregas por realizar", "PDF",RDSName:"DsInventarios");
//}
private string DocumentoEntregaInterna(GridViewRow row)
{
string ClienteNombre = row.DataKey("NombreComercial");
string FolioVenta = row.DataKey("SerieFolio");
string Pedido = row.DataKey("PedidoContrato");
string OrdenCompra = row.DataKey("OrdenCompra");
int CveVenta = row.DataKey("CveVenta").ToEntero();
string TipoDocto = row.DataKey("TipoDocto");
DataTable DtDetalle = new DataTable();
ClsVentas ObjVentas = new ClsVentas();
if (ObjVentas.GetVentaDetalle(CveVenta))
{
DtDetalle = ObjVentas.DtResultados;
}
ObjVentas.Dispose();
string DetalleTable = "";
foreach (DataRow dRow in DtDetalle.Rows)
{
string detalle = string.Format("| {0} | {1} | {2} |
", dRow["Codigo"], dRow["Cantidad"], dRow["PS"]);
DetalleTable += detalle;
}
StringBuilder strBody = new StringBuilder();
strBody.Append("");
strBody.Append("");
strBody.Append("");
strBody.Append("");
strBody.Append(" ");
strBody.Append("");
strBody.Append($"

");
strBody.Append("
");
strBody.Append(" ");
strBody.Append($" Apreciable {ClienteNombre}, su pedido ya se encuentra en camino. Le confirmamos los productos que recibirá conforme a la ");
strBody.Append($" {TipoDocto}:");
strBody.Append("
");
strBody.Append($" {FolioVenta} - Pedido {Pedido} - Orden de Compra {OrdenCompra}
");
strBody.Append(" ");
strBody.Append("
");
strBody.Append(DetalleTable);
strBody.Append("
");
strBody.Append("
");
strBody.Append(" ");
strBody.Append(" Solicitamos su apoyo en la verificación del pedido que está próximo a recibir y en caso de presentarse alguno de los siguientes inconvenientes favor de rechazar el paquete y comunicarse de inmediato con su Ejecutivo Comercial:");
strBody.Append("
");
strBody.Append(" ");
strBody.Append(" • Empaque violado.
");
strBody.Append("• Daño físico en la caja.
");
strBody.Append("• Producto incompleto o distinto al solicitado.
");
strBody.Append("• Alguna otra situación que se considere que compromete la integridad de la mercancía.");
strBody.Append("");
strBody.Append("
");
strBody.Append("
");
strBody.Append(" ");
strBody.Append(" Gracias por realizar su pedido
");
//strBody.Append(" Compuproveedores");
strBody.Append("
");
strBody.Append(" ");
strBody.Append(" Sigue disfrutando de nuestros productos y servicios
");
//strBody.Append(" www.compuproveedores.com");
strBody.Append("");
strBody.Append("
");
strBody.Append(" ");
strBody.Append("");
//List RepParams = new List();
//RepParams.Add(new ReportParameter("Cliente", ClienteNombre));
//RepParams.Add(new ReportParameter("FolioVenta", FolioVenta));
//RepParams.Add(new ReportParameter("Pedido", Pedido));
//RepParams.Add(new ReportParameter("OrdenCompra", OrdenCompra));
//return StreamPDF($"Empresas/{UsuarioActual.CveEmpresa}/Formatos/GuiaInternaAsignada.rdlc", DtDetalle, RepParams, "Notificacion de Envio", "PDF", RDSName: "DsInventarios");
return strBody.ToString();
}
private void MandarNotificacionCorreo(GridViewRow row)
{
string CorreoEntregaAlmacen = row.DataKey("CorreoEntregaAlmacen");
string CorreoEntregaCompras = row.DataKey("CorreoEntregaCompras");
string CorreoVendedor = row.DataKey("Correo");
string CorreoNotificacion = row.DataKey("CorreoNotificacion");
int CveVendedor = row.DataKey("CveVendedor").ToEntero();
string CorreoAsistente = get_GlobalDTVendedores(UsuarioActual.CveEmpresa,VendedorTipo:3).FiltroPrimeroValor("Correo",string.Format("CveSuperior = {0}", CveVendedor));
string Para = string.Format("{0};{1};{2};{3};{4}", CorreoVendedor, CorreoNotificacion, CorreoEntregaCompras,CorreoEntregaAlmacen,CorreoAsistente);
string LogCorreo = string.Format("{0} -- {1} --- {2}", "Tipo de entrega", CorreoEntregaAlmacen, Para);
LogCorreo.GuardaLog();
//byte[] ArchivoBinario = DocumentoEntregaInterna(row);
string body = DocumentoEntregaInterna(row);
ClsSisMail MailCls = new ClsSisMail();
//List LSRutasMail = new List();
//ClsSisMail.ArchivoMail itemMail = new ClsSisMail.ArchivoMail();
//{
// var withBlock = itemMail;
// itemMail.ArchivoBinario = ArchivoBinario;
// itemMail.NombreArchivo = "Notificacion de Envio";
//}
//LSRutasMail.Add(itemMail);
MailCls.SendMail(ClsPaginas.EmpresaNotificaciones, Para, "Entrega en camino", body, Para);
MailCls = null;
}
}