예제 #1
0
        public async Task <IActionResult> AddConetntType(string name, bool isMainPage)
        {
            if (!String.IsNullOrEmpty(name))
            {
                await _contentTypeService.Create(new ContentType { Name = name, IsMainPage = isMainPage, IsActive = false });
            }
            short id = 0;

            return(ViewComponent("ContentType", new { selectedContentType = id }));
        }
예제 #2
0
        public IResponseData <bool> CreateContentType(CreateContentTypeRequest request)
        {
            IResponseData <bool> response = new ResponseData <bool>();

            try
            {
                IContentTypeService service = IoC.Container.Resolve <IContentTypeService>();
                service.Create(request);
                response.SetData(true);
            }
            catch (ValidationException ex)
            {
                response.SetErrors(ex.Errors);
                response.SetStatus(HttpStatusCode.PreconditionFailed);
            }
            return(response);
        }
        public void CreateContentType(CreateContentTypeRequest request)
        {
            IContentTypeService service = IoC.Container.Resolve <IContentTypeService>();

            service.Create(request);
        }