internal async Task <JsonResult> NewDspandAwb(Reshipment reshipment)
        {
            SqlConnection cn = null;

            try
            {
                cn = Connection.GetConnection();
                SqlCommand smd = new SqlCommand("reshipment_new_awb", cn)
                {
                    CommandType = CommandType.StoredProcedure
                };
                smd.Parameters.Add("@jsonOutput", SqlDbType.NVarChar, -1).Direction = ParameterDirection.Output;

                smd.Parameters.AddWithValue("@type", reshipment.Type);
                smd.Parameters.AddWithValue("@location_id", reshipment.LocationId);
                smd.Parameters.AddWithValue("@lines", ToDataTable(reshipment.lines));

                await smd.ExecuteNonQueryAsync().ConfigureAwait(false);

                string json = smd.Parameters["@jsonOutput"].Value.ToString();

                return(new JsonResult(JArray.Parse(json)));
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                Connection.CloseConnection(ref cn);
            }
        }
Exemple #2
0
 public async Task <JsonResult> NewDspandAwb([FromBody] Reshipment reshipment)
 {
     try
     {
         return(await _reshipmentLogic.NewDspandAwb(reshipment).ConfigureAwait(false));
     }
     catch (Exception ee)
     {
         return(await _reshipmentLogic.SendRespose("False", ee.Message).ConfigureAwait(false));
     }
 }