Пример #1
0
        public void BuildConstraint()
        {
            var key = WizardSQLHelper.GetPrimaryKeyName(Join.NomTable);

            //var param = new string[] { View.Schema, Join.NomTable, View.NomTable, Join.ChampDeRef, View.Schema, key };
            //WizardHelper.ExecuteFromFile("addConstraint.sql", param, Program.AppSet.ConnectionString);
            WizardSQLHelper.addConstraint(View.Schema, Join.NomTable, View.NomTable, Join.ChampDeRef, View.Schema, key, _own);
        }
Пример #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Button_end(object sender, PageEventArgs e)
        {
            if (radAuto.Checked)
            {
                foreach (TabloidConfigJointure Tj in lstAutoJoin.SelectedItems)
                {
                    Tools.AddWithUniqueName(_view.Jointures, Tj, "J", _parentJoin == null ? null : _parentJoin.Jointures);
                }
            }
            else
            {
                var newTable = cmbTable.SelectedItem.ToString();
                var dbKey    = WizardSQLHelper.GetPrimaryKeyName(newTable);

                if (dbKey == null)
                {
                    MetroMessageBox.Show(this, Properties.Resources.CantFindPrimaryKey, Properties.Resources.Erreur, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }


                var is1N = cmbTypeJointure.SelectedItem.ToString() == "1:N";

                var Tj = new TabloidConfigJointure
                {
                    NomTable    = newTable,
                    Relation    = cmbTypeJointure.SelectedItem.ToString(),
                    DbKey       = dbKey,
                    Parent      = _parentJoin,
                    ChampDeRef  = is1N ? getJoinParentView().NomTable + "." + cmbChampRef.SelectedItem : cmbChampRef.SelectedItem.ToString(),
                    ChampDeRef2 = is1N ? cmbChampRef2.SelectedItem.ToString() : "",
                };

                if (cmbOrder.SelectedIndex > 0)
                {
                    Tj.Order = cmbOrder.SelectedItem + " " + (cmbOrderType.SelectedIndex == 0 ? "asc" : "desc");
                }


                Tj.Visu = WizardSQLHelper.GetVisibiliteFromCheckedListBox(lstVisibilites);

                Tools.AddWithUniqueName(_view.Jointures, Tj, "J", _parentJoin == null ? null : _parentJoin.Jointures);
            }
        }