public String GetMessage(string kind, string region) { if (region == "All") { MessagerDb db = new MessagerDb(); List <Message> msList = db.GetAllMessage(); string a = "["; foreach (Message message in msList) { a += message.toJson(); if (msList.IndexOf(message) < msList.Count - 1) { a += ","; } } a += "]"; return(a); } else { MessagerDb db = new MessagerDb(); List <Message> msList = db.GetMessage(region); string a = "["; foreach (Message message in msList) { a += message.toJson(); if (msList.IndexOf(message) < msList.Count - 1) { a += ","; } } a += "]"; return(a); } }
public void UpReply(string name, string content, string wxId, string replyTo, string imageId, string replytowx) { Reply a = new Reply(name, content, wxId, replyTo, imageId, replytowx); MessagerDb db = new MessagerDb(); db.UploadReply(a); }
public void UpMessage(string name, string content, string wxId, string region, string imageId) { Message a = new Message(name, content, wxId, region, imageId); MessagerDb db = new MessagerDb(); db.UploadMessage(a); }
public string MyReplies(string wxid) { MessagerDb db = new MessagerDb(); List <Reply> rpList = db.GetMyReply(wxid); string a = "["; foreach (Reply reply in rpList) { a += reply.toJson(); if (rpList.IndexOf(reply) < rpList.Count - 1) { a += ","; } } a += "]"; return(a); }
public string GetId(string wxid) { MessagerDb db = new MessagerDb(); return(db.GetId(wxid)); }
public void DelRp(string rpid) { MessagerDb db = new MessagerDb(); db.DeleteReply(rpid); }
public void DelMs(string msid) { MessagerDb db = new MessagerDb(); db.DeleteMessage(msid); }
public void UpName(string name, string imageid, string wxid) { MessagerDb db = new MessagerDb(); db.UploadId(name, imageid, wxid); }