Example #1
0
        internal async Task <OQCResponse> SingleOrderOQC(OutboundQualityCheck shipData)
        {
            SqlConnection cn = null;

            try
            {
                cn = Connection.GetConnection();
                SqlCommand smd = new SqlCommand("oqc_get_data_for_single_quantity", cn)
                {
                    CommandType = CommandType.StoredProcedure
                };
                smd.Parameters.Add("@jsonOutput", SqlDbType.NVarChar, -1).Direction = ParameterDirection.Output;
                smd.Parameters.AddWithValue("@barcode", shipData.Barcode);
                smd.Parameters.AddWithValue("@sorting_zone", shipData.SortingZone);
                smd.Parameters.AddWithValue("@marketplace", shipData.Marketplace);
                smd.Parameters.AddWithValue("@location_id", shipData.LocationId);
                smd.Parameters.AddWithValue("@email_id", shipData.EmailID);
                await smd.ExecuteNonQueryAsync().ConfigureAwait(false);

                string json = smd.Parameters["@jsonOutput"].Value.ToString();
                smd.Dispose();
                OQCResponse returnResponse = JsonConvert.DeserializeObject <OQCResponse>(json);
                return(returnResponse);
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                Connection.CloseConnection(ref cn);
            }
        }
Example #2
0
        public async Task <JsonResult> SingleOrderOQC([FromBody] OutboundQualityCheck shipData)
        {
            try
            {
                OQCResponse qCResponse = await _outboundQualityCheckLogic.SingleOrderOQC(shipData).ConfigureAwait(false);

                if (qCResponse.barcode != null)
                {
                    qCResponse.images = await _outboundQualityCheckLogic.GetImage(qCResponse.barcode).ConfigureAwait(false);
                }
                List <OQCResponse> loQCResponses = new List <OQCResponse>()
                {
                    qCResponse
                };
                return(new JsonResult(loQCResponses));
            }
            catch (Exception ee)
            {
                return(await _outboundQualityCheckLogic.SendRespose("False", ee.Message).ConfigureAwait(false));
            }
        }