internal async Task <JsonResult> DeleteVendorCatalogue(VendorCatalogueModel vcm) { SqlConnection cn = null; try { cn = Connection.GetConnection(); SqlCommand smd = new SqlCommand("[vendor_catalogue_delete]", cn) { CommandType = CommandType.StoredProcedure }; smd.Parameters.Add("@jsonOutput", SqlDbType.NVarChar, -1).Direction = ParameterDirection.Output; smd.Parameters.AddWithValue("@vendor_name", vcm.vendor_no); smd.Parameters.AddWithValue("@item_code", vcm.item_code); 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); } }
public async Task <JsonResult> DeleteVendorCatalogue(VendorCatalogueModel vcm) { try { return(await _vendorLogic.DeleteVendorCatalogue(vcm).ConfigureAwait(false)); } catch (Exception ee) { return(await _vendorLogic.SendRespose("False", ee.Message).ConfigureAwait(false)); } }