public Invoice validateInvoice(Invoice invoice, bool safeAfterValidation)
 {
     validationMgr = new ValidationManager();
     return validationMgr.validateInvoice(invoice, safeAfterValidation);
 }
Ejemplo n.º 2
0
        //VALIDATION MANAGER
        /// <summary>
        /// Validates the specified invoice, updating its isValid and isChecked attributes appropriately.
        /// </summary>
        /// <param name="invoiceId">id of invoice to validate</param>
        /// <param name="saveAfterValidation">bool representing whether the invoice validation details are saved post-validation</param>
        /// <returns>JSON representation of validated invoice, wrapped in EMResponse.</returns>
        public string validateInvoice(int invoiceId, bool saveAfterValidation)
        {
            EMResponse response = new EMResponse();
            try
            {
                validationMgr = new ValidationManager();
                response.data = EMConverter.fromObjectToJSON(validationMgr.validateInvoice(invoiceId, saveAfterValidation));
                response.status = ok;
            }
            catch (Exception e)
            {
                response.status = error;
                response.data = e.Message;
            }

            return EMConverter.fromObjectToJSON(response);
        }
 //-->VALIDATION MANAGER
 public string validateInvoice(int invoiceId, bool saveAfterValidation)
 {
     validationMgr = new ValidationManager();
     return validationMgr.validateInvoice(invoiceId, saveAfterValidation);
 }