Esempio n. 1
0
        //建表脚本-Tables
        public static string CreateTablesScript(string projectID)
        {
            Information.Clear();
            StringBuilder sb = new StringBuilder();

            try
            {
                CodeBuilderService service = ServiceHelper.GetCodeBuilderService();
                ProjectEntity      project = service.GetProjectById(projectID);
                TableEntity[]      tables  = service.GetTableList(projectID);
                for (int i = 0; i < tables.Length; i++)
                {
                    if (i == 0)
                    {
                        sb.Append(CreateTableScript(project, tables[i], true));
                    }
                    else
                    {
                        sb.Append(CreateTableScript(project, tables[i], false));
                    }
                    sb.AppendLine("");
                }
            }
            catch (Exception ex) {
                Information.AddFmt("创建表脚本出错,错误信息:{0}", ex.Message);
            }
            return(sb.ToString());
        }
Esempio n. 2
0
        public static void SetCurrentProject(string projectId)
        {
            ProjectEntity entity = new ProjectEntity();

            if (!string.IsNullOrEmpty(projectId))
            {
                CodeBuilderService service = ServiceHelper.GetCodeBuilderService();
                entity = service.GetProjectById(projectId);
            }
            SetCurrentProject(entity);
        }
Esempio n. 3
0
 private void BindModelTree(string projectid)
 {
     if (!IsReloadTree)
     {
         return;
     }
     if (!string.IsNullOrEmpty(projectid))
     {
         this.treeModel.Nodes.Clear();
         WSH.CodeBuilder.DispatchServers.ProjectEntity project = service.GetProjectById(projectid);
         Global.SetCurrentProject(project);
         TreeNode root = new TreeNode();
         root.Text             = "项目集合";
         root.Tag              = "root";
         root.ContextMenuStrip = this.menuRoot;
         SetNodeImage(root, "root");
         //绑定项目
         TreeNode projectNode = new TreeNode();
         projectNode.Text             = project.ProjectName;
         projectNode.Tag              = project.ID;
         projectNode.ContextMenuStrip = this.menuProject;
         SetNodeImage(projectNode, "project");
         //绑定表集合
         TreeNode tablesNode = new TreeNode();
         tablesNode.Tag = "tables";
         tablesNode.ContextMenuStrip = this.menuTables;
         SetNodeImage(tablesNode, "folder");
         //绑定表
         BindTablesNode(tablesNode, projectid);
         projectNode.Nodes.Add(tablesNode);
         ////绑定视图集合
         //TreeNode viewsNode = new TreeNode();
         //viewsNode.Text = "Views";
         //viewsNode.Tag = "views";
         //SetNodeImage(viewsNode, "folder");
         //projectNode.Nodes.Add(viewsNode);
         ////绑定存储过程集合
         //TreeNode procsNode = new TreeNode();
         //procsNode.Text = "Procs";
         //procsNode.Tag = "procs";
         //SetNodeImage(procsNode, "folder");
         //projectNode.Nodes.Add(procsNode);
         root.Nodes.Add(projectNode);
         this.treeModel.Nodes.Add(root);
         //展开树
         this.treeModel.ExpandAll();
     }
 }
Esempio n. 4
0
        public override void BindData()
        {
            ProjectEntity entity = service.GetProjectById(this.RecordID);

            this.txtProjectName.Text = entity.ProjectName;
            this.txtNameSpace.Text   = entity.NameSpace;
            this.txtAttr.Text        = entity.Attr;
            this.txtRemark.Text      = entity.Remark;
            if (entity.TemplateID > -1)
            {
                this.cboTemplate.SelectedValue = entity.TemplateID;
            }
            if (entity.ConnectionID > -1)
            {
                ConnectionEntity conn = service.GetConnectionById(entity.ConnectionID.ToString());
                this.selectConnection.Text  = conn.ConnectionName;
                this.selectConnection.Value = conn.ID.ToString();
            }
        }