public ActionResult LoadProjectMessageForJob(int _prmSendUserId, int _prmJobID) { var userId = Convert.ToInt32(Session["UserId"]); int messageJobId = _prmJobID; MatchBXMessageModel _objModel = new MatchBXMessageModel(); List <MatchBXMessage> _list = new List <MatchBXMessage>(); _list = _objModel.GetChatMessage(userId, _prmSendUserId, _prmJobID); if (_list.Where(m => m.ReadStatus == 0).ToList().Count > 0 && _prmSendUserId != userId) { var _objMsg = new MatchBXMessage(); _objMsg.ReceiverId = _prmSendUserId; _objMsg.SendUserId = userId; _objMsg.ReadStatus = 1; _objMsg.JobId = _prmJobID; _objModel.ChangeReadStatus(_objMsg); } Session["messageJobId"] = _prmJobID; return(Json(_list, JsonRequestBehavior.AllowGet)); }
public ActionResult LoadAllChat(int prmReceiverId, int prmSendUserId) { var userId = Convert.ToInt32(Session["UserId"]); //int messageJobId = Convert.ToInt32(Session["messageJobId"]); int messageJobId = 0; MatchBXMessageModel _objModel = new MatchBXMessageModel(); List <MatchBXMessage> _list = new List <MatchBXMessage>(); _list = _objModel.GetChatMessage(prmReceiverId, prmSendUserId, messageJobId); if (_list.Where(m => m.ReadStatus == 0).ToList().Count > 0 && prmSendUserId != userId) { var _obj = new MatchBXMessage(); _obj.ReceiverId = prmReceiverId; _obj.SendUserId = prmSendUserId; _obj.ReadStatus = 1; _obj.JobId = 0; _objModel.ChangeReadStatus(_obj); } Session["messageJobId"] = 0; return(Json(_list, JsonRequestBehavior.AllowGet)); }