示例#1
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < listTextBox.Count - 1; i++)
            {
                for (int j = i + 1; j < listTextBox.Count; j++)
                {
                    if (listTextBox[i].Text != "" && listTextBox[i].Text == listTextBox[j].Text)
                    {
                        DevExpress.XtraEditors.XtraMessageBox.Show("Discriminator is duplicated");
                        listTextBox[i].Focus();
                        return;
                    }
                }
            }

            foreach (AttributeShape att in connector.supertype.attributes)
            {
                if (att.sName == cboSubtypeDis.EditValue.ToString())
                {
                    attDis = att;
                    break;
                }
            }

            foreach (DevExpress.XtraEditors.TextEdit txtDiscriminator in listTextBox)
            {
                Discriminators.Add(txtDiscriminator.Text);
            }

            this.DialogResult = DialogResult.OK;
        }
        private void btnOK_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < listTextBox.Count -1; i++ )
            {
                for (int j = i + 1; j < listTextBox.Count; j++ )
                    if (listTextBox[i].Text != "" && listTextBox[i].Text == listTextBox[j].Text)
                    {
                        DevExpress.XtraEditors.XtraMessageBox.Show("Discriminator is duplicated");
                        listTextBox[i].Focus();
                        return;
                    }
            }

            foreach (AttributeShape att in connector.supertype.attributes)
            {
                if (att.sName == cboSubtypeDis.EditValue.ToString())
                {
                    attDis = att;
                    break;
                }
            }

            foreach (DevExpress.XtraEditors.TextEdit txtDiscriminator in listTextBox)
            {
                Discriminators.Add(txtDiscriminator.Text);
            }

            this.DialogResult = DialogResult.OK;
        }
示例#3
0
        public INotation createNotation()
        {
            AttributeShape attribute = new AttributeShape();
            attribute.sName = this.name;
            attribute.type = this.type;
            attribute.Location = new Point(this.x, this.y);
            attribute.Size = new Size(this.w, this.h);
            attribute.dataType = this.DataType;
            attribute.dataLength = this.Length;
            attribute.allowNull = this.AllowNull;
            attribute.description = this.Description;

            return (INotation)attribute;
        }
示例#4
0
        public INotation createNotation()
        {
            AttributeShape attribute = new AttributeShape();

            attribute.sName       = this.name;
            attribute.type        = this.type;
            attribute.Location    = new Point(this.x, this.y);
            attribute.Size        = new Size(this.w, this.h);
            attribute.dataType    = this.DataType;
            attribute.dataLength  = this.Length;
            attribute.allowNull   = this.AllowNull;
            attribute.description = this.Description;

            return((INotation)attribute);
        }
示例#5
0
 public void addAttribute(AttributeShape att)
 {
     attributes.Add(att);
     att.Entity = this;
     att.Disposed += new EventHandler(att_Disposed);
 }
示例#6
0
 public void addAttribute(AttributeShape att)
 {
     attributes.Add(att);
     att.Disposed += new EventHandler(att_Disposed);
     if (attributes.Count >= 1)
     {
         if (this.cardinalities.Count > 1)
         {
             if (this.cardinalities[0].MaxCardinality == -1 && this.cardinalities[1].MaxCardinality == -1)
             {
                 this.type = RelationshipType.AssociativeEntity;
                 this.sName = this.sName.ToUpper();
                 Invalidate();
             }
         }
     }
 }