Ejemplo n.º 1
0
        internal async Task <JArray> ForcefullyFlushOutPostOQCPostOQC(MultiOQCPost check)
        {
            SqlConnection cn = null;

            try
            {
                cn = Connection.GetConnection();
                DataTable dt = new DataTable();
                using (SqlCommand smd = new SqlCommand("forcefully_flush_out_post", cn))
                {
                    smd.CommandType = System.Data.CommandType.StoredProcedure;
                    smd.Parameters.Add("@jsonOutput", SqlDbType.NVarChar, -1).Direction = ParameterDirection.Output;
                    smd.Parameters.AddWithValue("@oqc_list", ToDataTable(check.lines));
                    smd.Parameters.AddWithValue("@email_id", check.EmailId);
                    smd.Parameters.AddWithValue("@order_no", check.OrderNo);
                    smd.Parameters.AddWithValue("@weight", check.Weight);
                    smd.Parameters.AddWithValue("@packing_material", check.PackingMaterial);
                    await smd.ExecuteNonQueryAsync().ConfigureAwait(false);

                    string json = smd.Parameters["@jsonOutput"].Value.ToString();
                    return(JArray.Parse(json));
                }
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                Connection.CloseConnection(ref cn);
            }
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> PostOQC([FromBody] MultiOQCPost check)
        {
            try
            {
                DataTable dt = await _outboundQualityCheckLogic.PostOQC(check).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() == "OrderNo")
                    {
                        return(await OrderReport(check.OrderNo).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));
            }
        }
Ejemplo n.º 3
0
        internal async Task <DataTable> PostOQC(MultiOQCPost check)
        {
            SqlConnection cn = null;

            try
            {
                cn = Connection.GetConnection();
                SqlDataAdapter da = new SqlDataAdapter("oqc_multi_post", cn);
                da.SelectCommand.CommandType = CommandType.StoredProcedure;
                da.SelectCommand.Parameters.AddWithValue("@oqc_list", ToDataTable(check.lines));
                da.SelectCommand.Parameters.AddWithValue("@email_id", check.EmailId);
                da.SelectCommand.Parameters.AddWithValue("@order_no", check.OrderNo);
                da.SelectCommand.Parameters.AddWithValue("@weight", check.Weight);
                da.SelectCommand.Parameters.AddWithValue("@packing_material", check.PackingMaterial);
                DataTable dt = new DataTable();
                da.Fill(dt);
                return(dt);
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                Connection.CloseConnection(ref cn);
            }
        }
Ejemplo n.º 4
0
 public async Task <IActionResult> OQCCancelOrder([FromBody] MultiOQCPost cancel)
 {
     try
     {
         DataTable dt = _outboundQualityCheckLogic.OQCCancelOrder(cancel);
         if (dt.Rows.Count > 0 && dt.Columns.Contains("report"))
         {
             return(await OrderReport(cancel.OrderNo).ConfigureAwait(false));
         }
         return(new JsonResult(dt));
     }
     catch (Exception ee)
     {
         return(await _outboundQualityCheckLogic.SendRespose("False", ee.Message).ConfigureAwait(false));
     }
 }
        public async Task <IActionResult> ForcefullyFlushOutPostOQC([FromBody] MultiOQCPost check)
        {
            try
            {
                JArray jArray = await _partialLogic.ForcefullyFlushOutPostOQCPostOQC(check).ConfigureAwait(false);

                if (jArray.Count > 0 && jArray.First["condition"].ToString() == "True" && jArray.First["report"].ToString() == "CompleteInvoice")
                {
                    return(await InvoiceReport(jArray[0]["order"].ToString()).ConfigureAwait(false));
                }
                else if (jArray.Count > 0 && jArray.First["condition"].ToString() == "True" && jArray.First["report"].ToString() == "Marketplace")
                {
                    return(await OrderReportGet(jArray[0]["order"].ToString()).ConfigureAwait(false));
                }

                return(new JsonResult(jArray));
            }
            catch (Exception ee)
            {
                return(await _partialLogic.SendRespose("False", ee.Message).ConfigureAwait(false));
            }
        }
Ejemplo n.º 6
0
        internal DataTable OQCCancelOrder(MultiOQCPost cancel)
        {
            SqlConnection cn = null;

            try
            {
                cn = Connection.GetConnection();
                SqlDataAdapter da = new SqlDataAdapter("oqc_cancel_order", cn);
                da.SelectCommand.CommandType = CommandType.StoredProcedure;
                da.SelectCommand.Parameters.AddWithValue("@order_no", cancel.OrderNo);
                DataTable dt = new DataTable();
                da.Fill(dt);
                da.Dispose();
                return(dt);
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                Connection.CloseConnection(ref cn);
            }
        }