private void OK_Click(object sender, EventArgs e) { entité.Texte = nomEntité.Text; entité.Champs.Clear(); // si on modifie, pour ne pas ajouter des champs en plus for (int i = 0; i < ChampsEntité.RowCount; i++) { Champ nouvChamp = new Champ(); if (ChampsEntité.Rows[i].Cells[1].Value != null) { switch (ChampsEntité.Rows[i].Cells[1].Value.ToString()) { //nouvChamp.Type = Type.GetType("System."+ ChampsEntité.Rows[i].Cells[1].Value.ToString()); case "Byte": nouvChamp.Type = typeof(Byte); break; case "Byte[]": nouvChamp.Type = typeof(Byte[]); break; case "Decimal": nouvChamp.Type = typeof(Decimal); break; case "Date Time": nouvChamp.Type = typeof(DateTime); break; case "Int16": nouvChamp.Type = typeof(Int16); break; case "Int32": nouvChamp.Type = typeof(Int32); break; case "Single": nouvChamp.Type = typeof(Single); break; case "String": nouvChamp.Type = typeof(String); break; } } if (ChampsEntité.Rows[i].Cells[2].Value != null) nouvChamp.Taille = Convert.ToInt32(ChampsEntité.Rows[i].Cells[2].Value.ToString()); if (ChampsEntité.Rows[i].Cells[3].Value != null) nouvChamp.CléPrimaire = (bool)ChampsEntité.Rows[i].Cells[3].Value; if (ChampsEntité.Rows[i].Cells[4].Value != null) nouvChamp.Auto = (bool)ChampsEntité.Rows[i].Cells[4].Value; if (ChampsEntité.Rows[i].Cells[5].Value != null) nouvChamp.NotNull = (bool)ChampsEntité.Rows[i].Cells[5].Value; if (ChampsEntité.Rows[i].Cells[6].Value != null) nouvChamp.IndexChamp = Convert.ToInt32(ChampsEntité.Rows[i].Cells[6].Value.ToString()); if (ChampsEntité.Rows[i].Cells[0].Value != null) { nouvChamp.Nom = ChampsEntité.Rows[i].Cells[0].Value.ToString(); entité.Champs.Add(nouvChamp); } } Close(); }
public Entité() : base() { texte = "Entité"; Champ ID = new Champ("ID", typeof(Int16), 0, true, false, true, 1); champs.Add(ID); }
public Entité(Point location, Size size, Color couleurBordure, int épaisseur) : base(location, size, couleurBordure, épaisseur) { texte = "Entité"; Champ ID = new Champ("ID", typeof(Int16), 0, true, false, true, 1); champs.Add(ID); }
public Relation() : base() { Champ ID = new Champ("ID", typeof(Int16), 0, true, false, true, 1); champs.Add(ID); policeChamp = new Font("Arial", 10); }
private void OK_Click(object sender, EventArgs e) { association.Texte = nomAssociation.Text; association.Champs.Clear(); // si on modifie, pour ne pas ajouter des champs en plus if (CardinalitéSource.Text != null) association.LienSource.Cardinalité = CardinalitéSource.Text; if (CardinalitéDestination.Text != null) association.LienDestination.Cardinalité = CardinalitéDestination.Text; for (int i = 0; i < champsAssociation.RowCount; i++) { Champ nouvChamp = new Champ(); if (champsAssociation.Rows[i].Cells[1].Value != null) { switch (champsAssociation.Rows[i].Cells[1].Value.ToString()) { //nouvChamp.Type = Type.GetType("System."+ ChampsEntité.Rows[i].Cells[1].Value.ToString()); case "Byte": nouvChamp.Type = typeof(Byte); break; case "Byte[]": nouvChamp.Type = typeof(Byte[]); break; case "Decimal": nouvChamp.Type = typeof(Decimal); break; case "Date Time": nouvChamp.Type = typeof(DateTime); break; case "Int16": nouvChamp.Type = typeof(Int16); break; case "Int32": nouvChamp.Type = typeof(Int32); break; case "Single": nouvChamp.Type = typeof(Single); break; case "String": nouvChamp.Type = typeof(String); break; } } if (champsAssociation.Rows[i].Cells[2].Value != null) nouvChamp.Taille = Convert.ToInt32(champsAssociation.Rows[i].Cells[2].Value.ToString()); if (champsAssociation.Rows[i].Cells[3].Value != null) nouvChamp.NotNull = (bool)champsAssociation.Rows[i].Cells[3].Value; if (champsAssociation.Rows[i].Cells[0].Value != null) { nouvChamp.Nom = champsAssociation.Rows[i].Cells[0].Value.ToString(); association.Champs.Add(nouvChamp); } } Close(); }
public Relation(Point location, Size size, Color couleurBordure, int épaisseur) : base(location, size, couleurBordure, épaisseur) { Champ ID = new Champ("ID", typeof(Int16), 0, true, false, true, 1); champs.Add(ID); texte = "Relation"; policeChamp = new Font("Arial", 10); }
public Contrainte(Noeud sour, Noeud dest, Color c, int e, Champ cS, Champ cD) : base(sour, dest, c, e) { champSource = cS; champDestination = cD; }
private void OK_Click(object sender, EventArgs e) { relation.Texte = NomRelation.Text; relation.Champs.Clear(); // si on modifie, pour ne pas ajouter des champs en plus for (int i = 0; i < GridChamps.RowCount; i++) { Champ nouvChamp = new Champ(); if (GridChamps.Rows[i].Cells[1].Value != null) { switch (GridChamps.Rows[i].Cells[1].Value.ToString()) { //nouvChamp.Type = Type.GetType("System."+ GridChamps.Rows[i].Cells[1].Value.ToString()); case "Byte": nouvChamp.Type = typeof(Byte); break; case "Byte[]": nouvChamp.Type = typeof(Byte[]); break; case "Decimal": nouvChamp.Type = typeof(Decimal); break; case "Date Time": nouvChamp.Type = typeof(DateTime); break; case "Int16": nouvChamp.Type = typeof(Int16); break; case "Int32": nouvChamp.Type = typeof(Int32); break; case "Single": nouvChamp.Type = typeof(Single); break; case "String": nouvChamp.Type = typeof(String); break; } } if (GridChamps.Rows[i].Cells[2].Value != null) { nouvChamp.Taille = Convert.ToInt32(GridChamps.Rows[i].Cells[2].Value.ToString()); } if (GridChamps.Rows[i].Cells[3].Value != null) { nouvChamp.CléPrimaire = (bool)GridChamps.Rows[i].Cells[3].Value; } if (GridChamps.Rows[i].Cells[4].Value != null) { nouvChamp.Auto = (bool)GridChamps.Rows[i].Cells[4].Value; } if (GridChamps.Rows[i].Cells[5].Value != null) { nouvChamp.NotNull = (bool)GridChamps.Rows[i].Cells[5].Value; } if (GridChamps.Rows[i].Cells[6].Value != null) { nouvChamp.IndexChamp = Convert.ToInt32(GridChamps.Rows[i].Cells[6].Value.ToString()); } if (GridChamps.Rows[i].Cells[0].Value != null) { nouvChamp.Nom = GridChamps.Rows[i].Cells[0].Value.ToString(); relation.Champs.Add(nouvChamp); } } Close(); }
private void OK_Click(object sender, EventArgs e) { association.Texte = nomAssociation.Text; association.Champs.Clear(); // si on modifie, pour ne pas ajouter des champs en plus if (CardinalitéSource.Text != null) { association.LienSource.Cardinalité = CardinalitéSource.Text; } if (CardinalitéDestination.Text != null) { association.LienDestination.Cardinalité = CardinalitéDestination.Text; } for (int i = 0; i < champsAssociation.RowCount; i++) { Champ nouvChamp = new Champ(); if (champsAssociation.Rows[i].Cells[1].Value != null) { switch (champsAssociation.Rows[i].Cells[1].Value.ToString()) { //nouvChamp.Type = Type.GetType("System."+ ChampsEntité.Rows[i].Cells[1].Value.ToString()); case "Byte": nouvChamp.Type = typeof(Byte); break; case "Byte[]": nouvChamp.Type = typeof(Byte[]); break; case "Decimal": nouvChamp.Type = typeof(Decimal); break; case "Date Time": nouvChamp.Type = typeof(DateTime); break; case "Int16": nouvChamp.Type = typeof(Int16); break; case "Int32": nouvChamp.Type = typeof(Int32); break; case "Single": nouvChamp.Type = typeof(Single); break; case "String": nouvChamp.Type = typeof(String); break; } } if (champsAssociation.Rows[i].Cells[2].Value != null) { nouvChamp.Taille = Convert.ToInt32(champsAssociation.Rows[i].Cells[2].Value.ToString()); } if (champsAssociation.Rows[i].Cells[3].Value != null) { nouvChamp.NotNull = (bool)champsAssociation.Rows[i].Cells[3].Value; } if (champsAssociation.Rows[i].Cells[0].Value != null) { nouvChamp.Nom = champsAssociation.Rows[i].Cells[0].Value.ToString(); association.Champs.Add(nouvChamp); } } Close(); }