示例#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);
            }
        }
示例#2
0
        internal async Task <DataSet> GetSlotForOQC(OutboundQualityCheck check)
        {
            SqlConnection cn = null;

            try
            {
                cn = Connection.GetConnection();
                SqlDataAdapter da = new SqlDataAdapter("oqc_get_slot", cn);
                da.SelectCommand.CommandType = CommandType.StoredProcedure;
                da.SelectCommand.Parameters.AddWithValue("@sorting_zone", check.SortingZone);
                da.SelectCommand.Parameters.AddWithValue("@email_id", check.EmailID);
                da.SelectCommand.Parameters.AddWithValue("@location_id", check.LocationId);
                DataSet ds = new DataSet();
                da.Fill(ds);
                return(ds);
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                Connection.CloseConnection(ref cn);
            }
        }
示例#3
0
        internal async Task <JsonResult> ReleaseHold(OutboundQualityCheck rhold)
        {
            SqlConnection cn = null;

            try
            {
                cn = Connection.GetConnection();
                SqlCommand smd = new SqlCommand("oqc_release_item", cn)
                {
                    CommandType = CommandType.StoredProcedure
                };
                smd.Parameters.Add("@jsonOutput", SqlDbType.NVarChar, -1).Direction = ParameterDirection.Output;
                smd.Parameters.AddWithValue("@email_id", rhold.EmailID);
                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);
            }
        }
示例#4
0
        public async Task <JsonResult> GetSlotForOQC([FromBody] OutboundQualityCheck check)
        {
            try
            {
                List <MultiOQCLines> mlines = new List <MultiOQCLines>();

                DataSet ds = await _outboundQualityCheckLogic.GetSlotForOQC(check).ConfigureAwait(false);

                if (ds.Tables.Count > 1)
                {
                    mlines = _outboundQualityCheckLogic.DataTableToList <MultiOQCLines>(ds.Tables[1]);
                    for (int i = 0; i < mlines.Count; i++)
                    {
                        mlines[i].images = await _outboundQualityCheckLogic.GetImage(mlines[i].barcode).ConfigureAwait(false);
                    }
                }

                MultiOQCResponse multiOQCResponse = new MultiOQCResponse()
                {
                    header = ds.Tables[0],
                    lines  = mlines
                };

                List <MultiOQCResponse> returnresponse = new List <MultiOQCResponse>()
                {
                    multiOQCResponse
                };

                return(new JsonResult(returnresponse));
            }
            catch (Exception ee)
            {
                DataTable dt = new DataTable();
                dt.Columns.Add("condition");
                dt.Columns.Add("message");
                DataRow excpe = dt.NewRow();
                excpe["condition"] = "False";
                excpe["message"]   = ee.Message;
                dt.Rows.Add(excpe);

                MultiOQCResponse multiOQCResponse = new MultiOQCResponse()
                {
                    header = dt
                };

                List <MultiOQCResponse> returnresponse = new List <MultiOQCResponse>()
                {
                    multiOQCResponse
                };

                await _outboundQualityCheckLogic.SendRespose("False", ee.Message).ConfigureAwait(false);

                return(new JsonResult(returnresponse));
            }
        }
示例#5
0
 public async Task <JsonResult> ReleaseHold([FromBody] OutboundQualityCheck rhold)
 {
     try
     {
         return(await _outboundQualityCheckLogic.ReleaseHold(rhold).ConfigureAwait(false));
     }
     catch (Exception ee)
     {
         return(await _outboundQualityCheckLogic.SendRespose("False", ee.Message).ConfigureAwait(false));
     }
 }
示例#6
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));
            }
        }