public bool saveReply(int id, String content, String account) { bool result = false; Owner owenr = null; User user = null; if (ownerDao.Select(id, null, null, null, null, null, null, null, null, 0).Count > 0) { owenr = ownerDao.Select(id, null, null, null, null, null, null, null, null, 0)[0]; } else { return(result); } if (userDao.Select(null, account, null, null, null, null, null, null, null, null, null, null, null).Count > 0) { user = userDao.Select(null, account, null, null, null, null, null, null, null, null, null, null, null)[0]; } else { return(result); } Reply reply = new Reply(); reply.owner = owenr; reply.ReplyContent = content; reply.time = DateTime.Now; reply.User = user; owenr.LastReplyTime = reply.time; if (replyDao.Create(reply) && ownerDao.Edit(owenr)) { result = true; } return(result); }
public List <Owner> GetOwnerByType(String type, int index) { LoseType loseType = null; var items = loseTypesDao.Select(null, type, null); if (items.Count == 1) { foreach (LoseType item in items) { loseType = item; } return(ownerDao.Select(null, null, null, null, null, null, loseType, null, null, index)); } else { return(ownerDao.Select(null, null, null, null, null, null, null, null, null, index)); } }
public List <Owner> getOwnerByUser(User user, int index) { return(ownerDao.Select(null, user, null, null, null, null, null, null, null, index)); }