Exemplo n.º 1
0
        internal static List <WehkampMessage> GetMessagesByStatusAndType(WehkampMessageStatus status, WehkampMessageType type)
        {
            var sql = string.Format("SELECT MessageID, MessageType, Filename, Path, Status, Received, Sent, LastModified, Attempts, VendorID FROM WehkampMessage WHERE Status = {0} AND MessageType = {1}", (int)status, (int)type);

            using (var db = new Database(Environments.Current.Connection, "System.Data.SqlClient"))
            {
                var results = db.Fetch <WehkampMessage>(sql);
                return(results);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Updates the status of a single message
        /// </summary>
        /// <param name="messageID">Message primary key</param>
        /// <param name="status">new status</param>
        internal static void UpdateMessageStatus(decimal messageID, WehkampMessageStatus status, PetaPoco.Database db = null)
        {
            var sql = string.Format("UPDATE WehkampMessage SET Status={1}, LastModified='{2}' WHERE MessageID = {0}", messageID, (int)status, DateTime.Now.ToUniversalTime().ToString(ISO8601, CultureInfo.InvariantCulture));

            ExecuteSQL(sql, db);
        }