Ejemplo n.º 1
0
        public void AddMessageToArchive(string jid, string guid, string messageText, string messageHTML, bool outgoing)
        {
            StorageItemInstantMessage item = new StorageItemInstantMessage();

            item.ContentHTML = messageHTML;
            item.ContentText = messageText;
            item.Direction   = outgoing ? StorageItemDirection.Out : StorageItemDirection.In;
            item.GUID        = guid;
            item.JID         = jid;
            this.Add(Storage.StorageType.InstantMessages, item);
        }
Ejemplo n.º 2
0
        public bool Add(StorageType storageType, object storageData)
        {
            if (this.mDatabaseConnection.State != System.Data.ConnectionState.Open)
            {
                this.mDatabaseConnection.Open();
            }
            try
            {
                switch (storageType)
                {
                case StorageType.FileSystem:
                    break;

                case StorageType.InstantMessages:

                    StorageItemInstantMessage item = (StorageItemInstantMessage)storageData;
                    FbCommand fbcmd = new FbCommand("MESSAGE_ADD", this.mDatabaseConnection);
                    fbcmd.CommandType = CommandType.StoredProcedure;
                    fbcmd.Parameters.Add("@iUSER_ID", mUserID.ToString());
                    fbcmd.Parameters.Add("@iGUID", item.GUID);
                    fbcmd.Parameters.Add("@iJID", item.JID);
                    fbcmd.Parameters.Add("@iCONTENT_TEXT", item.ContentText);
                    fbcmd.Parameters.Add("@iCONTENT_HTML", item.ContentHTML);
                    switch (item.Direction)
                    {
                    case StorageItemDirection.In:
                        fbcmd.Parameters.Add("@iDIRECTION", "IN");
                        break;

                    case StorageItemDirection.Out:
                        fbcmd.Parameters.Add("@iDIRECTION", "OUT");
                        break;

                    case StorageItemDirection.NA:
                        fbcmd.Parameters.Add("@iDIRECTION", "NA");
                        break;
                    }

                    fbcmd.ExecuteNonQuery();
                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Storage - Add : " + ex.Message);
                return(false);
            }
            return(true);
        }
Ejemplo n.º 3
0
 public void AddMessageToArchive(string jid, string guid, string messageText, string messageHTML, bool outgoing)
 {
     StorageItemInstantMessage item = new StorageItemInstantMessage();
     item.ContentHTML = messageHTML;
     item.ContentText = messageText;
     item.Direction = outgoing ? StorageItemDirection.Out : StorageItemDirection.In;
     item.GUID = guid;
     item.JID = jid;
     this.Add(Storage.StorageType.InstantMessages, item);
 }