Example #1
0
        public IHttpActionResult GetAll()
        {
            if (IsTokenValid() && authenticationService.IsAllowedToGetFormats(GetTokenUserEmail()))
            {
                try
                {
                    return(Ok(GetFormat.ToModel(formatManagementService.GetAll())));
                }
                catch (Exceptions e)
                {
                    return(BadRequest(e.Message));
                }
            }

            return(Unauthorized());
        }
        private void LoadFormatsAndStyleClasses()
        {
            IEnumerable <Format> existingFormats = formatManager.GetAll();

            lbxFormats.Items.Clear();
            foreach (Format format in existingFormats)
            {
                lbxFormats.Items.Add(format);
            }

            IEnumerable <StyleClass> existingStyleClasses = styleClassManager.GetAll();

            lbxStyleClasses.Items.Clear();
            foreach (StyleClass styleClass in existingStyleClasses)
            {
                lbxStyleClasses.Items.Add(styleClass);
            }
        }