Files
SIG/Sistemas/NotificacionesEnLinea.aspx.cs
JORGE LUIS CAUDILLO ESPARZA c35cf91883 Commit inicial Ventas Productivo
2019-08-14 16:40:54 -07:00

98 lines
2.2 KiB
C#

using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Extensiones;
public partial class Sistemas_NotificacionesEnLinea : System.Web.UI.Page
{
#region "PROPIEDADES"
private int CveEmpresa
{
get
{
return Convert.ToInt32(ViewState["CveEmpresa"].ToString());
}
set
{
ViewState["CveEmpresa"] = value;
}
}
private int CveTipoNotificacion
{
get
{
return Convert.ToInt32(ViewState["CveTipoNotificacion"].ToString());
}
set
{
ViewState["CveTipoNotificacion"] = value;
}
}
private DataTable DTNotificaciones
{
get
{
return (DataTable)ViewState["DTNotificaciones"];
}
set
{
ViewState["DTNotificaciones"] = value;
}
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
InicializaParametros();
CargaDTNotificaciones();
EnviaNotificaciones();
}
#region "INICIALIZA PARAMETROS"
protected void InicializaParametros()
{
CveTipoNotificacion = 1;
CveEmpresa = 72;
}
#endregion
#region "ENVIA NOTIFICACIONES"
protected void CargaDTNotificaciones()
{
ClsContratos ObjContrato = new ClsContratos();
if (ObjContrato.GetNotificacionesEnLinea(CveEmpresa, CveTipoNotificacion))
{
DTNotificaciones = ObjContrato.DtResultados;
}
ObjContrato.Dispose();
}
protected void EnviaNotificaciones()
{
ClsSisMail ObjMail = new ClsSisMail();
String Para = "";
String Asunto = "";
String Cuerpo = "";
foreach (DataRow notificacion in DTNotificaciones.Rows)
{
Para = notificacion["Correos"].ToString();
Asunto = notificacion["Asunto"].ToString();
Cuerpo = notificacion["Cuerpo"].ToString();
ObjMail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Cuerpo);
}
}
#endregion
}