/// <summary>
        /// 生成Code
        /// </summary>
        private void CreateCode()
        {
            TreeNode dbNode     = node.Parent.Parent;
            TreeNode serverNode = Form1.form_Database.GetRoot(node);

            if (dbNode == null || serverNode == null)
            {
                return;
            }
            List <Model.BuilderMethods> methods = new List <Model.BuilderMethods>(); //生成的函数集合

            if (checkBox_add.Checked)
            {
                methods.Add(Model.BuilderMethods.Add);
            }
            if (checkBox_count.Checked)
            {
                methods.Add(Model.BuilderMethods.Count);
            }
            if (checkBox_delete.Checked)
            {
                methods.Add(Model.BuilderMethods.Delete);
            }
            if (checkBox_exists.Checked)
            {
                methods.Add(Model.BuilderMethods.Exists);
            }
            if (checkBox_getall.Checked)
            {
                methods.Add(Model.BuilderMethods.SelectAll);
            }
            if (checkBox_getbykey.Checked)
            {
                methods.Add(Model.BuilderMethods.SelectByKey);
            }
            if (checkBox_update.Checked)
            {
                methods.Add(Model.BuilderMethods.Update);
            }

            Model.Servers       server     = (Model.Servers)((Model.TreeNodeTag)serverNode.Tag).Tag;
            Business.CreateCode CreateCode = new Business.CreateCode(server.Type);
            Model.CodeCreate    param      = new Model.CodeCreate();
            param.ClassName   = this.textBox2.Text.IsNullOrEmpty() ? ((Model.TreeNodeTag)node.Tag).Tag.ToString() : this.textBox2.Text.Trim();
            param.DbName      = ((Model.TreeNodeTag)dbNode.Tag).Tag.ToString();
            param.NameSpace   = "";
            param.NameSpace1  = "";
            param.ServerID    = server.ID;
            param.TableName   = ((Model.TreeNodeTag)node.Tag).Tag.ToString();
            param.BuilderType = this.radioButton1.Checked ? Model.BuilderType.Default : Model.BuilderType.Factory;
            param.MethodList  = methods;
            param.CNSC        = new Common.Config_NameSpaceClass().GetDefault();

            Form_Code_Area fca_model = new Form_Code_Area(CreateCode.GetModelClass(param), string.Format("实体类({0})", param.TableName));

            fca_model.Show(Form1.Instance.dockPanel1);


            Form_Code_Area fca_data = new Form_Code_Area(CreateCode.GetDataClass(param), string.Format("数据类({0})", param.TableName));

            fca_data.Show(Form1.Instance.dockPanel1);


            Form_Code_Area fca_business = new Form_Code_Area(CreateCode.GetBusinessClass(param), string.Format("业务类({0})", param.TableName));

            fca_business.Show(Form1.Instance.dockPanel1);


            if (param.BuilderType == Model.BuilderType.Factory)
            {
                Form_Code_Area fca_interface = new Form_Code_Area(CreateCode.GetInterfaceClass(param), string.Format("接口类({0})", param.TableName));
                fca_interface.Show(Form1.Instance.dockPanel1);


                Form_Code_Area fca_factory = new Form_Code_Area(CreateCode.GetFactoryClass(param), string.Format("工厂类({0})", param.TableName));
                fca_factory.Show(Form1.Instance.dockPanel1);
            }
            this.Close();
        }
        /// <summary>
        /// 生成Code
        /// </summary>
        private void CreateCode()
        {
            TreeNode dbNode = node.Parent.Parent;
            TreeNode serverNode = Form1.form_Database.GetRoot(node);
            if (dbNode == null || serverNode == null)
            {
                return;
            }
            List<Model.BuilderMethods> methods = new List<Model.BuilderMethods>(); //生成的函数集合
            if (checkBox_add.Checked) methods.Add(Model.BuilderMethods.Add);
            if (checkBox_count.Checked) methods.Add(Model.BuilderMethods.Count);
            if (checkBox_delete.Checked) methods.Add(Model.BuilderMethods.Delete);
            if (checkBox_exists.Checked) methods.Add(Model.BuilderMethods.Exists);
            if (checkBox_getall.Checked) methods.Add(Model.BuilderMethods.SelectAll);
            if (checkBox_getbykey.Checked) methods.Add(Model.BuilderMethods.SelectByKey);
            if (checkBox_update.Checked) methods.Add(Model.BuilderMethods.Update);

            Model.Servers server = (Model.Servers)((Model.TreeNodeTag)serverNode.Tag).Tag;
            Business.CreateCode CreateCode = new Business.CreateCode(server.Type);
            Model.CodeCreate param = new Model.CodeCreate();
            param.ClassName = this.textBox2.Text.IsNullOrEmpty() ? ((Model.TreeNodeTag)node.Tag).Tag.ToString() : this.textBox2.Text.Trim();
            param.DbName = ((Model.TreeNodeTag)dbNode.Tag).Tag.ToString();
            param.NameSpace = "";
            param.NameSpace1 = "";
            param.ServerID = server.ID;
            param.TableName = ((Model.TreeNodeTag)node.Tag).Tag.ToString();
            param.BuilderType = this.radioButton1.Checked ? Model.BuilderType.Default : Model.BuilderType.Factory;
            param.MethodList = methods;
            param.CNSC = new Common.Config_NameSpaceClass().GetDefault();

            Form_Code_Area fca_model = new Form_Code_Area(CreateCode.GetModelClass(param), string.Format("实体类({0})", param.TableName));
            fca_model.Show(Form1.Instance.dockPanel1);

            Form_Code_Area fca_data = new Form_Code_Area(CreateCode.GetDataClass(param), string.Format("数据类({0})", param.TableName));
            fca_data.Show(Form1.Instance.dockPanel1);

            Form_Code_Area fca_business = new Form_Code_Area(CreateCode.GetBusinessClass(param), string.Format("业务类({0})", param.TableName));
            fca_business.Show(Form1.Instance.dockPanel1);

            if (param.BuilderType == Model.BuilderType.Factory)
            {
                Form_Code_Area fca_interface = new Form_Code_Area(CreateCode.GetInterfaceClass(param), string.Format("接口类({0})", param.TableName));
                fca_interface.Show(Form1.Instance.dockPanel1);

                Form_Code_Area fca_factory = new Form_Code_Area(CreateCode.GetFactoryClass(param), string.Format("工厂类({0})", param.TableName));
                fca_factory.Show(Form1.Instance.dockPanel1);

            }
            this.Close();
        }