예제 #1
0
        public ActionResult RestablecerComprobante(int id)
        {
            if (!this.currentUser()) { return RedirectToAction("Ingresar"); }
            if (getCurrentUser().IdRol == 4) { return RedirectToAction("Comprobantes", "Admin"); }

            ComprobanteDTO dto;
            try
            {
                ComprobanteBL objBL = new ComprobanteBL();
                dto = objBL.getComprobanteEnEmpresa(getCurrentUser().IdEmpresa, id);
                if (objBL.unban(id))
                {
                    createResponseMessage(CONSTANTES.SUCCESS, CONSTANTES.SUCCESS_UNBAN);
                }
                else
                {
                    createResponseMessage(CONSTANTES.ERROR, CONSTANTES.ERROR_UNBAN);
                }
            }
            catch (Exception e)
            {
                createResponseMessage(CONSTANTES.ERROR, CONSTANTES.ERROR_NO_UNBAN);
                throw;
            }
            return RedirectToAction("ComprobantesAnulados", "Admin");
        }