Esempio n. 1
0
        public ChatResult <List <MessageInfo> > SearchMessage(string receiverId, DateTime fromdate, DateTime toDate)
        {
            List <MessageInfo> messageList = Manager.Instance.SearchMessage(Context.ConnectionId, receiverId, fromdate, toDate);

            if (messageList == null || messageList != null && messageList.Count <= 0)
            {
                return(ChatResult <List <MessageInfo> > .CreateInstance(false, "Message not found", null));
            }
            return(new ChatResult <List <MessageInfo> >(true, null, messageList));
        }
Esempio n. 2
0
        public ChatResult <List <GroupInfo> > SearchGroup(string groupName)
        {
            List <GroupInfo> groupList = Manager.Instance.SearchGroupByGroupName(Context.ConnectionId, groupName);

            if (groupList == null)
            {
                return(ChatResult <List <GroupInfo> > .CreateInstance(false, "Group not found", null));
            }
            return(ChatResult <List <GroupInfo> > .CreateInstance(true, null, groupList));
        }
Esempio n. 3
0
        public ChatResult <List <CustomerInfo> > SearchCustomer(string customerNameKeyword)
        {
            List <CustomerInfo> customerList = Manager.Instance.SearchCustomerByCustomerName(Context.ConnectionId, customerNameKeyword);

            if (customerList == null)
            {
                return(ChatResult <List <CustomerInfo> > .CreateInstance(false, "Customer not found", null));
            }
            return(ChatResult <List <CustomerInfo> > .CreateInstance(true, null, customerList));
        }
Esempio n. 4
0
        public ChatResult <List <GroupInfo> > SearchGroup(string groupName)
        {
            System.Threading.Thread.Sleep(3000);
            List <GroupInfo> groupList = Manager.Instance.SearchGroupByGroupName(Context.ConnectionId, groupName);

            if (groupList == null || groupList != null && groupList.Count == 0)
            {
                return(ChatResult <List <GroupInfo> > .CreateInstance(false, "Group not found", null));
            }
            return(ChatResult <List <GroupInfo> > .CreateInstance(true, null, groupList));
        }
Esempio n. 5
0
        public async Task <ChatResult <List <GroupInfo> > > SearchGroup(string groupName)
        {
            try
            {
                ChatResult <List <GroupInfo> > result = await HubProxy.Invoke <ChatResult <List <GroupInfo> > >(ServerEventNames.SearchGroup, groupName);

                return(result);
            }
            catch (Exception ex)
            {
                return(ChatResult <List <GroupInfo> > .CreateInstance(false, ex.Message, null));
            }
        }
Esempio n. 6
0
        public async Task <ChatResult <List <CustomerInfo> > > SearchCustomer(string customerNameKeyword)
        {
            try
            {
                ChatResult <List <CustomerInfo> > result = await HubProxy.Invoke <ChatResult <List <CustomerInfo> > >(ServerEventNames.SearchCustomer, customerNameKeyword);

                return(result);
            }
            catch (Exception ex)
            {
                return(ChatResult <List <CustomerInfo> > .CreateInstance(false, ex.Message, null));
            }
        }