Beispiel #1
0
        public async Task <ResponseResult> AddActualLockedOperatorAsync(AddActualLoggedViewModel model)
        {
            ResponseResult responseResult = new ResponseResult();
            StringContent  content        = new StringContent(JsonConvert.SerializeObject(model), Encoding.UTF8, "application/json");

            using (var response = await httpClient.PostAsync("api/debug/AddActualLockedOpertor", content))
            {
                string apiResponse = await response.Content.ReadAsStringAsync();

                responseResult = JsonConvert.DeserializeObject <ResponseResult>(apiResponse);
            }
            return(responseResult);
        }
        public async Task <IActionResult> AddActualLockedOperatorAsync([FromBody] AddActualLoggedViewModel model)
        {
            try
            {
                await context.Database.ExecuteSqlCommandAsync(SPDebug.AddActualLoggedOperator, model.WC, model.Sep, model.Oct, model.Nov, model.Dec, model.Jan, model.Feb, model.Mar, model.Apr, model.May, model.Jun, model.Jul, model.Aug);

                return(Ok(new ResponseResult(200)));
            }
            catch (Exception ex)
            {
                return(BadRequest(new ResponseResult(400, ex.Message)));
            }
        }
        public async Task <IActionResult> AddActualLockedOperatorAsync([FromBody] AddActualLoggedViewModel model)
        {
            var result = await debugService.AddActualLockedOperatorAsync(model);

            return(Json(new { statusCode = result.StatusCode }));
        }