Ejemplo n.º 1
0
        public ResponseMessage GetThisDepartmentControllerService(DepartmentDataPayload data)
        {
            var jsonString = JsonConvert.SerializeObject(data);
            var content    = new StringContent(jsonString, Encoding.UTF8, "application/json");
            var response   = _client.PostAsync(GetThisDepartmentControllerUrl, content).Result;
            //
            var             rep = response.Content.ReadAsStringAsync();
            ResponseMessage msg = JsonConvert.DeserializeObject <ResponseMessage>(rep.Result);

            //
            return(msg);
        }
Ejemplo n.º 2
0
        public async System.Threading.Tasks.Task <ResponseMessage> CheckIfDepartmentExistService(DepartmentDataPayload data)
        {
            var jsonString = JsonConvert.SerializeObject(data);
            var content    = new StringContent(jsonString, Encoding.UTF8, "application/json");
            var response   = await _client.PostAsync(CheckIfDepartmentExistUrl, content);

            //
            var rep = response.Content.ReadAsStringAsync();
            //response.EnsureSuccessStatusCode();
            //string responseString = await response.Content.ReadAsStringAsync();
            ResponseMessage msg = JsonConvert.DeserializeObject <ResponseMessage>(rep.Result);

            //
            return(msg);
        }
Ejemplo n.º 3
0
        public async System.Threading.Tasks.Task <ResponseMessage> RegisterNewDepartment(DepartmentDataPayload data)
        {
            var jsonString = JsonConvert.SerializeObject(data);
            var content    = new StringContent(jsonString, Encoding.UTF8, "application/json");
            var response   = await _client.PostAsync(RegisterNewDepartmentUrl, content);

            //
            var             rep = response.Content.ReadAsStringAsync();
            ResponseMessage msg = JsonConvert.DeserializeObject <ResponseMessage>(rep.Result);

            //
            return(msg);
        }