コード例 #1
0
        protected void FormatKeysSt_Refresh(object sender, StoreRefreshDataEventArgs e)
        {
            try
            {
                string formatKey = this.EditLlaveTxt.Text;
                PlantillaLogic plantillalogic = new PlantillaLogic();

                this.FormatKeysSt.DataSource = plantillalogic.GetFormatKeys(formatKey);
                this.FormatKeysSt.DataBind();
            }
            catch (Exception ex)
            {
                log.Fatal("Error fatal al cargar llaves de formato para plantilla de notificacion.", ex);
                throw;
            }
        }
コード例 #2
0
ファイル: SolicitudesLogic.cs プロジェクト: xapiz/COCASJOL
        /// <summary>
        /// Aprueba solicitud de prestamo.
        /// </summary>
        /// <param name="ID_SOLICITUD"></param>
        public void AprobarSolicitud(int ID_SOLICITUD)
        {
            try
            {
                using (var db = new colinasEntities())
                {
                    var query = from soc in db.solicitudes_prestamos
                                where soc.SOLICITUDES_ID == ID_SOLICITUD
                                select soc;

                    solicitud_prestamo solicitud = query.First();
                    solicitud.SOLICITUD_ESTADO = "APROBADA";
                    db.SaveChanges();

                    string[] solicitudid = { solicitud.SOLICITUDES_ID.ToString() };

                    string PLANTILLAS_LLAVE = "PRESTAMOAPROBADO";
                    string PRIVS_LLAVE = "MANT_" + PLANTILLAS_LLAVE;

                    PlantillaLogic plantillalogic = new PlantillaLogic();
                    plantilla_notificacion pl = plantillalogic.GetPlantilla(PLANTILLAS_LLAVE);

                    NotificacionLogic notificacionlogic = new NotificacionLogic();
                    notificacionlogic.NotifyUsers(PRIVS_LLAVE, EstadosNotificacion.Creado, pl.PLANTILLAS_ASUNTO, pl.PLANTILLAS_MENSAJE, solicitudid);
                }
            }
            catch (Exception ex)
            {
                log.Fatal("Error fatal al aprobar solicitud de prestamo.", ex);
                throw;
            }
        }
コード例 #3
0
ファイル: NotaDePesoLogic.cs プロジェクト: xapiz/COCASJOL
        /// <summary>
        /// Notifica usuarios sobre cambio de estado de nota de peso.
        /// </summary>
        /// <param name="PLANTILLAS_LLAVE"></param>
        /// <param name="PRIVS_LLAVE"></param>
        /// <param name="note"></param>
        /// <param name="db"></param>
        private void NotificarUsuarios(string PLANTILLAS_LLAVE, string PRIVS_LLAVE, nota_de_peso note, colinasEntities db)
        {
            try
            {
                string[] notaid = { note.NOTAS_ID.ToString() };

                PlantillaLogic plantillalogic = new PlantillaLogic();
                plantilla_notificacion pl = plantillalogic.GetPlantilla(PLANTILLAS_LLAVE);

                NotificacionLogic notificacionlogic = new NotificacionLogic();
                notificacionlogic.NotifyUsers(PRIVS_LLAVE, EstadosNotificacion.Creado, pl.PLANTILLAS_ASUNTO, pl.PLANTILLAS_MENSAJE, notaid);

                db.SaveChanges();
            }
            catch (Exception ex)
            {
                log.Fatal("Error fatal al notificar usuarios.", ex);
                throw;
            }
        }