public void PostCreateMessage(string subject, string issue) { Employee _employee = Session["logonUser"] as Employee; int _code = 0; string _message = "操作失败"; if (!string.IsNullOrEmpty(subject)) { MyMessage _myMessage = new MyMessage(); _myMessage.UserName = _employee.Name; _myMessage.Subject = subject; _myMessage.Issue = issue; _code = _messageService.InsertMessage(_myMessage); _message = "您的问题已经成功提交,请等候回复..."; } else { _message = "对不起,标题不能为空!"; } RenderText("{\"code\":\"" + _code + "\",\"message\":\"" + _message + "\"}"); CancelLayout(); }
public void PostEdit(int messageID, string subject, string issue, string reply) { int _code = 0; string _message = "回复问题失败"; if (!string.IsNullOrEmpty(subject)) { MyMessage _myMessage = new MyMessage(); _myMessage.ID = messageID; _myMessage.Subject = subject; _myMessage.Issue = issue; _myMessage.Reply = reply; _code = _messageService.UpdateMessage(_myMessage); if (_code > 0) { _message = "回复问题成功"; } else { _message = "对不起,操作失败!"; } } else { _message = "标题不能为空!"; } RenderText("{\"code\":\"" + _code + "\",\"message\":\"" + _message + "\"}"); CancelLayout(); }