Esempio n. 1
0
        public override string GenWinFormDesign(BasicParameter parameter, BaseParameter baseParameter)
        {
            string        strFrmClassName = "Frm" + parameter.ClassName + "TreeDialog";
            List <Bse_UI> lstBseUiEdit    = BseUIManager.GetListUIEdit(parameter.TableName);
            int           lblWidth        = BseUIManager.GetCtlWidth("Label");
            StringBuilder sb = new StringBuilder();

            sb.AppendLine("namespace " + parameter.NameSpace + "");
            sb.AppendLine("{");
            sb.AppendLine("    partial class " + strFrmClassName + "");
            sb.AppendLine("    {");
            sb.AppendLine("        /// <summary>");
            sb.AppendLine("        /// Required designer variable.");
            sb.AppendLine("        /// </summary>");
            sb.AppendLine("        private System.ComponentModel.IContainer components = null;");

            sb.AppendLine("        /// <summary>");
            sb.AppendLine("        /// Clean up any resources being used.");
            sb.AppendLine("        /// </summary>");
            sb.AppendLine(
                "        /// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>");
            sb.AppendLine("        protected override void Dispose(bool disposing)");
            sb.AppendLine("        {");
            sb.AppendLine("            if (disposing && (components != null))");
            sb.AppendLine("            {");
            sb.AppendLine("                components.Dispose();");
            sb.AppendLine("            }");
            sb.AppendLine("            base.Dispose(disposing);");
            sb.AppendLine("        }");

            sb.AppendLine("        #region Windows Form Designer generated code");

            sb.AppendLine("        /// <summary>");
            sb.AppendLine("        /// Required method for Designer support - do not modify");
            sb.AppendLine("        /// the contents of this method with the code editor.");
            sb.AppendLine("        /// </summary>");
            sb.AppendLine("        private void InitializeComponent()");
            sb.AppendLine("        {");
            sb.AppendLine("            this.splitContainer1 = new System.Windows.Forms.SplitContainer();");
            sb.AppendLine("            this.tabControl = new System.Windows.Forms.TabControl();");
            sb.AppendLine("            this.tabPage = new System.Windows.Forms.TabPage();");
            //sb.AppendLine("            this.cbkRemark = new Nikita.WinForm.ExtendControl.CheckedComboBox();");
            //sb.AppendLine("            this.numSortNumber = new System.Windows.Forms.NumericUpDown();");
            //sb.AppendLine("            this.txtRoleName = new System.Windows.Forms.TextBox();");
            //sb.AppendLine("            this.chkisDefault = new System.Windows.Forms.CheckBox();");
            //sb.AppendLine("            this.lblRemark = new System.Windows.Forms.Label();");
            //sb.AppendLine("            this.lblSortNumber = new System.Windows.Forms.Label();");
            //sb.AppendLine("            this.lblRoleName = new System.Windows.Forms.Label();");
            #region 编辑面板控件

            foreach (Bse_UI ui in lstBseUiEdit)
            {
                if (ui.IsAddLable == "True")
                {
                    sb.AppendLine("this." + ui.LabelName + " = new System.Windows.Forms.Label();");
                    sb.AppendLine("            this." + ui.ControlName + " = new " + ui.ControlNameSpace + "();");
                }
                else
                {
                    sb.AppendLine("            this." + ui.ControlName + " = new " + ui.ControlNameSpace + "();");
                }
            }

            #endregion
            sb.AppendLine("            this.dataNavigator = new Nikita.WinForm.ExtendControl.DataNavigator();");
            sb.AppendLine("            this.btnClear = new System.Windows.Forms.Button();");
            sb.AppendLine("            this.btnSave = new System.Windows.Forms.Button();");
            sb.AppendLine("            ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();");
            sb.AppendLine("            this.splitContainer1.Panel1.SuspendLayout();");
            sb.AppendLine("            this.splitContainer1.Panel2.SuspendLayout();");
            sb.AppendLine("            this.splitContainer1.SuspendLayout();");
            sb.AppendLine("            this.tabControl.SuspendLayout();");
            sb.AppendLine("            this.tabPage.SuspendLayout();");
            foreach (Bse_UI ui in lstBseUiEdit)
            {
                if (ui.ControlNameSpace == "System.Windows.Forms.NumericUpDown")
                {
                    sb.AppendLine("       ((System.ComponentModel.ISupportInitialize)(this." + ui.ControlName + ")).BeginInit();");
                }
            }
            sb.AppendLine("            this.SuspendLayout();");

            sb.AppendLine("            // ");
            sb.AppendLine("            // splitContainer1");
            sb.AppendLine("            // ");
            sb.AppendLine("            this.splitContainer1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;");
            sb.AppendLine("            this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;");
            sb.AppendLine("            this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;");
            sb.AppendLine("            this.splitContainer1.Location = new System.Drawing.Point(0, 0);");
            sb.AppendLine("            this.splitContainer1.Name = \"splitContainer1\";");
            sb.AppendLine("            this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;");
            sb.AppendLine("            // ");
            sb.AppendLine("            // splitContainer1.Panel1");
            sb.AppendLine("            // ");
            sb.AppendLine("            this.splitContainer1.Panel1.Controls.Add(this.tabControl);");
            sb.AppendLine("            // ");
            sb.AppendLine("            // splitContainer1.Panel2");
            sb.AppendLine("            // ");
            sb.AppendLine("            this.splitContainer1.Panel2.Controls.Add(this.dataNavigator);");
            sb.AppendLine("            this.splitContainer1.Panel2.Controls.Add(this.btnClear);");
            sb.AppendLine("            this.splitContainer1.Panel2.Controls.Add(this.btnSave);");
            sb.AppendLine("            this.splitContainer1.Size = new System.Drawing.Size(434, 370);");
            sb.AppendLine("            this.splitContainer1.SplitterDistance = 317;");
            sb.AppendLine("            this.splitContainer1.TabIndex = 0;");
            sb.AppendLine("            // ");
            sb.AppendLine("            // tabControl");
            sb.AppendLine("            // ");
            sb.AppendLine("            this.tabControl.Controls.Add(this.tabPage);");
            sb.AppendLine("            this.tabControl.Dock = System.Windows.Forms.DockStyle.Fill;");
            sb.AppendLine("            this.tabControl.Location = new System.Drawing.Point(0, 0);");
            sb.AppendLine("            this.tabControl.Name = \"tabControl\";");
            sb.AppendLine("            this.tabControl.SelectedIndex = 0;");
            sb.AppendLine("            this.tabControl.Size = new System.Drawing.Size(432, 315);");
            sb.AppendLine("            this.tabControl.TabIndex = 1;");
            sb.AppendLine("            // ");
            sb.AppendLine("            // tabPage");
            sb.AppendLine("            // ");
            sb.AppendLine("            this.tabPage.BackColor = System.Drawing.SystemColors.Control;");
            //sb.AppendLine("            this.tabPage.Controls.Add(this.cbkRemark);");
            //sb.AppendLine("            this.tabPage.Controls.Add(this.numSortNumber);");
            //sb.AppendLine("            this.tabPage.Controls.Add(this.txtRoleName);");
            //sb.AppendLine("            this.tabPage.Controls.Add(this.chkisDefault);");
            //sb.AppendLine("            this.tabPage.Controls.Add(this.lblRemark);");
            //sb.AppendLine("            this.tabPage.Controls.Add(this.lblSortNumber);");
            //sb.AppendLine("            this.tabPage.Controls.Add(this.lblRoleName);");
            #region 编辑区控件

            foreach (Bse_UI ui in lstBseUiEdit)
            {
                if (ui.IsAddLable == "True")
                {
                    sb.AppendLine("            this.tabPage.Controls.Add(this." + ui.LabelName + ");");
                }
                sb.AppendLine("            this.tabPage.Controls.Add(this." + ui.ControlName + ");");
            }

            #endregion
            sb.AppendLine("            this.tabPage.Location = new System.Drawing.Point(4, 26);");
            sb.AppendLine("            this.tabPage.Name = \"tabPage\";");
            sb.AppendLine("            this.tabPage.Padding = new System.Windows.Forms.Padding(3);");
            sb.AppendLine("            this.tabPage.Size = new System.Drawing.Size(424, 285);");
            sb.AppendLine("            this.tabPage.TabIndex = 0;");
            sb.AppendLine("            this.tabPage.Text = \"基本信息\";");
            //sb.AppendLine("            // ");
            //sb.AppendLine("            // cbkRemark");
            //sb.AppendLine("            // ");
            //sb.AppendLine("            this.cbkRemark.CheckOnClick = true;");
            //sb.AppendLine("            this.cbkRemark.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawVariable;");
            //sb.AppendLine("            this.cbkRemark.DropDownHeight = 1;");
            //sb.AppendLine("            this.cbkRemark.FormattingEnabled = true;");
            //sb.AppendLine("            this.cbkRemark.IntegralHeight = false;");
            //sb.AppendLine("            this.cbkRemark.Location = new System.Drawing.Point(84, 54);");
            //sb.AppendLine("            this.cbkRemark.Name = "cbkRemark";");
            //sb.AppendLine("            this.cbkRemark.Size = new System.Drawing.Size(100, 24);");
            //sb.AppendLine("            this.cbkRemark.TabIndex = 7;");
            //sb.AppendLine("            this.cbkRemark.Tag = "Remark";");
            //sb.AppendLine("            this.cbkRemark.ValueSeparator = ", ";");
            //sb.AppendLine("            // ");
            //sb.AppendLine("            // numSortNumber");
            //sb.AppendLine("            // ");
            //sb.AppendLine("            this.numSortNumber.Location = new System.Drawing.Point(257, 16);");
            //sb.AppendLine("            this.numSortNumber.Name = "numSortNumber";");
            //sb.AppendLine("            this.numSortNumber.Size = new System.Drawing.Size(102, 23);");
            //sb.AppendLine("            this.numSortNumber.TabIndex = 6;");
            //sb.AppendLine("            this.numSortNumber.Tag = "Sortnum";");
            //sb.AppendLine("            // ");
            //sb.AppendLine("            // txtRoleName");
            //sb.AppendLine("            // ");
            //sb.AppendLine("            this.txtRoleName.Location = new System.Drawing.Point(84, 16);");
            //sb.AppendLine("            this.txtRoleName.Name = "txtRoleName";");
            //sb.AppendLine("            this.txtRoleName.Size = new System.Drawing.Size(100, 23);");
            //sb.AppendLine("            this.txtRoleName.TabIndex = 5;");
            //sb.AppendLine("            this.txtRoleName.Tag = "RoleName";");
            //sb.AppendLine("            // ");
            //sb.AppendLine("            // chkisDefault");
            //sb.AppendLine("            // ");
            //sb.AppendLine("            this.chkisDefault.AutoSize = true;");
            //sb.AppendLine("            this.chkisDefault.Location = new System.Drawing.Point(215, 57);");
            //sb.AppendLine("            this.chkisDefault.Name = "chkisDefault";");
            //sb.AppendLine("            this.chkisDefault.Size = new System.Drawing.Size(75, 21);");
            //sb.AppendLine("            this.chkisDefault.TabIndex = 4;");
            //sb.AppendLine("            this.chkisDefault.Tag = "isDefault";");
            //sb.AppendLine("            this.chkisDefault.Text = "是否默认";");
            //sb.AppendLine("            this.chkisDefault.UseVisualStyleBackColor = true;");
            //sb.AppendLine("            // ");
            //sb.AppendLine("            // lblRemark");
            //sb.AppendLine("            // ");
            //sb.AppendLine("            this.lblRemark.AutoSize = true;");
            //sb.AppendLine("            this.lblRemark.Location = new System.Drawing.Point(27, 61);");
            //sb.AppendLine("            this.lblRemark.Name = "lblRemark";");
            //sb.AppendLine("            this.lblRemark.Size = new System.Drawing.Size(32, 17);");
            //sb.AppendLine("            this.lblRemark.TabIndex = 3;");
            //sb.AppendLine("            this.lblRemark.Text = "备注";");
            //sb.AppendLine("            // ");
            //sb.AppendLine("            // lblSortNumber");
            //sb.AppendLine("            // ");
            //sb.AppendLine("            this.lblSortNumber.AutoSize = true;");
            //sb.AppendLine("            this.lblSortNumber.Location = new System.Drawing.Point(212, 18);");
            //sb.AppendLine("            this.lblSortNumber.Name = "lblSortNumber";");
            //sb.AppendLine("            this.lblSortNumber.Size = new System.Drawing.Size(32, 17);");
            //sb.AppendLine("            this.lblSortNumber.TabIndex = 1;");
            //sb.AppendLine("            this.lblSortNumber.Text = "排序";");
            //sb.AppendLine("            // ");
            //sb.AppendLine("            // lblRoleName");
            //sb.AppendLine("            // ");
            //sb.AppendLine("            this.lblRoleName.AutoSize = true;");
            //sb.AppendLine("            this.lblRoleName.Location = new System.Drawing.Point(18, 19);");
            //sb.AppendLine("            this.lblRoleName.Name = "lblRoleName";");
            //sb.AppendLine("            this.lblRoleName.Size = new System.Drawing.Size(60, 17);");
            //sb.AppendLine("            this.lblRoleName.TabIndex = 0;");
            //sb.AppendLine("            this.lblRoleName.Text = " 角色名称";");
            #region 编辑区控件明细位置

            BeginWidth = 15;
            foreach (Bse_UI ui in lstBseUiEdit)
            {
                int intCurrCtlWidth = BseUIManager.GetCtlWidth(ui.ControlType);
                if (ui.IsAddLable == "True")
                {
                    //控制位置
                    if (BeginWidth + lblWidth + intCurrCtlWidth > SumWidth)
                    {
                        QueryHeight += 1;
                        LocationX    = 15;
                        LocationY    = LocationY + HighSeed;
                        BeginWidth   = 15;
                        BeginWidth  += lblWidth + CtlSpace;
                    }
                    else
                    {
                        LocationX   = BeginWidth;
                        BeginWidth += lblWidth + CtlSpace;
                    }
                    sb.Append(GenControlHelper.CreateLabelControl(ui.LabelName, ui.LabelText, LocationX, LocationY));
                }

                //控制位置
                if (BeginWidth + intCurrCtlWidth > SumWidth)
                {
                    QueryHeight += 1;
                    LocationX    = 15;
                    LocationY    = LocationY + HighSeed;
                    BeginWidth   = 15;
                    BeginWidth  += intCurrCtlWidth + CtlSpace;
                }
                else
                {
                    LocationX   = BeginWidth;
                    BeginWidth += intCurrCtlWidth + CtlSpace;
                }
                sb.Append(GenControlHelper.CreateControl(ui.Ctl_Simple, ui.ControlName, LocationX, LocationY,
                                                         ui.ControlSort));
            }
            int hight = QueryHeight * (HighSeed + 5) + 30;
            if (hight < 87)
            {
                hight = 87;
            }
            sb.Replace("@QueryHeight@", hight.ToString());

            #endregion
            sb.AppendLine("            // ");
            sb.AppendLine("            // dataNavigator");
            sb.AppendLine("            // ");
            sb.AppendLine("            this.dataNavigator.CurrentIndex = 0;");
            sb.AppendLine("            this.dataNavigator.Font = new System.Drawing.Font(\"微软雅黑\", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));");
            sb.AppendLine("            this.dataNavigator.ListInfo = null;");
            sb.AppendLine("            this.dataNavigator.Location = new System.Drawing.Point(5, 4);");
            sb.AppendLine("            this.dataNavigator.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);");
            sb.AppendLine("            this.dataNavigator.Name = \"dataNavigator\";");
            sb.AppendLine("            this.dataNavigator.Size = new System.Drawing.Size(249, 32);");
            sb.AppendLine("            this.dataNavigator.TabIndex = 2;");
            sb.AppendLine("            this.dataNavigator.PositionChanged += new Nikita.WinForm.ExtendControl.DataNavigator.PostionChangedEventHandler(this.dataNavigator_PositionChanged);");
            sb.AppendLine("            // ");
            sb.AppendLine("            // btnClear");
            sb.AppendLine("            // ");
            sb.AppendLine("            this.btnClear.FlatStyle = System.Windows.Forms.FlatStyle.System;");
            sb.AppendLine("            this.btnClear.Location = new System.Drawing.Point(341, 8);");
            sb.AppendLine("            this.btnClear.Name = \"btnClear\";");
            sb.AppendLine("            this.btnClear.Size = new System.Drawing.Size(75, 28);");
            sb.AppendLine("            this.btnClear.TabIndex = 1;");
            sb.AppendLine("            this.btnClear.Text = \"清空\";");
            sb.AppendLine("            this.btnClear.UseVisualStyleBackColor = true;");
            sb.AppendLine("            this.btnClear.Click += new System.EventHandler(this.btnClear_Click);");
            sb.AppendLine("            // ");
            sb.AppendLine("            // btnSave");
            sb.AppendLine("            // ");
            sb.AppendLine("            this.btnSave.FlatStyle = System.Windows.Forms.FlatStyle.System;");
            sb.AppendLine("            this.btnSave.Location = new System.Drawing.Point(261, 8);");
            sb.AppendLine("            this.btnSave.Name = \"btnSave\";");
            sb.AppendLine("            this.btnSave.Size = new System.Drawing.Size(75, 28);");
            sb.AppendLine("            this.btnSave.TabIndex = 0;");
            sb.AppendLine("            this.btnSave.Text = \"保存(&S)\";");
            sb.AppendLine("            this.btnSave.UseVisualStyleBackColor = true;");
            sb.AppendLine("            this.btnSave.Click += new System.EventHandler(this.btnSave_Click);");
            sb.AppendLine("            // ");
            sb.AppendLine("            // " + strFrmClassName + "");
            sb.AppendLine("            // ");
            sb.AppendLine("            this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);");
            sb.AppendLine("            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;");
            sb.AppendLine("            this.ClientSize = new System.Drawing.Size(434, 370);");
            sb.AppendLine("            this.Controls.Add(this.splitContainer1);");
            sb.AppendLine("            this.Font = new System.Drawing.Font(\"微软雅黑\", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));");
            sb.AppendLine("            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;");
            sb.AppendLine("            this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);");
            sb.AppendLine("            this.MaximizeBox = false;");
            sb.AppendLine("            this.MinimizeBox = false;");
            sb.AppendLine("            this.Name = \"" + strFrmClassName + "\";");
            sb.AppendLine("            this.ShowIcon = false;");
            sb.AppendLine("            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;");
            sb.AppendLine("            this.splitContainer1.Panel1.ResumeLayout(false);");
            sb.AppendLine("            this.splitContainer1.Panel2.ResumeLayout(false);");
            sb.AppendLine("            ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();");
            sb.AppendLine("            this.splitContainer1.ResumeLayout(false);");
            sb.AppendLine("            this.tabControl.ResumeLayout(false);");
            sb.AppendLine("            this.tabPage.ResumeLayout(false);");
            sb.AppendLine("            this.tabPage.PerformLayout();");
            foreach (Bse_UI ui in lstBseUiEdit)
            {
                if (ui.ControlNameSpace == "System.Windows.Forms.NumericUpDown")
                {
                    sb.AppendLine("            ((System.ComponentModel.ISupportInitialize)(this." + ui.ControlName + ")).EndInit();");
                }
            }
            sb.AppendLine("            this.ResumeLayout(false);");
            sb.AppendLine("        }");

            sb.AppendLine("        #endregion");

            sb.AppendLine("        private System.Windows.Forms.SplitContainer splitContainer1;");
            sb.AppendLine("        private System.Windows.Forms.TabControl tabControl;");
            sb.AppendLine("        private System.Windows.Forms.TabPage tabPage;");
            sb.AppendLine("        private System.Windows.Forms.Button btnClear;");
            sb.AppendLine("        private System.Windows.Forms.Button btnSave;");
            sb.AppendLine("        private WinForm.ExtendControl.DataNavigator dataNavigator;");
            //sb.AppendLine("        private System.Windows.Forms.Label lblSortNumber;");
            //sb.AppendLine("        private System.Windows.Forms.Label lblRoleName;");
            //sb.AppendLine("        private System.Windows.Forms.Label lblRemark;");
            //sb.AppendLine("        private System.Windows.Forms.CheckBox chkisDefault;");
            //sb.AppendLine("        private System.Windows.Forms.NumericUpDown numSortNumber;");
            //sb.AppendLine("        private System.Windows.Forms.TextBox txtRoleName;");
            //sb.AppendLine("        private WinForm.ExtendControl.CheckedComboBox cbkRemark;");
            #region 编辑区控件
            foreach (Bse_UI uiQuery in lstBseUiEdit)
            {
                if (uiQuery.IsAddLable == "True")
                {
                    sb.Append("        public  System.Windows.Forms.Label " + uiQuery.LabelName + ";\r\n");
                }
                sb.Append("        public " + uiQuery.ControlNameSpace + "  " + uiQuery.ControlName + ";\r\n");
            }
            #endregion
            sb.AppendLine("    }");
            sb.AppendLine("}");
            return(sb.ToString());
        }
Esempio n. 2
0
        public override string GenWinFormDesign(BasicParameter parameter,
                                                BaseParameter baseParameter)
        {
            NestQueryParameter nestQuerySetting = baseParameter as NestQueryParameter;
            string             strFrmClassName  = nestQuerySetting.FormClassName;
            int           lblWidth = BseUIManager.GetCtlWidth("Label");
            StringBuilder sb       = new StringBuilder();

            sb.AppendLine("using System.Collections.Generic;");
            sb.AppendLine("using System;");
            sb.AppendLine("using System.Linq;");
            sb.AppendLine("using System.Drawing;");
            sb.AppendLine("using System.Diagnostics;");
            sb.AppendLine("using System.Threading.Tasks;");
            sb.AppendLine("using System.Data;");
            sb.AppendLine("using System.Xml.Linq;");
            sb.AppendLine("using Microsoft.VisualBasic;");
            sb.AppendLine("using System.Collections;");
            sb.AppendLine("using System.Windows.Forms;");
            sb.AppendLine(" ");
            sb.AppendLine("namespace  " + parameter.NameSpace + "");
            sb.AppendLine("{");
            sb.AppendLine("    partial class  " + strFrmClassName + " : System.Windows.Forms.Form");
            sb.AppendLine("    { ");
            sb.AppendLine("        [System.Diagnostics.DebuggerNonUserCode()]");
            sb.AppendLine("        protected override void Dispose(bool disposing)");
            sb.AppendLine("        {");
            sb.AppendLine("            try");
            sb.AppendLine("            {");
            sb.AppendLine("                if (disposing && components != null)");
            sb.AppendLine("                {");
            sb.AppendLine("                    components.Dispose();");
            sb.AppendLine("                }");
            sb.AppendLine("            }");
            sb.AppendLine("            finally");
            sb.AppendLine("            {");
            sb.AppendLine("                base.Dispose(disposing);");
            sb.AppendLine("            }");
            sb.AppendLine("        }");

            sb.AppendLine("        private System.ComponentModel.Container components = null;");

            sb.AppendLine("        [System.Diagnostics.DebuggerStepThrough()]");
            sb.AppendLine("        private void InitializeComponent()");
            sb.AppendLine("        {");
            sb.AppendLine("            this.splitContainer1 = new System.Windows.Forms.SplitContainer();");
            sb.AppendLine("            this.splitContainer2 = new System.Windows.Forms.SplitContainer();");
            //sb.AppendLine("            this.txtDepartmentName = new System.Windows.Forms.TextBox();");
            //sb.AppendLine("            this.lblQueryDepartmentName = new System.Windows.Forms.Label();");
            #region 查询面板控件

            foreach (DataRow drRow in nestQuerySetting.DataTableQuery.Rows)
            {
                if (drRow["IsAddLable"].ToString() == "True")
                {
                    sb.AppendLine("this." + drRow["LabelName"] + " = new System.Windows.Forms.Label();");
                    sb.AppendLine("            this." + drRow["ControlName"] + " = new " + drRow["ControlNameSpace"] + "();");
                }
                else
                {
                    sb.AppendLine("            this." + drRow["ControlName"] + " = new " + drRow["ControlNameSpace"] + "();");
                }
            }

            #endregion
            sb.AppendLine("            this.btnLoad = new System.Windows.Forms.Button();");
            sb.AppendLine("            this.panelView = new System.Windows.Forms.Panel();");
            sb.AppendLine("            ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();");
            sb.AppendLine("            this.splitContainer1.Panel1.SuspendLayout();");
            sb.AppendLine("            this.splitContainer1.Panel2.SuspendLayout();");
            sb.AppendLine("            this.splitContainer1.SuspendLayout();");
            sb.AppendLine("            ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit();");
            sb.AppendLine("            this.splitContainer2.Panel1.SuspendLayout();");
            sb.AppendLine("            this.splitContainer2.Panel2.SuspendLayout();");
            sb.AppendLine("            this.splitContainer2.SuspendLayout();");
            sb.AppendLine("            this.SuspendLayout();");
            sb.AppendLine("            // ");
            sb.AppendLine("            // splitContainer1");
            sb.AppendLine("            // ");
            sb.AppendLine("            this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;");
            sb.AppendLine("            this.splitContainer1.Location = new System.Drawing.Point(0, 0);");
            sb.AppendLine("            this.splitContainer1.Name = \"splitContainer1\";");
            sb.AppendLine("            this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;");
            sb.AppendLine("            // ");
            sb.AppendLine("            // splitContainer1.Panel1");
            sb.AppendLine("            // ");
            sb.AppendLine("            this.splitContainer1.Panel1.Controls.Add(this.splitContainer2);");
            sb.AppendLine("            // ");
            sb.AppendLine("            // splitContainer1.Panel2");
            sb.AppendLine("            // ");
            sb.AppendLine("            this.splitContainer1.Panel2.Controls.Add(this.panelView);");
            sb.AppendLine("            this.splitContainer1.Size = new System.Drawing.Size(784, 561);");
            sb.AppendLine("            this.splitContainer1.SplitterDistance = 51;");
            sb.AppendLine("            this.splitContainer1.TabIndex = 24;");
            sb.AppendLine("            // ");
            sb.AppendLine("            // splitContainer2");
            sb.AppendLine("            // ");
            sb.AppendLine("            this.splitContainer2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;");
            sb.AppendLine("            this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;");
            sb.AppendLine("            this.splitContainer2.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;");
            sb.AppendLine("            this.splitContainer2.Location = new System.Drawing.Point(0, 0);");
            sb.AppendLine("            this.splitContainer2.Name = \"splitContainer2\";");
            sb.AppendLine("            // ");
            sb.AppendLine("            // splitContainer2.Panel1");
            sb.AppendLine("            // ");
            //sb.AppendLine("            this.splitContainer2.Panel1.Controls.Add(this.txtDepartmentName);");
            //sb.AppendLine("            this.splitContainer2.Panel1.Controls.Add(this.lblQueryDepartmentName);");
            #region 查询区控件

            foreach (DataRow drRow in nestQuerySetting.DataTableQuery.Rows)
            {
                if (drRow["IsAddLable"].ToString() == "True")
                {
                    sb.AppendLine("            this.splitContainer2.Panel1.Controls.Add(this." + drRow["LabelName"] + ");");
                }
                sb.AppendLine("            this.splitContainer2.Panel1.Controls.Add(this." + drRow["ControlName"] + ");");
            }

            #endregion
            sb.AppendLine("            // ");
            sb.AppendLine("            // splitContainer2.Panel2");
            sb.AppendLine("            // ");
            sb.AppendLine("            this.splitContainer2.Panel2.Controls.Add(this.btnLoad);");
            sb.AppendLine("            this.splitContainer2.Size = new System.Drawing.Size(784, 51);");
            sb.AppendLine("            this.splitContainer2.SplitterDistance = 706;");
            sb.AppendLine("            this.splitContainer2.TabIndex = 0;");
            #region 查询区控件明细位置

            BeginWidth = 15;
            foreach (DataRow drRow in nestQuerySetting.DataTableQuery.Rows)
            {
                int intCurrCtlWidth = BseUIManager.GetCtlWidth(drRow["ControlType"].ToString());
                if (drRow["IsAddLable"].ToString() == "True")
                {
                    //控制位置
                    if (BeginWidth + lblWidth + intCurrCtlWidth > SumWidth)
                    {
                        QueryHeight += 1;
                        LocationX    = 15;
                        LocationY    = LocationY + HighSeed;
                        BeginWidth   = 15;
                        BeginWidth  += lblWidth + CtlSpace;
                    }
                    else
                    {
                        LocationX   = BeginWidth;
                        BeginWidth += lblWidth + CtlSpace;
                    }
                    sb.Append(GenControlHelper.CreateLabelControl(drRow["LabelName"].ToString(), drRow["LabelText"].ToString(), LocationX, LocationY));
                }

                //控制位置
                if (BeginWidth + intCurrCtlWidth > SumWidth)
                {
                    QueryHeight += 1;
                    LocationX    = 15;
                    LocationY    = LocationY + HighSeed;
                    BeginWidth   = 15;
                    BeginWidth  += intCurrCtlWidth + CtlSpace;
                }
                else
                {
                    LocationX   = BeginWidth;
                    BeginWidth += intCurrCtlWidth + CtlSpace;
                }
                sb.Append(GenControlHelper.CreateControl(drRow["Ctl_Simple"].ToString(), drRow["ControlName"].ToString(),
                                                         LocationX, LocationY, drRow["ControlSort"].ToString()));
            }
            int hight = QueryHeight * (HighSeed + 5) + 30;
            if (hight < 87)
            {
                hight = 87;
            }
            sb.Replace("@QueryHeight@", hight.ToString());

            #endregion
            //sb.AppendLine("            // ");
            //sb.AppendLine("            // txtDepartmentName");
            //sb.AppendLine("            // ");
            //sb.AppendLine("            this.txtDepartmentName.Location = new System.Drawing.Point(74, 16);");
            //sb.AppendLine("            this.txtDepartmentName.Name = "txtDepartmentName";");
            //sb.AppendLine("            this.txtDepartmentName.Size = new System.Drawing.Size(143, 23);");
            //sb.AppendLine("            this.txtDepartmentName.TabIndex = 1;");
            //sb.AppendLine("            // ");
            //sb.AppendLine("            // lblQueryDepartmentName");
            //sb.AppendLine("            // ");
            //sb.AppendLine("            this.lblQueryDepartmentName.AutoSize = true;");
            //sb.AppendLine("            this.lblQueryDepartmentName.Location = new System.Drawing.Point(12, 19);");
            //sb.AppendLine("            this.lblQueryDepartmentName.Name = "lblQueryDepartmentName";");
            //sb.AppendLine("            this.lblQueryDepartmentName.Size = new System.Drawing.Size(56, 17);");
            //sb.AppendLine("            this.lblQueryDepartmentName.TabIndex = 0;");
            //sb.AppendLine("            this.lblQueryDepartmentName.Text = "部门名称";");
            sb.AppendLine("            // ");
            sb.AppendLine("            // btnLoad");
            sb.AppendLine("            // ");
            sb.AppendLine("            this.btnLoad.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));");
            sb.AppendLine("            this.btnLoad.FlatAppearance.BorderColor = System.Drawing.Color.LightSkyBlue;");
            sb.AppendLine("            this.btnLoad.FlatStyle = System.Windows.Forms.FlatStyle.Flat;");
            sb.AppendLine("            this.btnLoad.Location = new System.Drawing.Point(8, 7);");
            sb.AppendLine("            this.btnLoad.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);");
            sb.AppendLine("            this.btnLoad.Name = \"btnLoad\";");
            sb.AppendLine("            this.btnLoad.Size = new System.Drawing.Size(55, 33);");
            sb.AppendLine("            this.btnLoad.TabIndex = 23;");
            sb.AppendLine("            this.btnLoad.Text = \"查询\";");
            sb.AppendLine("            this.btnLoad.UseVisualStyleBackColor = true;");
            sb.AppendLine("            this.btnLoad.Click += new System.EventHandler(this.btnLoad_Click);");
            sb.AppendLine("            // ");
            sb.AppendLine("            // panelView");
            sb.AppendLine("            // ");
            sb.AppendLine("            this.panelView.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;");
            sb.AppendLine("            this.panelView.Dock = System.Windows.Forms.DockStyle.Fill;");
            sb.AppendLine("            this.panelView.Location = new System.Drawing.Point(0, 0);");
            sb.AppendLine("            this.panelView.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);");
            sb.AppendLine("            this.panelView.Name = \"panelView\";");
            sb.AppendLine("            this.panelView.RightToLeft = System.Windows.Forms.RightToLeft.No;");
            sb.AppendLine("            this.panelView.Size = new System.Drawing.Size(784, 506);");
            sb.AppendLine("            this.panelView.TabIndex = 24;");
            sb.AppendLine("            // ");
            sb.AppendLine("            // FrmNestQuery");
            sb.AppendLine("            // ");
            sb.AppendLine("            this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);");
            sb.AppendLine("            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;");
            sb.AppendLine("            this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(227)))), ((int)(((byte)(241)))), ((int)(((byte)(254)))));");
            sb.AppendLine("            this.ClientSize = new System.Drawing.Size(784, 561);");
            sb.AppendLine("            this.Controls.Add(this.splitContainer1);");
            sb.AppendLine("            this.Font = new System.Drawing.Font(\"微软雅黑\", 9F);");
            sb.AppendLine("            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;");
            sb.AppendLine("            this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);");
            sb.AppendLine("            this.Name = \"" + strFrmClassName + "\";");
            sb.AppendLine("            this.ShowIcon = false;");
            sb.AppendLine("            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;");
            sb.AppendLine("            this.Text = \"Master-Detail\";");
            sb.AppendLine("            this.splitContainer1.Panel1.ResumeLayout(false);");
            sb.AppendLine("            this.splitContainer1.Panel2.ResumeLayout(false);");
            sb.AppendLine("            ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();");
            sb.AppendLine("            this.splitContainer1.ResumeLayout(false);");
            sb.AppendLine("            this.splitContainer2.Panel1.ResumeLayout(false);");
            sb.AppendLine("            this.splitContainer2.Panel1.PerformLayout();");
            sb.AppendLine("            this.splitContainer2.Panel2.ResumeLayout(false);");
            sb.AppendLine("            ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();");
            sb.AppendLine("            this.splitContainer2.ResumeLayout(false);");
            sb.AppendLine("            this.ResumeLayout(false);");
            sb.AppendLine("        }");
            sb.AppendLine("        private SplitContainer splitContainer1;");
            sb.AppendLine("        internal Panel panelView;");
            sb.AppendLine("        private SplitContainer splitContainer2;");
            sb.AppendLine("        internal Button btnLoad;");
            #region 查询区控件
            foreach (DataRow drRow in nestQuerySetting.DataTableQuery.Rows)
            {
                if (drRow["IsAddLable"].ToString() == "True")
                {
                    sb.Append("        public  System.Windows.Forms.Label " + drRow["LabelName"] + ";\r\n");
                }
                sb.Append("        public " + drRow["ControlNameSpace"] + "  " + drRow["ControlName"] + ";\r\n");
            }
            #endregion
            //sb.AppendLine("        private TextBox txtDepartmentName;");
            //sb.AppendLine("        private Label lblQueryDepartmentName;");
            sb.AppendLine("    } ");
            sb.AppendLine("}");

            return(sb.ToString());
        }