Exemplo n.º 1
0
        public IHttpActionResult DeactivateModule(int moduleId)
        {
            if (moduleId <= 0)
            {
                return(BadRequest("module id must be sent."));
            }

            try
            {
                modulesService.DisableModule(moduleId);

                var modules = modulesService.GetAllModules()
                              .Select(m => new SystemModule()
                {
                    IsActive    = m.IsActive,
                    ModuleId    = m.ModuleId,
                    CreatedDate = m.CreatedDate,
                    ModuleName  = m.ModuleName
                });
                var html = Helpers.RenderPartial("~/Views/Shared/Partial/Tables/SystemModules.cshtml", modules);
                return(Ok(html));
            }
            catch (Exception ex)
            {
                return(InternalServerError(ex));
            }
        }