示例#1
0
        // POST api/<controller>
        public Hashtable Post(string content)
        {
            Hashtable ht   = new Hashtable();
            WorkInfo  ai   = new WorkInfo();
            Hashtable data = new Hashtable();

            try
            {
                // ht.Add("state", ai.AddOne(id, name, birthday, admin, work));
                if (ai.AddOne(content, 0))
                {
                    ht.Add("code", 20000);
                    data.Add("id", ai.GetId(content));
                }
                else
                {
                    ht.Add("code", 40000);
                    data.Add("message", "error");
                }
            }
            catch (Exception e)
            {
                ht.Add("code", 40000);
                data.Add("message", e.Message);
            }
            ht.Add("data", data);
            return(ht);
        }