Ejemplo n.º 1
0
        public static string GetCorePropertiesHash(this EntityHasEntities relation)
        {
            try
            {
                var prehash =
                    relation.SourceEntity.Name.ToLower() + "|" +
                    relation.TargetEntity.Name.ToLower() + " | ";

                var columnList = relation.FieldMapList().Where(x => x.GetTargetField(relation) != null && x.GetSourceField(relation) != null).ToList();
                columnList = columnList.OrderBy(x => x.GetTargetField(relation).Name.ToLower()).ToList();
                prehash   += string.Join("-|-", columnList.Select(x => x.GetTargetField(relation).Name.ToLower())) + "~";
                prehash   += string.Join("-|-", columnList.Select(x => x.GetSourceField(relation).Name.ToLower())) + "~";

                return(prehash);
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Ejemplo n.º 2
0
        public RelationshipDialog(nHydrateModel model, Microsoft.VisualStudio.Modeling.Store store, EntityHasEntities connector, bool allowConfigure)
            : this()
        {
            try
            {
                _connector         = connector;
                _model             = model;
                _store             = store;
                _allowConfigure    = allowConfigure;
                chkEnforce.Visible = !model.UseModules;

                //Load the Form
                var parent = connector.ParentEntity;
                lblPrimaryTable.Text = parent.Name;

                if (!allowConfigure)
                {
                    lblSecondaryTable.Text = connector.ChildEntity.Name;
                }

                LoadRelation();

                if (_allowConfigure)
                {
                    cboChildTable.Items.Clear();
                    foreach (var entity in _model.Entities.OrderBy(x => x.Name))
                    {
                        cboChildTable.Items.Add(entity.Name);
                    }

                    lblSecondaryTable.Visible = false;
                    cboChildTable.Visible     = true;
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Ejemplo n.º 3
0
 public RelationshipDialog(nHydrateModel model, Microsoft.VisualStudio.Modeling.Store store, EntityHasEntities connector)
     : this(model, store, connector, false)
 {
 }