internal async Task <IActionResult> RangeChange(OQCRange check) { SqlConnection cn = null; try { cn = Connection.GetConnection(); SqlCommand smd = new SqlCommand("consolidation_range_change", cn) { CommandType = CommandType.StoredProcedure }; smd.Parameters.Add("@jsonOutput", SqlDbType.NVarChar, -1).Direction = ParameterDirection.Output; smd.Parameters.AddWithValue("@email_id", check.Email); smd.Parameters.AddWithValue("@location_id", check.LocationId); smd.Parameters.AddWithValue("@zone", check.Zone); await smd.ExecuteNonQueryAsync().ConfigureAwait(false); string json = smd.Parameters["@jsonOutput"].Value.ToString(); smd.Dispose(); JArray arr = JArray.Parse(json); return(new JsonResult(arr)); } catch (Exception) { throw; } finally { Connection.CloseConnection(ref cn); } }
public async Task <IActionResult> RangeChange([FromBody] OQCRange check) { try { return(await _outboundQualityCheckLogic.RangeChange(check).ConfigureAwait(false)); } catch (Exception ee) { return(await _outboundQualityCheckLogic.SendRespose("False", ee.Message).ConfigureAwait(false)); } }