internal async Task <JsonResult> Complete(RGPComplete returnGatePass) { SqlConnection cn = null; try { cn = Connection.GetConnection(); SqlCommand smd = new SqlCommand("rgp_create", cn) { CommandType = CommandType.StoredProcedure }; smd.Parameters.AddWithValue("@rgp_no", returnGatePass.RGPNo); smd.Parameters.AddWithValue("@created_by", returnGatePass.CreatedBy); smd.Parameters.AddWithValue("@from_location", returnGatePass.FromLocation); smd.Parameters.AddWithValue("@party_id", returnGatePass.PartyId); smd.Parameters.AddWithValue("@lines", ToDataTable(returnGatePass.Lines)); smd.Parameters.Add("@jsonOutput", SqlDbType.NVarChar, -1).Direction = ParameterDirection.Output; 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 <JsonResult> Complete([FromBody] RGPComplete returnGatePass) { try { return(await _returngatepassLogic.Complete(returnGatePass).ConfigureAwait(false)); } catch (Exception ee) { return(await _returngatepassLogic.SendRespose("False", ee.Message).ConfigureAwait(false)); } }