//sending message for a single reciver public bool sendMessage(string yourID, string reciverId, string messages) { try { messageBusiness = new MussageBusiness(); message = new Message(yourID, reciverId, messages); //message send successed if (messageBusiness.InsertMessages(message) == true) { return(true); } else { return(false); } } catch (Exception ex) { errMessages = ex.Message; return(false); } }
//get message from single user public List <Message> getMessage(MussageBusiness mes) { messageBusiness = new MussageBusiness(); return(messageBusiness.ReturnMessages(mes.yourID, mes.reciverID)); }
//get last message from a single user public Message getLastMessage(MussageBusiness mes) { messageBusiness = new MussageBusiness(); return(messageBusiness.ReturnLastMessages(mes.yourID, mes.reciverID)); }
//get all message (default) public List <Message> getMessage() { messageBusiness = new MussageBusiness(); return(messageBusiness.ReturnMessages()); }