Пример #1
0
        public bool UserDelete(string id)
        {
            string path = "/trainer/" + id + "/delete";
            NameValueCollection reqparm = new NameValueCollection();

            ServerComunication.DoPost(path, reqparm);
            return(true);
        }
Пример #2
0
        public bool GetUser(string id)
        {
            string path = "/trainer/";

            try {
                return(Parse(ServerComunication.DoGet(path + id)));
            }catch (Exception ex) {
                return(false);
            }
        }
Пример #3
0
        public Boolean eventNew(string userId)
        {
            string path = "/events/" + userId + "/create";
            NameValueCollection reqparm = new NameValueCollection();

            reqparm.Add("timestamp", Timestamp.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ"));
            reqparm.Add("description", description);

            ServerComunication.DoPost(path, reqparm);

            return(true);
        }
Пример #4
0
        public List <EventModel> Old(string userId, int limit = 30)
        {
            string path = "/events/upcoming/";

            try
            {
                return(ParseMulti(ServerComunication.DoGet(path + userId + "?limit=" + limit.ToString())));
            }
            catch (Exception ex)
            {
                return(null);
            }
        }
Пример #5
0
        public Boolean UserChangePassword(string path)
        {
            NameValueCollection reqparm = new NameValueCollection();


            // reqparm.Add("password", Password);
            reqparm.Add("firstName", firstName);
            reqparm.Add("lastName", lastName);
            String Response = ServerComunication.DoPost(path, reqparm);



            return(true);
        }
Пример #6
0
        public Boolean UserSave()
        {
            string path = "/trainer/";

            NameValueCollection reqparm = new NameValueCollection();

            reqparm.Add("_id", _id);
            reqparm.Add("_rev", _rev);
            reqparm.Add("email", Email);
            reqparm.Add("username", UserName);
            reqparm.Add("firstName", firstName);
            reqparm.Add("lastName", lastName);
            String Response = ServerComunication.DoPost(path + _id, reqparm);



            return(true);
        }
Пример #7
0
        public Boolean UserRegister()
        {
            string path = "/trainer";

            try
            {
                NameValueCollection reqparm = new NameValueCollection();

                reqparm.Add("email", Email);
                reqparm.Add("username", UserName);
                reqparm.Add("password", Password);
                reqparm.Add("firstName", firstName);
                reqparm.Add("lastName", lastName);
                String  Response  = ServerComunication.DoPost(path, reqparm);
                JObject myjObject = JObject.Parse(Response);

                return(Parse(myjObject));
            }
            catch (Exception ex)
            {
                string message = ex.Message;
                return(false);
            }
        }
Пример #8
0
 public void GetUsers(string path)
 {
     Parse(ServerComunication.DoGet(path));
 }