public Model.Chat selectRecentMessage(String myID, String otherID) { List <Dictionary <String, Object> > sqlResult = DatabaseTool.ExecSqlReturn(String.Format(selectMessage, otherID, myID)); Model.Chat chat = new Model.Chat(); if (sqlResult == null || sqlResult.Count < 1) { //如果没找到和这个人的聊天记录,说明这个人可能是该用户在首页点击的chat_id return(null); } else { return(Model.Chat.createChat(sqlResult[0])); } }
public String selectNewMessage(String myID, String otherID, DateTime lastTime) { List <Dictionary <String, Object> > sqlResult = DatabaseTool.ExecSqlReturn(String.Format(selectNew, myID, otherID, lastTime)); Model.Chat chat = new Model.Chat(); if (sqlResult == null || sqlResult.Count < 1) { //如果没找到和这个人的聊天记录,说明这个人可能是该用户在首页点击的chat_id return(null); } else { chat = Model.Chat.createChat(sqlResult[0]); return(chat.content); } }
public List <Model.Release> selectGoodsByGoodID(int goodsID) { List <Dictionary <String, Object> > sqlResult = DatabaseTool.ExecSqlReturn(String.Format(selectByID, goodsID)); List <Model.Release> release = new List <Model.Release>(); if (sqlResult == null || sqlResult.Count < 1) { return(release); } else { foreach (Dictionary <String, Object> dic in sqlResult) { release.Add(Model.Release.createRelease(dic)); } return(release); } }
public List <Model.Release> selectGoodsRandom() { List <Dictionary <String, Object> > sqlResult = DatabaseTool.ExecSqlReturn(selectAll); List <Model.Release> release = new List <Model.Release>(); if (sqlResult == null || sqlResult.Count < 1) { return(release); } else { foreach (Dictionary <String, Object> dic in sqlResult) { release.Add(Model.Release.createRelease(dic)); } return(release); } }
public List <Model.Chat> selectAllMessage(String myID, String otherID) { List <Dictionary <String, Object> > sqlResult = DatabaseTool.ExecSqlReturn(String.Format(selectAllMessages, myID, otherID, otherID, myID)); List <Model.Chat> message = new List <Model.Chat>(); if (sqlResult == null || sqlResult.Count < 1) { //如果没找到和这个人的聊天记录,说明这个人可能是该用户在首页点击的chat_id return(null); } else { foreach (Dictionary <String, Object> dic in sqlResult) { message.Add(Model.Chat.createChat(dic)); } return(message); } }
public List <Model.Release> selectGoodsByCategory(String Category) { String sql = String.Format(selectByCategory, Category); List <Dictionary <String, Object> > sqlResult = DatabaseTool.ExecSqlReturn(sql); List <Model.Release> release = new List <Model.Release>(); if (sqlResult == null || sqlResult.Count < 1) { return(release); } else { foreach (Dictionary <String, Object> dic in sqlResult) { release.Add(Model.Release.createRelease(dic)); } return(release); } }