Example #1
0
        public SFeedback CreateFeedback(string kind, string model, string object_id, string account_username, object feedback_content, string parent_id)
        {
            Dictionary <string, string> get_params  = new Dictionary <string, string>();
            Dictionary <string, object> post_params = new Dictionary <string, object>();

            get_params.Add("kind", kind); get_params.Add("model", model); get_params.Add("id", object_id); get_params.Add("username", account_username);
            post_params.Add("content", feedback_content); post_params.Add("parent_id", parent_id);
            SBasic <SFeedback> response = RESTService.MakeAndExecutePostRequest <SFeedback>("/api/feedback/new/{kind}/for/{model}/{id}/by/{username}", get_params, post_params);

            if (response != null)
            {
                if (response.data != null)
                {
                    return(response.data);
                }
            }
            return(null);
        }
Example #2
0
        //public SMedia AddMedia(string note_id, string note_title, object note_file)
        //{
        //    Dictionary<string, string> get_params = new Dictionary<string, string>();
        //    Dictionary<string, object> post_params = new Dictionary<string, object>();
        //    get_params.Add("id", note_id);
        //    post_params.Add("title", note_title); post_params.Add("file", note_file);
        //    SBasic<SMedia> response = RESTService.MakeAndExecutePostRequest<SMedia>("/api/note/{id}/new/photo", get_params, post_params);
        //    if (response != null)
        //        if (response.data != null)
        //            return response.data;
        //    return null;
        //}
        public SNote UpdateNote(string note_id, string status)
        {
            Dictionary <string, string> get_params  = new Dictionary <string, string>();
            Dictionary <string, object> post_params = new Dictionary <string, object>();

            get_params.Add("id", note_id);
            post_params.Add("status", status);
            SBasic <SNote> response = RESTService.MakeAndExecutePostRequest <SNote>("/api/note/{id}/update", get_params, post_params);

            if (response != null)
            {
                if (response.data != null)
                {
                    return(response.data);
                }
            }
            return(null);
        }
Example #3
0
        //Interaction Log
        //public string CreateInteractionFile(long start_date, long end_date, string file_name, string file_path)
        //{
        //    Dictionary<string, string> get_params = new Dictionary<string, string>();
        //    Dictionary<string, object> post_params = new Dictionary<string, object>();
        //    get_params.Add("kind", "tabletop"); get_params.Add("site", Configurations.GetSiteNameForServer());
        //    post_params.Add("start", start_date); post_params.Add("end", end_date);
        //    string response = RESTService.MakeAndExecutePostRequestWithFile("/api/log/new/{kind}/at/{site}", get_params, post_params, file_name, file_path);
        //    return response;
        //}
        public SInteractionLog CreateInteractionRecord(int type, string details, int touch_id, double touch_x, double touch_y, string date)
        {
            Dictionary <string, string> get_params  = new Dictionary <string, string>();
            Dictionary <string, object> post_params = new Dictionary <string, object>();

            get_params.Add("type", type.ToString()); get_params.Add("site", Configurations.GetSiteNameForServer());
            post_params.Add("date", date); post_params.Add("touch_id", touch_id.ToString()); post_params.Add("touch_x", touch_x.ToString()); post_params.Add("touch_y", touch_y.ToString());
            post_params.Add("details", details);
            SBasic <SInteractionLog> response = RESTService.MakeAndExecutePostRequest <SInteractionLog>("/api/interaction/new/{type}/at/{site}", get_params, post_params);

            if (response != null)
            {
                if (response.data != null)
                {
                    return(response.data);
                }
            }
            return(null);
        }
Example #4
0
        public SContext UpdateContext(string context_id, string title, string description, string icon)
        {
            Dictionary <string, string> get_params  = new Dictionary <string, string>();
            Dictionary <string, object> post_params = new Dictionary <string, object>();

            get_params.Add("id", context_id);
            post_params.Add("title", title); post_params.Add("description", description);
            post_params.Add("icon", icon);
            SBasic <SContext> response = RESTService.MakeAndExecutePostRequest <SContext>("/api/context/{id}/update", get_params, post_params);

            if (response != null)
            {
                if (response.data != null)
                {
                    return(response.data);
                }
            }
            return(null);
        }
Example #5
0
        public SContext AddContext(string title, string description, string icon)
        {
            Dictionary <string, string> get_params  = new Dictionary <string, string>();
            Dictionary <string, object> post_params = new Dictionary <string, object>();

            get_params.Add("site", Configurations.GetSiteNameForServer());
            post_params.Add("title", title); post_params.Add("description", description);
            post_params.Add("icon", icon);
            SBasic <SContext> response = RESTService.MakeAndExecutePostRequest <SContext>("/api/context/new/activity/at/{site}", get_params, post_params);

            if (response != null)
            {
                if (response.data != null)
                {
                    return(response.data);
                }
            }
            return(null);
        }
Example #6
0
        public SNote CreateNote(string account_username, string note_kind, string note_content, string context_name, string status)
        {
            Dictionary <string, string> get_params  = new Dictionary <string, string>();
            Dictionary <string, object> post_params = new Dictionary <string, object>();

            get_params.Add("username", account_username);
            post_params.Add("kind", note_kind); post_params.Add("content", note_content);
            post_params.Add("context", context_name); post_params.Add("status", status);
            SBasic <SNote> response = RESTService.MakeAndExecutePostRequest <SNote>("/api/note/new/{username}", get_params, post_params);

            if (response != null)
            {
                if (response.data != null)
                {
                    return(response.data);
                }
            }
            return(null);
        }
Example #7
0
        public SAccount UpdateAccount(string account_username, string account_password, string account_email, string account_consent, string affiliation, string icon_url)
        {
            Dictionary <string, string> get_params  = new Dictionary <string, string>();
            Dictionary <string, object> post_params = new Dictionary <string, object>();

            get_params.Add("username", account_username);
            post_params.Add("password", account_password);
            post_params.Add("email", account_email); post_params.Add("consent", account_consent);
            post_params.Add("affiliation", affiliation); post_params.Add("icon_url", icon_url);
            SBasic <SAccount> response = RESTService.MakeAndExecutePostRequest <SAccount>("/api/account/update/{username}", get_params, post_params);

            if (response != null)
            {
                if (response.data != null)
                {
                    return(response.data);
                }
            }
            return(null);
        }