Пример #1
0
        public void TestDeletePayment()
        {
            SettlementBL settlementBL = new SettlementBL(connectionString);
            bool         result       = settlementBL.DeleteSettlementPayment(6);

            Assert.IsTrue(result);
        }
Пример #2
0
        public IHttpActionResult DeleteSettlementPayment(IdModel payment)
        {
            SettlementPaymentResponse response = new SettlementPaymentResponse();

            try
            {
                settlementBL.DeleteSettlementPayment(payment.Id);
                response.Payment = null;
                response.Success = true;
            }
            catch (SettlementException ex)
            {
                response.ErrorCode    = ex.Error;
                response.ErrorMessage = "Error. " + ex.Error.ToString();
                response.Payment      = null;
                response.Success      = false;
            }
            catch (Exception ex)
            {
                response.ErrorMessage = "Error. " + ex.Message;
                response.Payment      = null;
                response.Success      = false;
            }
            return(Ok(response));
        }