/// <summary> /// Deletes a Keyword Product /// </summary> /// <param name="Ado"></param> /// <param name="dto"></param> /// <param name="mandatoryOnly"></param> /// <returns></returns> internal int Delete(ADO Ado, Product_DTO dto, bool?mandatoryOnly = null) { Keyword_Product_ADO kpAdo = new Keyword_Product_ADO(Ado); Keyword_Product_DTO kpDto = new Keyword_Product_DTO(); kpDto.PrcCode = dto.PrcCode; if (mandatoryOnly != null) { return(kpAdo.Delete(kpDto, mandatoryOnly)); } else { return(kpAdo.Delete(kpDto)); } }
/// <summary> /// Execute /// </summary> /// <returns></returns> protected override bool Execute() { var adoKeyword_Product = new Keyword_Product_ADO(Ado); //attempting to delete. The number of entities deleted are passed to the entitiesDeleted variable (this is 1 for a successful delete) int nDeleted = adoKeyword_Product.Delete(DTO, false); Log.Instance.Debug("Delete operation finished in ADO"); if (nDeleted == 0) { Log.Instance.Debug("No record found for delete request"); Response.error = Label.Get("error.delete"); return(false); } Response.data = JSONRPC.success; return(true); }