private void PropertieslinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     using (FindPropertyForm form = new FindPropertyForm())
     {
         form.FrontendApplication     = FrontendApplication;
         form.BackendApplication      = BackendApplication;
         form.BusinessEntity          = businessEntity;
         form.CanShowCustomProperties = true;
         form.ShowDialog();
     }
 }
Esempio n. 2
0
        private void mapExistingBtn_Click(object sender, EventArgs e)
        {
            if (propertyListView.SelectedItems.Count > 0)
            {
                using (FindPropertyForm findPropertyForm = new FindPropertyForm())
                {
                    MappedProperty mappedProperty = propertyListView.SelectedItems[0].Tag as MappedProperty;

                    findPropertyForm.BackendApplication       = BackendApplication;
                    findPropertyForm.CanShowCustomProperties  = true;
                    findPropertyForm.HideServicMethodSearch   = true;
                    findPropertyForm.CanMultiSelectProperties = false;
                    findPropertyForm.DefaultBusinessEntity    = BusinessEntity;
                    findPropertyForm.AutoSearchColumn         = mappedProperty.Source.Name;

                    if (findPropertyForm.ShowDialog() == DialogResult.OK)
                    {
                        Cdc.MetaManager.DataAccess.Domain.Property property = findPropertyForm.SelectedProperty;

                        mappedProperty.Target = property;

                        UpdateResponseProperty(mappedProperty);

                        DbProperty dbProp = mappedProperty.Source as DbProperty;

                        if (property.StorageInfo != null)
                        {
                            dbProp.DbDatatype = property.StorageInfo.StorageType;
                            dbProp.Length     = property.StorageInfo.Length;
                            dbProp.Scale      = property.StorageInfo.Scale;
                            dbProp.Precision  = property.StorageInfo.Precision;
                        }

                        propertyListView.SelectedItems[0].SubItems[3].Text = mappedProperty.Target.Name;
                        propertyListView.SelectedItems[0].SubItems[4].Text = mappedProperty.Target.Type.ToString();
                        detailGrid.SelectedObject = mappedProperty;

                        // Update the colors
                        UpdateListViewColors();
                    }
                }
            }
        }
        private void tsbAdd_Click(object sender, EventArgs e)
        {
            using (FindPropertyForm findProperty = new FindPropertyForm())
            {
                findProperty.CanMultiSelectProperties = true;
                findProperty.CanShowCustomProperties  = false;
                findProperty.CanCreateProperties      = true;
                findProperty.FrontendApplication      = FrontendApplication;
                findProperty.BackendApplication       = BackendApplication;

                if (findProperty.ShowDialog() == DialogResult.OK)
                {
                    AddPropertiesToPropertyMap(findProperty.SelectedPropertyList);

                    ShowProperties();
                    ChangesMade = true;
                }
            }
        }
Esempio n. 4
0
        private bool AddCustomMappedPropertyToMap(PropertyMap map)
        {
            bool retVal = false;

            using (FindPropertyForm form = new FindPropertyForm())
            {
                form.FrontendApplication      = FrontendApplication;
                form.BackendApplication       = BackendApplication;
                form.CanShowCustomProperties  = true;
                form.CanMultiSelectProperties = true;

                if (form.ShowDialog() == DialogResult.OK)
                {
                    foreach (Property property in form.SelectedPropertyList)
                    {
                        MappedProperty newProperty = new MappedProperty();

                        int sequence = 1;

                        if (map.MappedProperties.Count > 0)
                        {
                            sequence = map.MappedProperties.Max(p => p.Sequence) + 1;
                        }

                        newProperty.IsCustom    = true;
                        newProperty.Target      = property;
                        newProperty.PropertyMap = map;
                        newProperty.Sequence    = sequence;

                        map.MappedProperties.Add(newProperty);

                        AddedMappedProperties.Add(newProperty);

                        retVal = true;
                    }
                }
            }

            return(retVal);
        }
        private void addPropertyBtn_Click(object sender, EventArgs e)
        {
            using (FindPropertyForm form = new FindPropertyForm())
            {
                form.CanShowCustomProperties  = true;
                form.CanMultiSelectProperties = true;
                form.FrontendApplication      = FrontendApplication;
                form.BackendApplication       = BackendApplication;
                form.Owner = this;

                if (form.ShowDialog() == DialogResult.OK)
                {
                    foreach (Property property in form.SelectedPropertyList)
                    {
                        MappedProperty newProperty = new MappedProperty();

                        int sequence = 0;

                        if (propertyMapControl.PropertyMap.MappedProperties.Count > 0)
                        {
                            sequence = propertyMapControl.PropertyMap.MappedProperties.Max(p => p.Sequence) + 1;
                        }

                        newProperty.IsCustom    = true;
                        newProperty.Target      = property;
                        newProperty.PropertyMap = propertyMapControl.PropertyMap;
                        newProperty.Sequence    = sequence;

                        propertyMapControl.PropertyMap.MappedProperties.Add(newProperty);

                        AddedMappedProperties.Add(newProperty);
                    }
                }

                propertyMapControl.Map();
            }
        }