예제 #1
0
        private void notificacionCorreo()
        {
            BLcccmex.BLEvento objbl   = new BLcccmex.BLEvento();
            Boolean           res     = false;
            CultureInfo       culture = new CultureInfo("en-US");
            int    resEnvio           = 0;
            string fechaHoy           = DateTime.Now.ToString("d", culture);

            try
            {
                List <capascccmex.metadatos.instalaciones> oCamposCat = new List <capascccmex.metadatos.instalaciones>();
                capascccmex.biz.instalaciones obj = new capascccmex.biz.instalaciones();
                oCamposCat = obj.GetInstalaciones();
                foreach (var item in oCamposCat)
                {
                    res = objbl.getEnvioNotificacion(fechaHoy, item.IdInst);
                    if (!res)
                    {
                        BLcccmex.BLEventoObjeto objEventoBL = new BLcccmex.BLEventoObjeto();
                        resEnvio = objEventoBL.EnviarCorreoEvento(item.IdInst, item.Nombre);
                        if (resEnvio >= 0)
                        {
                            objbl.AddEnvioNotificacion(fechaHoy, item.IdInst);
                        }
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
        protected void btnEnviar_Click(object sender, EventArgs e)
        {
            int idevento = Convert.ToInt16(Session["idevento"].ToString());

            BLcccmex.BLEventoObjeto objbl = new BLcccmex.BLEventoObjeto();
            int r = objbl.EnviarCorreoEvento(idevento, "");

            if (r == 0)
            {
                windowManager1.RadAlert("El Correo fue Enviado con Exito", 300, 100, "Envio de Correo", null);
            }
            else
            {
                windowManager1.RadAlert("Correo no Enviado", 300, 100, "Envio de Correo", null);
            }
        }