public JsonResult SendMessage(long userId) { long userID = Convert.ToInt64(Session["UserId"]); //ChatDetailListModel model = new ChatDetailListModel() //{ // SenderUserId = userID, // RecieverUserId = userId, // UserMessage = text, // UserMessageTime = DateTime.Now.ToString("hh:mm tt"), // IsSender = true, // TimeStamp=timestamp //}; ChatRequestModel m = new ChatRequestModel() { FromUserId = userID, ToUserId = userId }; propertyService.AddChatRequest(m); //var status = await FirebaseHelper.AddChatMessage(model); wsBase wsBase = new wsBase(); wsBase.status = true; return(Json(wsBase, JsonRequestBehavior.AllowGet)); }
public IHttpActionResult AddChatRequest(ChatRequestModel model) { if (model == null) { return(this.Ok(new { status = false, message = Resource.fill_required_records, })); } var status = propertyService.AddChatRequest(model); return(this.Ok(new { status = status, message = propertyService.message, })); }
public JsonResult SendMessage(long userId) { if (userId != 0) { long userID = Convert.ToInt64(Session["UserId"]); ChatRequestModel m = new ChatRequestModel() { FromUserId = userID, ToUserId = userId }; propertyService.AddChatRequest(m); wsBase wsBase = new wsBase(); wsBase.status = true; return(Json(wsBase, JsonRequestBehavior.AllowGet)); } else { return(Json("Session Expired", JsonRequestBehavior.AllowGet)); } }