Beispiel #1
0
        private void btnNewField_Click(object sender, EventArgs e)
        {
            if (radioButtonEntity.Checked)
            {
                System.Windows.Forms.TreeNode Node = tvRelation.SelectedNode;
                if (Node != null)
                {
                    TWCFDetailItem DetailItem = (TWCFDetailItem)Node.Tag;
                    MWizard.fmSelWCFTableField F = new fmSelWCFTableField();
                    //COLDEF
                    List<COLDEFInfo> colDefObjects = null;

                    colDefObjects = WzdUtils.GetColumnDefination(FClientData.AssemblyName, FClientData.CommandName, DetailItem.EntityName, cbEEPAlias.Text);

                    if (F.ShowSelTableFieldForm(DetailItem, lvSelectedFields, RearrangeRefValButton, btnRefVal_Click, colDefObjects, FClientData.AssemblyName, FClientData.CommandName))
                    {
                        btnDeleteField.Enabled = lvSelectedFields.Items.Count > 0;
                    }
                }
            }
            else if (radioButtonInfoCommand.Checked)
            {
                System.Windows.Forms.TreeNode Node = tvRelation.SelectedNode;
                if (Node != null)
                {
                    TDetailItem DetailItem = (TDetailItem)Node.Tag;
                    MWizard.fmSelTableField F = new fmSelTableField();
                    if (F.ShowSelTableFieldForm(DetailItem, GetFieldNames, lvSelectedFields, InternalConnection, RearrangeRefValButton, btnRefVal_Click, FClientData.DatabaseType))
                    {
                        btnDeleteField.Enabled = lvSelectedFields.Items.Count > 0;
                    }
                }
            }
        }
Beispiel #2
0
 private void btnAddNext_Click(object sender, EventArgs e)
 {
     TreeNode node1 = tvTables.SelectedNode;
     if (node1 != null)
     {
         String TableName = "";
         MWizard.fmSelWCFTableField F = new fmSelWCFTableField();
         if (F.ShowSelTableFieldForm(System.IO.Path.GetDirectoryName(GlobalProject.FullName),
                                                                 GlobalProject.Name, ref TableName))
         {
             TreeNode node2 = new TreeNode();
             node2.Text = TableName;
             node2.Name = TableName;
             node1.Nodes.Add(node2);
             AddDatasetNode(node2);
             tvTables.SelectedNode = node2;
             GetFieldNames(TableName, lvSelectedFields);
         }
     }
 }
Beispiel #3
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            //foreach (ProjectItem pi in this.GlobalProject.ProjectItems)
            //{
            //    if (pi.Name.EndsWith("edmx"))
            //    {
            //        Window FDesignWindow = pi.Open("{7651A703-06E5-11D1-8EBD-00A0C90F26EA}");
            //        FDesignWindow.Activate();
            //        HTMLWindow W = (HTMLWindow)FDesignWindow.Object;
            //    }
            //}

            TreeNode Node = tvTables.SelectedNode;
            string TableName = "";
            if (Node != null)
                TableName = Node.Text;

            MWizard.fmSelWCFTableField F = new fmSelWCFTableField();
            if (F.ShowSelTableFieldForm(System.IO.Path.GetDirectoryName(GlobalProject.FullName),
                                                                    GlobalProject.Name, ref TableName))
            {
                Node = tvTables.Nodes.Add(TableName);
                Node.Name = TableName;
                AddDatasetNode(Node);
                tvTables.SelectedNode = Node;
                GetFieldNames(TableName, lvSelectedFields);
            }
        }
Beispiel #4
0
 //private void GetCaptionFromCOLDEF(string DatabaseName, string TableName, TStringList FieldCaptionList)
 //{
 //    InfoCommand aInfoCommand = new InfoCommand(FServerData.DatabaseType);
 //    aInfoCommand.Connection = InternalConnection;
 //    TableName = WzdUtils.RemoveQuote(TableName, FServerData.DatabaseType);
 //    aInfoCommand.CommandText = "Select FIELD_NAME,CAPTION from COLDEF where TABLE_NAME = '" + TableName + "'";
 //    IDbDataAdapter DA = DBUtils.CreateDbDataAdapter(aInfoCommand);
 //    DataSet D = new DataSet();
 //    WzdUtils.FillDataAdapter(FServerData.DatabaseType, DA, D, "COLDEF");
 //    FieldCaptionList.Clear();
 //    int I;
 //    DataRow DR;
 //    for (I = 0; I < D.Tables[0].Rows.Count; I++)
 //    {
 //        DR = D.Tables[0].Rows[I];
 //        if (DR["FIELD_NAME"].ToString() != "")
 //            FieldCaptionList.Add(DR["FIELD_NAME"] + "=" + DR["CAPTION"]);
 //    }
 //}
 private void btnAddField_Click(object sender, EventArgs e)
 {
     TreeNode Node = tvTables.SelectedNode;
     TWCFDatasetItem DatasetItem = (TWCFDatasetItem)Node.Tag;
     if (Node != null)
     {
         MWizard.fmSelWCFTableField F = new fmSelWCFTableField();
         if (F.ShowSelTableFieldForm(System.IO.Path.GetDirectoryName(GlobalProject.FullName),
                                     GlobalProject.Name, Node.Text, lvSelectedFields, DatasetItem))
         {
             btnDeleteField.Enabled = lvSelectedFields.Items.Count > 0;
         }
     }
 }