Beispiel #1
0
        public HttpResponseMessage RemoveDatasetFromUser([FromBody] JObject data)
        {
            DomainInstance handler = new DomainInstance();

            return(handler.ChangeUserAssociatedDataset(
                       data["username"].ToString(),
                       data["datasetName"].ToString(),
                       data["datasetUser"].ToString(),
                       false) ?
                   new HttpResponseMessage()
            {
                StatusCode = System.Net.HttpStatusCode.OK
            }
                :
                   new HttpResponseMessage()
            {
                StatusCode = System.Net.HttpStatusCode.InternalServerError
            });
        }
Beispiel #2
0
        public HttpResponseMessage AddDatasetToUser([FromBody] JObject data)
        {
            DomainInstance handler = new DomainInstance();

            return(handler.ChangeUserAssociatedDataset(
                       data["username"].ToString(),
                       data["datasetName"].ToString(),
                       data["datasetUser"].ToString(),
                       true) ?
                   new HttpResponseMessage()
            {
                StatusCode = System.Net.HttpStatusCode.OK
            }
                :
                   new HttpResponseMessage()
            {
                StatusCode = System.Net.HttpStatusCode.InternalServerError
            });
            //todo: add a better message here
        }