public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; //获取客户端使用的http数据传输方式 string Method = context.Request.HttpMethod; if (Method == "post" || Method == "POST") { context.Response.Cache.SetNoStore(); //标题 string title = context.Request.Form["title"]; //消息内容 string content = context.Request.Form["content"]; //消息发送时间 string time = context.Request.Form["time"]; //群号 string send_qg = context.Request.Form["send_qg"]; //Q号 string send_qu = context.Request.Form["send_qu"]; string from_u = context.Request.Form["from_u"]; EyouSoft.Model.CommunityStructure.MQQGroupMessageInfo messageinfo = new EyouSoft.Model.CommunityStructure.MQQGroupMessageInfo(); messageinfo.Title = title; messageinfo.Content = content; messageinfo.QMTime = time; messageinfo.QGID = send_qg; messageinfo.QUID = send_qu; messageinfo.IssueTime = DateTime.Now; messageinfo.Status = EyouSoft.Model.CommunityStructure.QQGroupMessageStatus.未激活; messageinfo.FUID = from_u; try { //失败 or 成功 int result = new EyouSoft.BLL.CommunityStructure.ExchangeList().QG_InsertQQGroupMessage(messageinfo); if (result == 1) { context.Response.Write("{\"retcode\":" + 0 + ",\"sid\":\"" + messageinfo.MessageId + "\"}"); } else { context.Response.Write("{\"retcode\":-3,\"sid\":\"failure\"}"); } } catch { context.Response.Write("{\"retcode\":-2,\"sid\":\"failure\"}"); } } else { context.Response.Write("{\"retcode\":\"-1\",\"sid\":\"failure\"}"); } }
/// <summary> /// 设置QQ群消息状态 /// </summary> /// <param name="messageId">消息编号</param> /// <param name="status">状态</param> /// <returns></returns> public bool QG_SetQQGroupMessageStatus(string messageId, EyouSoft.Model.CommunityStructure.QQGroupMessageStatus status) { if (string.IsNullOrEmpty(messageId)) { return(true); } bool isToOffer = false; EyouSoft.Model.CommunityStructure.MQQGroupMessageInfo info = QG_GetQQGroupMessageInfo(messageId); if (info != null) { EyouSoft.Model.CommunityStructure.ExchangeList offer = new EyouSoft.Model.CommunityStructure.ExchangeList(); offer.AttatchPath = string.Empty; offer.CityId = 0; offer.CompanyId = string.Empty; offer.CompanyName = string.Empty; offer.ContactName = string.Empty; offer.ContactTel = string.Empty; offer.ExchangeTag = EyouSoft.Model.CommunityStructure.ExchangeTag.无; offer.ExchangeText = info.Content; offer.ExchangeTitle = info.Title; offer.ID = info.MessageId; offer.IssueTime = DateTime.Now; offer.OperatorId = string.Empty; offer.OperatorMQ = string.Empty; offer.OperatorName = string.Empty; offer.ProvinceId = 0; offer.ExchangeCategory = EyouSoft.Model.CommunityStructure.ExchangeCategory.QGroup; offer.TopicClassID = EyouSoft.Model.CommunityStructure.ExchangeType.其他; isToOffer = AddExchangeList(offer, null, false); } if (isToOffer) { return(dal.QG_SetQQGroupMessageStatus(messageId, status)); } return(false); }
/// <summary> /// 初始化供求信息 /// </summary> private void InitSelf() { activationid = EyouSoft.Common.Utils.GetQueryStringValue("activationid"); QGroupMessageInfo = EyouSoft.BLL.CommunityStructure.ExchangeList.CreateInstance().QG_GetQQGroupMessageInfo(activationid); if (QGroupMessageInfo == null) { Utils.ShowError("未找到您要查看的信息", "info"); return; } if (QGroupMessageInfo.Status == EyouSoft.Model.CommunityStructure.QQGroupMessageStatus.已激活) { Response.Redirect(Domain.UserPublicCenter + "/info_" + activationid); } if (Utils.GetInt(Utils.GetQueryStringValue("a")) == 1) { Activation(); } lastlist = EyouSoft.BLL.CommunityStructure.ExchangeList.CreateInstance().GetTopList(5, EyouSoft.Model.CommunityStructure.ExchangeType.团队询价, EyouSoft.Model.CommunityStructure.ExchangeTag.急急急, true); otherlist = EyouSoft.BLL.CommunityStructure.ExchangeList.CreateInstance().GetTopList(5, EyouSoft.Model.CommunityStructure.ExchangeType.团队询价, EyouSoft.Model.CommunityStructure.ExchangeTag.急急急, false); }
/// <summary> /// 写入QQ群消息,返回1成功,其它失败 /// </summary> /// <param name="info">QQ群消息业务实体</param> /// <returns>1:成功 其它失败</returns> public int QG_InsertQQGroupMessage(EyouSoft.Model.CommunityStructure.MQQGroupMessageInfo info) { info.MessageId = Guid.NewGuid().ToString(); return(dal.QG_InsertQQGroupMessage(info)); }