internal async Task <DataTable> SingleOrderOQCPost(OQCPost oqcpost) { SqlConnection cn = null; try { cn = Connection.GetConnection(); SqlDataAdapter da = new SqlDataAdapter("oqc_post_data_for_single_quantity", cn); da.SelectCommand.CommandType = CommandType.StoredProcedure; da.SelectCommand.Parameters.AddWithValue("@pick_no", oqcpost.PickNo); da.SelectCommand.Parameters.AddWithValue("@pick_line_no", oqcpost.PickLineNo); da.SelectCommand.Parameters.AddWithValue("@good_qty", oqcpost.GoodQty); da.SelectCommand.Parameters.AddWithValue("@bad_qty", oqcpost.BadQty); da.SelectCommand.Parameters.AddWithValue("@miss_qty", oqcpost.MissingQty); da.SelectCommand.Parameters.AddWithValue("@email_id", oqcpost.EmailID); da.SelectCommand.Parameters.AddWithValue("@packing_material", oqcpost.PackingMaterial); da.SelectCommand.Parameters.AddWithValue("@weight", oqcpost.Weight); DataTable dt = new DataTable(); da.Fill(dt); return(dt); } catch (Exception) { throw; } finally { Connection.CloseConnection(ref cn); } }
public async Task <IActionResult> SingleOrderOQCPost([FromBody] OQCPost oqcpost) { try { DataTable dt = await _outboundQualityCheckLogic.SingleOrderOQCPost(oqcpost).ConfigureAwait(false); if (dt.Rows.Count > 0 && dt.Columns.Contains("report")) { if (dt.Rows[0]["report"].ToString() == "CompleteInvoice") { return(await InvoiceReport(dt.Rows[0]["order"].ToString()).ConfigureAwait(false)); } else if (dt.Rows[0]["report"].ToString() == "Marketplace") { return(await OrderReport(dt.Rows[0]["order"].ToString()).ConfigureAwait(false)); } } return(new JsonResult(dt)); } catch (Exception ee) { return(await _outboundQualityCheckLogic.SendRespose("False", ee.Message).ConfigureAwait(false)); } }