Beispiel #1
0
        public static List <Message> GetRequestOutbox(Guid userId, int?pageNum, int?pageSize, out int numberItems, SiteContext siteContext)
        {
            List <Message>        listMsg        = new List <Message>();
            int?                  NumberMessages = null;
            CSBooster_DataContext wdc            = new CSBooster_DataContext(ConfigurationManager.ConnectionStrings["CSBoosterConnectionString"].ConnectionString);
            var                   results        = wdc.hisp_UserMessages_GetRequestUserOutbox(userId, pageNum ?? 1, pageSize ?? 10, ref NumberMessages);

            foreach (MessageResult result in results)
            {
                Message newMessage = new Message(siteContext);
                Message.FillMessage(newMessage, result);
                listMsg.Add(newMessage);
            }
            numberItems = NumberMessages ?? 0;
            return(listMsg);
        }
Beispiel #2
0
        public static List <Message> GetAlerts(Guid userId, DateTime?dateSentFrom, DateTime?dateSentTo, bool?flagged, bool?isRead, string generalSearchParam, string fromUserName, string subject, string message, int?pageNum, int?pageSize, string sortAttr, string sortDir, out int numberMessages, SiteContext siteContext)
        {
            List <Message>        listMsg        = new List <Message>();
            int?                  NumberMessages = null;
            CSBooster_DataContext wdc            = new CSBooster_DataContext(ConfigurationManager.ConnectionStrings["CSBoosterConnectionString"].ConnectionString);
            var                   results        = wdc.hisp_UserMessages_GetAlerts(userId, dateSentFrom, dateSentTo, flagged, isRead, "%" + fromUserName + "%", "%" + subject + "%", "%" + message + "%", "%" + generalSearchParam + "%", pageNum ?? 1, pageSize ?? 10, sortAttr, sortDir, ref NumberMessages);

            foreach (MessageResult result in results)
            {
                Message newMessage = new Message(siteContext);
                Message.FillMessage(newMessage, result);
                listMsg.Add(newMessage);
            }
            numberMessages = NumberMessages ?? 0;
            return(listMsg);
        }
Beispiel #3
0
        public static List <Message> GetOutbox(Guid userId, int?groupID, DateTime?dateSentFrom, DateTime?dateSentTo, bool?flagged, bool?isRead, string generalSearchParam, string toUserName, string subject, string message, int?pageNum, int?pageSize, string sortAttr, string sortDir, out int numberMessages, SiteContext siteContext)
        {
            List <Message> listMsg = new List <Message>();

            int?NumberMessages        = null;
            CSBooster_DataContext wdc = new CSBooster_DataContext(Helper.GetSiemeConnectionString());
            var results = wdc.hisp_UserMessages_GetMessagesUserOutbox(userId, groupID, dateSentFrom, dateSentTo, flagged, isRead, "%" + toUserName + "%", "%" + subject + "%", "%" + message + "%", "%" + generalSearchParam + "%", pageNum ?? 1, pageSize ?? 10, sortAttr, sortDir, ref NumberMessages);

            foreach (MessageResult result in results)
            {
                Message newMessage = new Message(siteContext);
                Message.FillMessage(newMessage, result);
                listMsg.Add(newMessage);
            }

            numberMessages = NumberMessages.Value;

            return(listMsg);
        }