public void DeleteSupplierType(SupplierTypeDTO dto) { try { log.Debug(SupplierTypeDTO.FormatSupplierTypeDTO(dto)); R_SupplierType t = SupplierTypeDTO.ConvertDTOtoEntity(dto); // delete Repository.DeleteSupplierType(t); dto.IsDeleted = t.IsDeleted; log.Debug("result: 'success'"); } catch (System.Exception e) { // error log.Error(e.ToString()); throw; } }
public HttpResponseMessage Delete([FromBody] Models.supplier_type objSupplierType, long?updated_by) { try { bool objSupplier = _supplierTypeRepository.DeleteSupplierType(objSupplierType.supplier_type_id, updated_by); var formatter = RequestFormat.JsonFormaterString(); return(Request.CreateResponse(HttpStatusCode.OK, new Confirmation { output = "success", msg = "Supplier Type Delete Successfully." }, formatter)); } catch (Exception ex) { var formatter = RequestFormat.JsonFormaterString(); return(Request.CreateResponse(HttpStatusCode.OK, new Confirmation { output = "error", msg = ex.ToString() }, formatter)); } }