public List <MatchBXMessage> GetProjectMessages(int ReceiverId) { MatchBXMessage _object = new MatchBXMessage(); _object.ReceiverId = ReceiverId; _object.JobId = 0; return(base.GetCustomFunction <MatchBXMessage>("spGetAllProjectMessage", _object)); }
public List <MatchBXMessage> GetChatMessage(int ReceiverId, int SendUserId, int messageJobId) { MatchBXMessage _object = new MatchBXMessage(); _object.ReceiverId = ReceiverId; _object.SendUserId = SendUserId; _object.JobId = messageJobId; return(base.GetCustomFunction <MatchBXMessage>("spGetChatMessage", _object)); }
public ActionResult ChatForSendMessage(int _prmSendUserId, string from, string _prmJobSeeker, string _prmBidUserProfilePic, int _prmJobID, string _prmJobTitle, int _prmReceiverId = 0) { // ViewBag.From = from; MatchBXMessage _obj = new MatchBXMessage(); _obj.SendUserId = _prmSendUserId; _obj.JobSeeker = _prmJobSeeker; _obj.BidUserProfilePic = _prmBidUserProfilePic; _obj.ReceiverId = _prmReceiverId != 0 ? _prmReceiverId : Convert.ToInt32(Session["UserId"]); _obj.JobId = _prmJobID; _obj.JobTitle = _prmJobTitle; Session["messageJobId"] = _prmJobID; return(PartialView("~/Views/Shared/Chat.cshtml", _obj)); }
public ActionResult ChatFromMail(int _prmSendUserId) { // ViewBag.From = from; UserProfileModel _objUserModel = new UserProfileModel(); UserProfile _profile = _objUserModel.LoadUserProfile(_prmSendUserId).FirstOrDefault(); MatchBXMessage _obj = new MatchBXMessage(); _obj.SendUserId = _prmSendUserId; _obj.BidUserProfilePic = _profile.ProfilePic; _obj.JobSeeker = _profile.FullName; _obj.ReceiverId = Convert.ToInt32(Session["UserId"]); Session["mailMessagId"] = 0; return(PartialView("~/Views/Shared/Chat.cshtml", _obj)); }
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)); }
public ActionResult BidJob(decimal bidamount, int bidDuration, string bidmessage, int jobid, int bidid, int jobposterid, string jobtitle, int _TokenDistributionId, string _AccountInfo) { Users _objuser = new Users(); objBidding.UserId = Convert.ToInt32(Session["UserId"]); objBidding.BidAmount = bidamount; objBidding.BidDuration = bidDuration; objBidding.BidMessage = bidmessage; objBidding.JobId = jobid; objBidding.JobBiddingId = bidid; objBidding.IsAccepted = "N"; objBidding.IsActive = "Y"; string BidUserName = "******" + Session["UserName"].ToString(); decimal bidAmount = bidamount; string message = ""; if (objBiddingMod.Save(objBidding) > 0) { if (bidmessage != string.Empty) { MatchBXMessage _objMessage = new MatchBXMessage(); MatchBXMessageModel _objMessageModel = new MatchBXMessageModel(); _objMessage.SendUserId = Convert.ToInt32(Session["UserId"]); _objMessage.Message = bidmessage; _objMessage.ReceiverId = jobposterid; _objMessage.ReadStatus = 0; _objMessage.MessageType = "J"; _objMessage.FileSize = 0; _objMessage.FileName = ""; _objMessage.JobId = jobid; _objMessageModel.Save(_objMessage); } if (MatchBxCommon.checkuseremailpreferences("4,5", Convert.ToInt32(Session["UserId"])) == true) { _objuser = objUsersMod.GetList("*", " UserId = '" + jobposterid + "'").FirstOrDefault(); string email = _objuser.Email; string fullname = _objuser.FullName != null ? _objuser.FullName : _objuser.UserName; //string fullname = objUsersMod.FullName != null ? objUser.FullName : objUser.UserName; MatchBxCommon.sendBidOfferEmail(email, false, BidUserName, jobtitle, bidAmount, fullname); } objJob = objJobMod.GetList("*", " JobId = '" + jobid + "'").FirstOrDefault(); objJob.JobStatus = "B"; if (objJobMod.Save(objJob) > 0) { TokenDistributionModel _TokenDistributionModel = new TokenDistributionModel(); TokenDistribution _TokenDistribution = new TokenDistribution(); if (_TokenDistributionId > 0) { _TokenDistribution = _TokenDistributionModel.GetList("*", " TokenDistributionId = '" + _TokenDistributionId + "'").FirstOrDefault(); _TokenDistribution.TokenAddress = _AccountInfo; } else { _TokenDistribution.TokenDistributionId = 0; _TokenDistribution.JobBiddingId = objBiddingMod.Id; _TokenDistribution.TokenAddress = _AccountInfo; _TokenDistribution.UserId = Convert.ToInt32(Session["UserId"]); _TokenDistribution.IsApproved = "N"; } if (_TokenDistributionModel.Save(_TokenDistribution) > 0) { message = "Success"; } else { message = "Failed"; } } else { message = "Failed"; } } else { message = "Failed"; } return(Json(message, JsonRequestBehavior.AllowGet)); }
public List <MatchBXMessage> ChangeReadStatus(MatchBXMessage _object) { return(base.GetCustomFunction <MatchBXMessage>("spMessageReadStatus", _object)); }
public int Save(MatchBXMessage _object) { int _returnValue = base.Save <MatchBXMessage>("spAddEditMatchBXMessage", _object); return(_returnValue); }