Exemplo n.º 1
0
        /*
         * Update the number e.g. save the name
         */
        public bool save()
        {
            string url = CTM.Config.Endpoint() + "/accounts/" + this.token.account_id + "/numbers/" + this.id + ".json";

              Hashtable parameters = new Hashtable();
              parameters["name"]      = this.name;
              parameters["active"]    = this.active ? "1" : "0";
              parameters["formatted"] = this.formatted;

              CTM.Request  req = new CTM.Request(url, this.token);
              CTM.Response res = req.put(parameters);

              if (res.error != null){ this.error = res.error; }
              return res.error == null;
        }
Exemplo n.º 2
0
        /*
         * Update the account
         */
        public bool save()
        {
            string url = CTM.Config.Endpoint() + "/accounts/" + this.id + ".json";

              Hashtable parameters            = new Hashtable();
              parameters["account[name]"]     = this.name;
              parameters["account[website]"]  = (this.website == null ? "" : this.website);
              parameters["account[timezone]"] = this.timezone;

              CTM.Request  request = new CTM.Request(url, token);
              CTM.Response res     = request.put(parameters);

              if (res.error != null){ this.error = res.error; }
              return res.error == null;
        }