public ActionResult Reply(string content, string parentId = "0") { if (CUR_USER != null) { LeaveMessage model = new LeaveMessage() { Id = Guid.NewGuid().ToId(), ParentId = parentId, Content = content, UserId = CUR_USER.Id, CreateUser = CUR_USER.UserName, CreateTime = DateTime.Now, ModifyUser = CUR_USER.UserName, ModifyTime = DateTime.Now }; if (_ILeaveMessageService.Insert(model)) { return new ActionReturn(true, "回复成功!", null); } return new ActionReturn(false, "回复失败!", null); } else { return new ActionReturn(false, "请先登录!", null); } }
/// <summary> /// 添加留言 /// </summary> /// <param name="entity"></param> /// <returns></returns> public bool Insert(LeaveMessage model) { if (model != null) { if (_DataBase.InsertModel<LeaveMessage>(model)) return true; return false; } return false; }
public ActionResult Insert(string content) { LeaveMessage model = new LeaveMessage() { Id = Guid.NewGuid().ToString("N"), ParentId = "0", Content = content, CreateTime = DateTime.Now, ModifyTime = DateTime.Now }; if (CUR_USER != null) { model.UserId = CUR_USER.Id; model.ModifyUser = CUR_USER.UserName; model.CreateUser = CUR_USER.UserName; } if (_ILeaveMessageService.Insert(model)) { return new ActionReturn(true, "留言成功!", null); } return new ActionReturn(false, "Oh,留言失败!请联系管理员...", null); }
public int Update(LeaveMessage model) { return _ILeaveMessageDao.Update(model); }
public bool Insert(LeaveMessage model) { return _ILeaveMessageDao.Insert(model); }
public int Update(LeaveMessage model) { throw new NotImplementedException(); }