Example #1
0
 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);
     }
 }
Example #2
0
        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);
        }
Example #3
0
        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);
        }
Example #4
0
        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);
        }
Example #5
0
        public string GetId(string wxid)
        {
            MessagerDb db = new MessagerDb();

            return(db.GetId(wxid));
        }
Example #6
0
        public void DelRp(string rpid)
        {
            MessagerDb db = new MessagerDb();

            db.DeleteReply(rpid);
        }
Example #7
0
        public void DelMs(string msid)
        {
            MessagerDb db = new MessagerDb();

            db.DeleteMessage(msid);
        }
Example #8
0
        public void UpName(string name, string imageid, string wxid)
        {
            MessagerDb db = new MessagerDb();

            db.UploadId(name, imageid, wxid);
        }