コード例 #1
0
        public bool Save(InvoiceItemSupport invoiceItemSupport)
        {
            if (!IsValid(invoiceItemSupport.Comments[0]))
            {
                return(false);
            }

            ItemCommentSupportMapper itemCommentSupportMapper = new ItemCommentSupportMapper();

            if (!itemCommentSupportMapper.Save(invoiceItemSupport))
            {
                string errorDescription = "No se ha podido guardar el comentario de soporte para el id de producto " + invoiceItemSupport.InvoiceItem.Id + ".";
                log.AddLogCritical("Save", errorDescription, this);
                AddError(new ResultBE(ResultBE.Type.FAIL, errorDescription));
                return(false);
            }

            if (!itemCommentSupportMapper.ChangeTopicStatus(invoiceItemSupport.InvoiceItem.Id, false))
            {
                string errorDescription = "No se ha podido cerrar la consulta de soporte para el invoiceItemId" + invoiceItemSupport.InvoiceItem.Id + ".";
                log.AddLogCritical("Save", errorDescription, this);
                AddError(new ResultBE(ResultBE.Type.FAIL, errorDescription));
                return(false);
            }

            return(true);
        }
コード例 #2
0
        public bool CloseTopic(int invoiceItemId)
        {
            ItemCommentSupportMapper itemCommentSupportMapper = new ItemCommentSupportMapper();

            if (!itemCommentSupportMapper.ChangeTopicStatus(invoiceItemId, true))
            {
                string errorDescription = "No se ha podido cerrar la consulta de soporte para el invoiceItemId" + invoiceItemId + ".";
                log.AddLogCritical("CloseTopic", errorDescription, this);
                AddError(new ResultBE(ResultBE.Type.FAIL, errorDescription));
                return(false);
            }

            return(true);
        }