public TaxTypeResponse UpdateTaxType(TaxTypeEntity taxType) { var response = new TaxTypeResponse { Acknowledge = AcknowledgeType.Success }; try { if (!taxType.Validate()) { foreach (string error in taxType.ValidationErrors) { response.Message += error + Environment.NewLine; } response.Acknowledge = AcknowledgeType.Failure; return(response); } response.Message = TaxTypeDao.UpdateTaxType(taxType); if (!string.IsNullOrEmpty(response.Message)) { response.Acknowledge = AcknowledgeType.Failure; return(response); } response.TaxTypeId = taxType.TaxTypeId; return(response); } catch (Exception ex) { response.Message = ex.Message; return(response); } }
public TaxTypeResponse DeleteTaxType(string taxTypeId) { var response = new TaxTypeResponse { Acknowledge = AcknowledgeType.Success }; try { response.Message = TaxTypeDao.DeleteTaxType(taxTypeId); if (!string.IsNullOrEmpty(response.Message)) { response.Acknowledge = AcknowledgeType.Failure; return(response); } response.TaxTypeId = taxTypeId; return(response); } catch (Exception ex) { response.Message = ex.Message; return(response); } }