示例#1
0
 public string[] getNextMessage()
 {
     try
     {
         clsUsuario_Mensaje Mensaje   = new clsUsuario_Mensaje();
         DataTable          dtMensaje = Mensaje.getNextMessage(HttpContext.Current.User.Identity.Name);
         string[]           strResult = new string[3];
         if (dtMensaje.Rows.Count == 1)
         {
             clsUsuario Usuario = new clsUsuario(System.Convert.ToUInt32(dtMensaje.Rows[0]["Id_Usuario_From"]));
             strResult[0] = Usuario.Nombre + " " + Usuario.Apellidos;
             Usuario      = null;
             strResult[1] = clsUtiles.getPresentationDateTime(System.Convert.ToDateTime(dtMensaje.Rows[0]["FechaHora"]));
             strResult[2] = System.Convert.ToString(dtMensaje.Rows[0]["Mensaje"]);
             Mensaje.Delete(System.Convert.ToUInt32(dtMensaje.Rows[0]["Id"]));
         }
         else
         {
             strResult[0] = string.Empty;
         }
         Mensaje = null;
         return(strResult);
     }
     catch (System.Exception Ex)
     {
         throw new System.Exception("Imposible recuperar el siguiente mensaje.", Ex);
     }
 }
示例#2
0
 public System.UInt16 getCantMensajesSinLeer()
 {
     try
     {
         clsUsuario_Mensaje Mensaje     = new clsUsuario_Mensaje();
         System.UInt16      intMensajes = Mensaje.getMensajesNoLeidos(HttpContext.Current.User.Identity.Name);
         Mensaje = null;
         return(intMensajes);
     }
     catch (System.Exception Ex)
     {
         throw new System.Exception("Imposible recuperar la cantidad de mensajes sin leer.", Ex);
     }
 }
示例#3
0
        public bool SendMessage(string strMessageData)
        {
            try
            {
                string[]           aryMessageData = strMessageData.Split('|');
                clsUsuario         UsuarioFrom    = new clsUsuario(HttpContext.Current.User.Identity.Name);
                clsUsuario         UsuarioTo      = new clsUsuario(aryMessageData[0]);
                clsUsuario_Mensaje Mensaje        = new clsUsuario_Mensaje();
                System.Boolean     boResult       = System.Convert.ToBoolean(Mensaje.Agregar(System.Convert.ToUInt32(UsuarioFrom.Id), System.Convert.ToUInt32(UsuarioTo.Id), System.DateTime.Now, aryMessageData[1]));
                UsuarioFrom = null;
                UsuarioTo   = null;
                Mensaje     = null;
                System.Diagnostics.Debug.WriteLine("Original: " + aryMessageData[1]);
                System.Diagnostics.Debug.WriteLine("HtmlDecode: " + HttpContext.Current.Server.HtmlDecode(aryMessageData[1]));
                System.Diagnostics.Debug.WriteLine("HtmlEncode: " + HttpContext.Current.Server.HtmlEncode(aryMessageData[1]));
                return(boResult);
            }

            catch (System.Exception Ex)
            {
                throw new System.Exception("Error al enviar mensaje.", Ex);
            }
        }