Exemplo n.º 1
0
        public LabelCreateModel()
        {
            Title = Localizer.Localize("label_create_title");

            ProjectInput     = new SelectInputModel("Project", "project", true);
            NameInput        = new InputModel("Name", "name", true);
            DescriptionInput = new LongInputModel("Description", "description");
        }
        public LabelTranslationCreateModel()
        {
            Title = Localizer.Localize("label_translation_create_title");

            LabelInput            = new SelectInputModel("Label", "label", true);
            LanguageInput         = new SelectInputModel("Language", "language", true);
            LabelTranslationInput = new TextareaInputModel("LabelTranslation", "label_translation", true);
        }
Exemplo n.º 3
0
        public UserEditModel()
        {
            Title = "user_edit_title";

            UserUidInput = new HiddenInputModel("UserUid");

            FirstNameInput = new InputModel("FirstName", "first_name", true);
            LastNameInput  = new InputModel("LastName", "last_name", true);
            LanguageInput  = new SelectInputModel("LanguageUid", "LanguageName", "language", "/Language/SelectData");
            LanguageInput.IsOptionTypeContent = true;
        }
Exemplo n.º 4
0
 public IHttpActionResult Select([FromBody] SelectInputModel model)
 {
     try
     {
         var values = service.Select(model?.Expand ?? defaultExpand, model?.Filter ?? defaultFilter)
                      .ToList();
         return(Ok(values));
     }
     catch (UnauthorizedAccessException)
     {
         return(StatusCode(HttpStatusCode.Forbidden));
     }
 }
Exemplo n.º 5
0
        public LabelCloneModel()
        {
            Title = "label_clone_title";

            OrganizationUidInput = new HiddenInputModel("OrganizationUid");
            CloningLabelUidInput = new HiddenInputModel("CloningLabelUid");
            CloningLabelKeyInput = new HiddenInputModel("CloningLabelKey");

            ProjectUidInput  = new SelectInputModel("ProjectUid", "ProjectName", "project", "/Project/SelectData/");
            KeyInput         = new InputModel("Key", "key");
            DescriptionInput = new LongInputModel("Description", "description");

            CloningLabelTranslationCountInput = new HiddenInputModel("CloningLabelTranslationCount", "cloning_label_translation_count");
        }
Exemplo n.º 6
0
        public LabelTranslationCreateModel()
        {
            Title = "label_translation_create_title";

            OrganizationUidInput = new HiddenInputModel("OrganizationUid");

            ProjectInput     = new HiddenInputModel("ProjectUid");
            ProjectNameInput = new HiddenInputModel("ProjectName");

            LabelInput    = new HiddenInputModel("LabelUid");
            LabelKeyInput = new HiddenInputModel("LabelKey");

            LanguageInput = new SelectInputModel("LanguageUid", "LanguageName", "language", "/Language/SelectData");
            LanguageInput.IsOptionTypeContent = true;
            LabelTranslationInput             = new LongInputModel("LabelTranslation", "label_translation", true);
        }
Exemplo n.º 7
0
        public ActionResult SelectFeature(SelectInputModel input)
        {
            MgSiteConnection conn = CreateConnection(input);
            MgMap            map  = new MgMap(conn);

            map.Open(input.MapName);

            MgLayerCollection layers = map.GetLayers();
            int lidx = layers.IndexOf("Parcels");

            if (lidx < 0)
            {
                throw new Exception("Layer not found on map: Parcels");
            }
            MgLayerBase       layer               = layers[lidx];
            MgClassDefinition clsDef              = layer.GetClassDefinition();
            MgPropertyDefinitionCollection props  = clsDef.GetProperties();
            MgPropertyDefinition           idProp = props[0];
            string idPropName           = idProp.Name;
            MgFeatureQueryOptions query = new MgFeatureQueryOptions();

            query.SetFilter(idPropName + " = " + input.id);

            MgFeatureReader   reader    = layer.SelectFeatures(query);
            MgSelection       selection = new MgSelection(map, "");
            MgResourceService resSvc    = (MgResourceService)conn.CreateService(MgServiceType.ResourceService);
            string            result    = "";

            try
            {
                selection.Open(resSvc, input.MapName);
                selection.FromXml(""); //Clear existing
                selection.AddFeatures(layer, reader, 0);
                result = selection.ToXml();
            }
            finally
            {
                reader.Close();
            }

            return(Content(result, MgMimeType.Xml));
        }