public ActionResult LeaveAMessage(string type, string msg, string userAgent) { int status = 0; string info = string.Empty; try { if (!string.IsNullOrEmpty(type) && !string.IsNullOrEmpty(msg)) { LeaveAMessage lmsg = new PhysicalLayer.LeaveAMessage(); lmsg.Id = GetStr.GetGuid; lmsg.Name = type; lmsg.Content = msg; lmsg.UserAgent = userAgent; lmsg.Create_Time = GetStr.GetCurrentDate; bllmsg.Add(lmsg); info = "成功反馈,请耐心等待回复,感谢支付与理解"; status = 1; } else { info = "类型和内容不可为空"; } } catch (Exception ex) { info = "添加发生异常,请重试,或者qq联系:434951775"; log.AddLog(ex, string.Format("留言发生异常:传入参数是【type:{0},msg:{1},userAgent:{2}】", type, msg, userAgent)); } return(this.Json(new { status = status, info = info }, JsonRequestBehavior.AllowGet)); }
private HttpResponseMessage LeaveAMessage([FromBody] string type, string msg, string userAgent) { S_LogBLL log = new S_LogBLL(); LeaveAMessageBLL bllmsg = new LeaveAMessageBLL(); int status = 0; string info = string.Empty; try { if (!string.IsNullOrEmpty(type) && !string.IsNullOrEmpty(msg)) { LeaveAMessage lmsg = new PhysicalLayer.LeaveAMessage(); lmsg.Id = GetStr.GetGuid; lmsg.Name = type; lmsg.Content = msg; lmsg.UserAgent = userAgent; lmsg.Create_Time = GetStr.GetCurrentDate; bllmsg.Add(lmsg); info = "成功反馈,请耐心等待回复,感谢支付与理解"; status = 1; } else { info = "类型和内容不可为空"; } } catch (Exception ex) { info = "添加发生异常,请重试,或者qq联系:434951775"; log.AddLog(ex, string.Format("留言发生异常:传入参数是【type:{0},msg:{1},userAgent:{2}】", type, msg, userAgent)); } return(JsonConvert.SerializeObject(new { status = status, info = info }).ToHttpResponseMessage()); }
public string LeaveAMessage(string type, string msg, string userAgent) { string info = string.Empty; if (!string.IsNullOrEmpty(type) && !string.IsNullOrEmpty(msg)) { LeaveAMessage lmsg = new PhysicalLayer.LeaveAMessage(); lmsg.Id = GetStr.GetGuid; lmsg.Name = type; lmsg.Content = msg; lmsg.UserAgent = userAgent; lmsg.Create_Time = GetStr.GetCurrentDate; info = HttpHelp.Post <string, LeaveAMessage>(ActionEnum.LeaveAMessage, lmsg); } else { info = "类型和内容不可为空"; } return(info); }