Beispiel #1
0
 protected void Page_PreRender(object sender, EventArgs e)
 {
     this.labelname = BasePage.RequestString("name");
     if (!string.IsNullOrEmpty(this.labelname))
     {
         string path = WebConfigurationManager.AppSettings["EasyOne:LabelXsltPath"];
         this.xmlfilepath = HttpContext.Current.Server.MapPath(path) + @"\" + this.labelname + ".config";
         this.Dbtype      = XmlManage.ReadFileNode(this.xmlfilepath, "root/LabelDataType");
         string      presstr  = XmlManage.ReadFileNode(this.xmlfilepath, "root/LabelDataSource");
         string      str3     = XmlManage.ReadFileNode(this.xmlfilepath, "root/LabelSqlString");
         string      istr     = string.Empty;
         XmlDocument document = new XmlDocument();
         document.Load(this.xmlfilepath);
         XmlNodeList attriblist = document.SelectNodes("root/attributes");
         presstr = this.ParaProc(attriblist, presstr);
         str3    = this.ParaProc(attriblist, str3).Replace("@pagesize", "10").Replace("@startrow", "0");
         if ((string.Compare(this.Dbtype, "xml_read", StringComparison.OrdinalIgnoreCase) != 0) && string.IsNullOrEmpty(str3))
         {
             base.Response.Write("查询语句为空!");
         }
         else
         {
             istr = LabelManage.GetDBQuery(this.Dbtype, presstr, str3, attriblist);
             this.XmlProc(this.Dbtype, presstr, istr);
         }
     }
     else
     {
         base.Response.Write("标签名称为空!");
     }
 }
        protected void SetInit(string xmlpath)
        {
            this.TxtLabelType.Text  = XmlManage.ReadFileNode(xmlpath, "root/LabelType");
            this.TxtLabelIntro.Text = XmlManage.ReadFileNode(xmlpath, "root/LabelIntro");
            string strB = XmlManage.ReadFileNode(xmlpath, "root/LabelDataType");
            string str2 = XmlManage.ReadFileNode(xmlpath, "root/OutType");

            for (int i = 0; i < this.RbtDataType.Items.Count; i++)
            {
                if ((string.Compare(this.RbtDataType.Items[i].Value, strB, StringComparison.OrdinalIgnoreCase) == 0) && !this.RbtDataType.Items[i].Selected)
                {
                    this.RbtDataType.Items[i].Selected = true;
                    break;
                }
            }
            for (int j = 0; j < this.RBLOutType.Items.Count; j++)
            {
                if ((string.Compare(this.RBLOutType.Items[j].Value, str2, StringComparison.OrdinalIgnoreCase) == 0) && !this.RBLOutType.Items[j].Selected)
                {
                    this.RBLOutType.Items[j].Selected = true;
                    break;
                }
            }
            if ((string.Compare(strB, "static", StringComparison.Ordinal) == 0) || (string.Compare(strB, "sql_sysquery", StringComparison.Ordinal) == 0))
            {
                this.PanelOutSide.Visible = false;
            }
            else if (this.PanelOutSide.Visible)
            {
                if (string.Compare(strB, "ole_read", StringComparison.Ordinal) == 0)
                {
                    string str3 = XmlManage.ReadFileNode(xmlpath, "root/LabelDbPath");
                    if (string.IsNullOrEmpty(str3))
                    {
                        this.TxtDataSource.Text = XmlManage.ReadFileNode(xmlpath, "root/LabelDataSource");
                    }
                    else
                    {
                        this.TxtDataSource.Text = str3;
                    }
                }
                else if (string.Compare(strB, "sql_sysstoredquery", StringComparison.Ordinal) == 0)
                {
                    this.TxtDataSource.Text        = XmlManage.ReadFileNode(xmlpath, "root/LabelSqlString");
                    this.BtnTestDataSource.Visible = false;
                }
                else
                {
                    this.TxtDataSource.Text = XmlManage.ReadFileNode(xmlpath, "root/LabelDataSource");
                }
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     this.action         = BasePage.RequestString("action");
     this.labelname      = BasePage.RequestString("name");
     this.m_LabelLibPath = "~/" + SiteConfig.SiteOption.LabelDir;
     if (string.IsNullOrEmpty(this.labelname))
     {
         BasePage.ResponseRedirect("Label.aspx");
     }
     else
     {
         string path = WebConfigurationManager.AppSettings["EasyOne:LabelXsltPath"];
         this.xmlfilepath = HttpContext.Current.Server.MapPath(path) + @"\" + this.labelname + ".config";
         if (!base.IsPostBack)
         {
             if (LabelManage.GetAttributeList(this.xmlfilepath).Count == 0)
             {
                 this.attlist.Text = "您尚未建立属性!<a href=\"LabelProperty.aspx?action=" + this.action + "&name=" + this.labelname + "\">建立属性</a>";
             }
             else
             {
                 foreach (LabelAttributeInfo info in LabelManage.GetAttributeList(this.xmlfilepath))
                 {
                     string text = this.attlist.Text;
                     this.attlist.Text = text + "<div onclick=\"cit()\" outype=\"2\" class=\"spanfixdiv\" alt=\"" + info.Intro + "&#10默认值:" + info.DefaultValue + "\">" + info.AttributeName + "</div>";
                 }
             }
             if (!string.IsNullOrEmpty(XmlManage.ReadFileNode(this.xmlfilepath, "root/LabelTemplate")))
             {
                 this.TxtTemplate.Text = XmlManage.ReadFileNode(this.xmlfilepath, "root/LabelTemplate");
             }
             ListItem item = new ListItem();
             item.Text = "全部分类";
             this.DropLabelList.DataSource     = LabelManage.GetLabelTypeList();
             this.DropLabelList.DataTextField  = "Name";
             this.DropLabelList.DataValueField = "Name";
             this.DropLabelList.DataBind();
             this.DropLabelList.Items.Insert(0, item);
             this.BuildLabelList(string.Empty);
             this.TxtTemplateTest.Text = "{PE.Label id=\"" + this.labelname + "\" /}";
         }
         this.TxtTemplate.Attributes.Add("onmouseup", "dragend(this)");
         this.TxtTemplate.Attributes.Add("onClick", "savePos(this)");
         this.TxtTemplate.Attributes.Add("onmousemove", "DragPos(this)");
     }
     this.SmpNavigator.AdditionalNode = this.labelname;
 }
Beispiel #4
0
        protected static DataTable GetDataBaseSchema(string dtype, string xpath, string tablename)
        {
            switch (dtype)
            {
            case "sql_sysquery":
                return(LabelManage.GetSchemaTable(tablename, string.Empty, DataSourceType.None));

            case "sql_outquery":
                return(LabelManage.GetSchemaTable(tablename, XmlManage.ReadFileNode(xpath, "root/LabelDataSource"), DataSourceType.Sql));

            case "ole_read":
                return(LabelManage.GetSchemaTable(tablename, XmlManage.ReadFileNode(xpath, "root/LabelDataSource"), DataSourceType.Ole));

            case "odbc_read":
                return(LabelManage.GetSchemaTable(tablename, XmlManage.ReadFileNode(xpath, "root/LabelDataSource"), DataSourceType.Odbc));

            case "orc_read":
                return(LabelManage.GetSchemaTable(tablename, XmlManage.ReadFileNode(xpath, "root/LabelDataSource"), DataSourceType.Oracle));
            }
            return(null);
        }
        protected void BtnNext_Click(object sender, EventArgs e)
        {
            string str  = XmlManage.ReadFileNode(this.xmlfilepath, "root/OutType");
            string str2 = XmlManage.ReadFileNode(this.xmlfilepath, "root/LabelDataType");

            if (str2 != null)
            {
                if (!(str2 == "static"))
                {
                    if (str2 == "sql_sysstoredquery")
                    {
                        BasePage.ResponseRedirect("LabelTemplate.aspx?action=" + this.action + "&name=" + base.Server.UrlEncode(this.m_LabelName));
                        return;
                    }
                    if (str2 == "xml_read")
                    {
                        BasePage.ResponseRedirect("LabelTemplate.aspx?action=" + this.action + "&name=" + base.Server.UrlEncode(this.m_LabelName));
                        return;
                    }
                }
                else
                {
                    switch (str)
                    {
                    case "txt":
                    case "xml":
                        BasePage.ResponseRedirect("LabelTemplateStatic.aspx?action=" + this.action + "&name=" + base.Server.UrlEncode(this.m_LabelName));
                        return;

                    default:
                        BasePage.ResponseRedirect("LabelTemplateStatic.aspx?action=" + this.action + "&name=" + base.Server.UrlEncode(this.m_LabelName));
                        return;
                    }
                }
            }
            BasePage.ResponseRedirect("LabelSqlBuild.aspx?action=" + this.action + "&name=" + base.Server.UrlEncode(this.m_LabelName));
        }
Beispiel #6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     this.action         = BasePage.RequestString("action");
     this.m_LabelName    = BasePage.RequestString("name");
     this.m_LabelLibPath = "~/" + SiteConfig.SiteOption.LabelDir;
     if (string.IsNullOrEmpty(this.m_LabelName))
     {
         BasePage.ResponseRedirect("Label.aspx");
     }
     else
     {
         string path = WebConfigurationManager.AppSettings["EasyOne:LabelXsltPath"];
         this.xmlfilepath = HttpContext.Current.Server.MapPath(path) + @"\" + this.m_LabelName + ".config";
         this.Dbtype      = XmlManage.ReadFileNode(this.xmlfilepath, "root/LabelDataType");
         string      presstr  = XmlManage.ReadFileNode(this.xmlfilepath, "root/LabelDataSource");
         string      str3     = XmlManage.ReadFileNode(this.xmlfilepath, "root/LabelSqlString");
         string      istr     = string.Empty;
         XmlDocument document = new XmlDocument();
         document.Load(this.xmlfilepath);
         XmlNodeList attriblist = document.SelectNodes("root/attributes");
         presstr = this.ParaProc(attriblist, presstr);
         str3    = this.ParaProc(attriblist, str3).Replace("@pagesize", "10").Replace("@startrow", "0");
         if (((string.Compare(this.Dbtype, "static", StringComparison.Ordinal) == 0) && (string.Compare(this.Dbtype, "xml_read", StringComparison.Ordinal) == 0)) && string.IsNullOrEmpty(str3))
         {
             this.ShowXml.Text = "查询语句为空!";
             return;
         }
         if (((string.Compare(this.Dbtype, "static", StringComparison.Ordinal) != 0) && (string.Compare(this.Dbtype, "sql_sysquery", StringComparison.Ordinal) != 0)) && ((string.Compare(this.Dbtype, "sql_sysstoredquery", StringComparison.Ordinal) != 0) && string.IsNullOrEmpty(presstr)))
         {
             this.ShowXml.Text = "数据源地址为空!";
             return;
         }
         istr = LabelManage.GetDBQuery(this.Dbtype, presstr, str3, attriblist);
         XmlDocument document2 = (XmlDocument)this.XmlProc(this.Dbtype, presstr, istr);
         if (!string.IsNullOrEmpty(document2.OuterXml))
         {
             this.rootnode     = document2.DocumentElement;
             this.ShowXml.Text = this.GetXmlScheam(2).ToString();
         }
         else
         {
             document2.LoadXml("<root></root>");
             this.rootnode     = document2.DocumentElement;
             this.ShowXml.Text = this.GetXmlScheam(2).ToString();
         }
         if (LabelManage.GetAttributeList(this.xmlfilepath).Count == 0)
         {
             this.attlist.Text = "您尚未添加参数!<a href=\"LabelProperty.aspx?action=" + this.action + "&name=" + this.m_LabelName + "\">添加参数</a>";
         }
         else
         {
             foreach (LabelAttributeInfo info in LabelManage.GetAttributeList(this.xmlfilepath))
             {
                 string text = this.attlist.Text;
                 this.attlist.Text = text + "<div onclick=\"cit()\" outype=\"3\" class=\"spanfixdiv\" alt=\"" + info.Intro + "&#10默认值:" + info.DefaultValue + "\">" + info.AttributeName + "</div>";
             }
         }
         this.TxtTemplate.Attributes.Add("onmouseup", "dragend(this)");
         this.TxtTemplate.Attributes.Add("onClick", "savePos(this)");
         this.TxtTemplate.Attributes.Add("onmousemove", "DragPos(this)");
         if (!base.IsPostBack)
         {
             string filename = HttpContext.Current.Server.MapPath("~/") + @"\Temp\DefaultLabelTemplate.xsl";
             if (string.Compare(this.action, "modify", StringComparison.OrdinalIgnoreCase) == 0)
             {
                 this.TxtTemplate.Text = XmlManage.ReadFileNode(this.xmlfilepath, "root/LabelTemplate").Replace("><", ">\n<");
             }
             else
             {
                 XmlDocument document3 = new XmlDocument();
                 document3.Load(filename);
                 this.TxtTemplate.Text = document3.OuterXml.Replace("><", ">\n<");
             }
             this.TxtTemplateTest.Text = "{PE.Label id=\"" + this.m_LabelName + "\" /}";
         }
     }
     this.SmpNavigator.AdditionalNode = this.m_LabelName;
 }
Beispiel #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.action         = BasePage.RequestString("action");
            this.m_LabelName    = BasePage.RequestString("name");
            this.m_LabelLibPath = "~/" + SiteConfig.SiteOption.LabelDir;
            if (string.IsNullOrEmpty(this.m_LabelName))
            {
                BasePage.ResponseRedirect("Label.aspx");
            }
            string path = WebConfigurationManager.AppSettings["EasyOne:LabelXsltPath"];

            this.xmlfilepath = HttpContext.Current.Server.MapPath(path) + @"\" + this.m_LabelName + ".config";
            if (string.Compare(this.action, "modify", StringComparison.OrdinalIgnoreCase) == 0)
            {
                this.BtnSave.Visible = true;
            }
            this.Dbtype = XmlManage.ReadFileNode(this.xmlfilepath, "root/LabelDataType");
            if (!base.IsPostBack)
            {
                string    str2;
                DataRow[] rowArray;
                this.TxtSqlstr.Text = XmlManage.ReadFileNode(this.xmlfilepath, "root/LabelSqlString");
                DataTable table = new DataTable();
                if ((string.Compare("sql_sysquery", this.Dbtype, StringComparison.OrdinalIgnoreCase) == 0) || (string.Compare("sql_outquery", this.Dbtype, StringComparison.OrdinalIgnoreCase) == 0))
                {
                    if (DataConverter.CBoolean(XmlManage.ReadFileNode(this.xmlfilepath, "root/UsePage")))
                    {
                        this.ChkPage.Checked   = true;
                        this.CountShow.Visible = true;
                        this.TxtSqlCount.Text  = XmlManage.ReadFileNode(this.xmlfilepath, "root/LabelSqlCount");
                    }
                    if (string.Compare("sql_sysquery", this.Dbtype, StringComparison.OrdinalIgnoreCase) == 0)
                    {
                        rowArray = LabelManage.GetSystemSchemaDataBases().Select("", " TABLE_NAME ");
                        table    = LabelManage.GetSystemSchemaDataBases().Clone();
                        table.Rows.Clear();
                        foreach (DataRow row in rowArray)
                        {
                            table.ImportRow(row);
                        }
                    }
                    else
                    {
                        str2     = XmlManage.ReadFileNode(this.xmlfilepath, "root/LabelDataSource");
                        rowArray = LabelManage.GetSchemaDataBase(str2, DataSourceType.Sql).Select("", " TABLE_NAME ");
                        table    = LabelManage.GetSchemaDataBase(str2, DataSourceType.Sql).Clone();
                        table.Rows.Clear();
                        foreach (DataRow row2 in rowArray)
                        {
                            table.ImportRow(row2);
                        }
                    }
                }
                else if (string.Compare(this.Dbtype, "ole_read", StringComparison.OrdinalIgnoreCase) == 0)
                {
                    if (DataConverter.CBoolean(XmlManage.ReadFileNode(this.xmlfilepath, "root/UsePage")))
                    {
                        this.ChkPage.Checked   = true;
                        this.CountShow.Visible = true;
                        this.PageShow.Visible  = true;
                        this.TxtSqlCount.Text  = XmlManage.ReadFileNode(this.xmlfilepath, "root/LabelSqlCount");
                        this.TxtSqlPage.Text   = XmlManage.ReadFileNode(this.xmlfilepath, "root/LabelSqlPage");
                    }
                    str2     = XmlManage.ReadFileNode(this.xmlfilepath, "root/LabelDataSource");
                    rowArray = LabelManage.GetSchemaDataBase(str2, DataSourceType.Ole).Select("", " TABLE_NAME ");
                    table    = LabelManage.GetSchemaDataBase(str2, DataSourceType.Ole).Clone();
                    table.Rows.Clear();
                    foreach (DataRow row3 in rowArray)
                    {
                        table.ImportRow(row3);
                    }
                }
                else if (string.Compare(this.Dbtype, "odbc_read", StringComparison.OrdinalIgnoreCase) == 0)
                {
                    if (DataConverter.CBoolean(XmlManage.ReadFileNode(this.xmlfilepath, "root/UsePage")))
                    {
                        this.ChkPage.Checked   = true;
                        this.CountShow.Visible = true;
                        this.PageShow.Visible  = true;
                        this.TxtSqlCount.Text  = XmlManage.ReadFileNode(this.xmlfilepath, "root/LabelSqlCount");
                        this.TxtSqlPage.Text   = XmlManage.ReadFileNode(this.xmlfilepath, "root/LabelSqlPage");
                    }
                    str2     = XmlManage.ReadFileNode(this.xmlfilepath, "root/LabelDataSource");
                    rowArray = LabelManage.GetSchemaDataBase(str2, DataSourceType.Odbc).Select("", " TABLE_NAME ");
                    table    = LabelManage.GetSchemaDataBase(str2, DataSourceType.Odbc).Clone();
                    table.Rows.Clear();
                    foreach (DataRow row4 in rowArray)
                    {
                        table.ImportRow(row4);
                    }
                }
                else if (string.Compare(this.Dbtype, "orc_read", StringComparison.OrdinalIgnoreCase) == 0)
                {
                    if (DataConverter.CBoolean(XmlManage.ReadFileNode(this.xmlfilepath, "root/UsePage")))
                    {
                        this.ChkPage.Checked   = true;
                        this.CountShow.Visible = true;
                        this.TxtSqlCount.Text  = XmlManage.ReadFileNode(this.xmlfilepath, "root/LabelSqlCount");
                    }
                    str2     = XmlManage.ReadFileNode(this.xmlfilepath, "root/LabelDataSource");
                    rowArray = LabelManage.GetSchemaDataBase(str2, DataSourceType.Oracle).Select("", " TABLE_NAME ");
                    table    = LabelManage.GetSchemaDataBase(str2, DataSourceType.Oracle).Clone();
                    table.Rows.Clear();
                    foreach (DataRow row5 in rowArray)
                    {
                        table.ImportRow(row5);
                    }
                }
                this.DbTableDownList.DataSource     = table;
                this.DbTableDownList.DataTextField  = "TABLE_NAME";
                this.DbTableDownList.DataValueField = "TABLE_NAME";
                this.DbTableDownList.DataBind();
                ListItem item = new ListItem();
                item.Text = "请选择一个表";
                this.DbTableDownList.Items.Insert(0, item);
                this.DbTableDownList2.DataSource     = table;
                this.DbTableDownList2.DataTextField  = "TABLE_NAME";
                this.DbTableDownList2.DataValueField = "TABLE_NAME";
                this.DbTableDownList2.DataBind();
                item.Text = "请选择一个表";
                this.DbTableDownList2.Items.Insert(0, item);
                if (LabelManage.GetAttributeList(this.xmlfilepath).Count == 0)
                {
                    this.attlist.Text = "您尚未添加参数!<a href=\"LabelProperty.aspx?action=" + this.action + "&name=" + this.m_LabelName + "\">添加参数</a>";
                }
                else
                {
                    foreach (LabelAttributeInfo info in LabelManage.GetAttributeList(this.xmlfilepath))
                    {
                        this.attlist.Text = this.attlist.Text + "<div onmousedown=\"dragstart();\" class=\"spanfixdiv\">" + info.AttributeName + "</div>";
                    }
                }
            }
            base.Form.Attributes.Add("onmouseup", "dragclear()");
            base.Form.Attributes.Add("onmousemove", "dragmove()");
            this.TxtSqlstr.Attributes.Add("onmouseup", "dragend(1);");
            this.TxtSqlstr.Attributes.Add("onmousemove", "movePoint();;");
            this.TxtSqlPage.Attributes.Add("onmouseup", "dragend(1);");
            this.TxtSqlPage.Attributes.Add("onmousemove", "movePoint();;");
            this.TxtSqlCount.Attributes.Add("onmouseup", "dragend(1);");
            this.TxtSqlCount.Attributes.Add("onmousemove", "movePoint();;");
            this.SmpNavigator.AdditionalNode = this.m_LabelName;
        }
Beispiel #8
0
 protected void DBTableDownList2_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (this.DbTableDownList2.SelectedIndex <= 0)
     {
         this.Span1.Visible = false;
     }
     else
     {
         DataTable table  = new DataTable();
         string    dbtype = this.Dbtype;
         if (dbtype != null)
         {
             if (!(dbtype == "sql_sysquery"))
             {
                 if (dbtype == "sql_outquery")
                 {
                     table = LabelManage.GetSchemaTable(this.DbTableDownList2.SelectedValue, XmlManage.ReadFileNode(this.xmlfilepath, "root/LabelDataSource"), DataSourceType.Sql);
                 }
                 else if (dbtype == "ole_read")
                 {
                     table = LabelManage.GetSchemaTable(this.DbTableDownList2.SelectedValue, XmlManage.ReadFileNode(this.xmlfilepath, "root/LabelDataSource"), DataSourceType.Ole);
                 }
                 else if (dbtype == "odbc_read")
                 {
                     table = LabelManage.GetSchemaTable(this.DbTableDownList2.SelectedValue, XmlManage.ReadFileNode(this.xmlfilepath, "root/LabelDataSource"), DataSourceType.Odbc);
                 }
                 else if (dbtype == "orc_read")
                 {
                     table = LabelManage.GetSchemaTable(this.DbTableDownList2.SelectedValue, XmlManage.ReadFileNode(this.xmlfilepath, "root/LabelDataSource"), DataSourceType.Oracle);
                 }
             }
             else
             {
                 table = LabelManage.GetSchemaTable(this.DbTableDownList2.SelectedValue, string.Empty, DataSourceType.None);
             }
         }
         this.DbFieldDownList2.DataSource     = table;
         this.DbFieldList2.DataSource         = table;
         this.DbFieldDownList2.DataTextField  = "ColumnName";
         this.DbFieldDownList2.DataValueField = "ColumnName";
         this.DbFieldDownList2.DataBind();
         this.DbFieldList2.DataTextField  = "ColumnName";
         this.DbFieldList2.DataValueField = "ColumnName";
         this.DbFieldList2.DataBind();
         this.Span1.Visible = true;
     }
 }
Beispiel #9
0
 protected void BtnSqlbilud_Click(object sender, EventArgs e)
 {
     this.query      = new SelectQueryBuilder();
     this.querycount = new SelectQueryBuilder();
     if (this.DbTableDownList.SelectedIndex > 0)
     {
         bool flag  = true;
         bool flag2 = true;
         bool flag3 = false;
         bool flag4 = false;
         if (string.Compare(this.Dbtype, "orc_read", StringComparison.OrdinalIgnoreCase) == 0)
         {
             flag3 = true;
         }
         else if ((string.Compare(this.Dbtype, "odbc_read", StringComparison.OrdinalIgnoreCase) == 0) && Regex.IsMatch(XmlManage.ReadFileNode(this.xmlfilepath, "root/LabelType"), "mysql", RegexOptions.IgnoreCase))
         {
             flag4 = true;
         }
         string input = XmlManage.ReadFileNode(this.xmlfilepath, "root/LabelDbPath");
         if ((string.Compare(this.Dbtype, "ole_read", StringComparison.OrdinalIgnoreCase) == 0) && Regex.IsMatch(input, "xls", RegexOptions.IgnoreCase))
         {
             this.query.SelectFromTable("[" + this.DbTableDownList.SelectedValue + "]");
             this.querycount.SelectFromTable("[" + this.DbTableDownList.SelectedValue + "]");
         }
         else
         {
             this.query.SelectFromTable(this.DbTableDownList.SelectedValue);
             this.querycount.SelectFromTable(this.DbTableDownList.SelectedValue);
         }
         StringBuilder builder = new StringBuilder();
         if ((this.DbTableDownList2.SelectedIndex <= 0) || (this.DbTableDownList.SelectedIndex == this.DbTableDownList2.SelectedIndex))
         {
             for (int i = 0; i < this.DbFieldDownList.Items.Count; i++)
             {
                 if (this.DbFieldDownList.Items[i].Selected)
                 {
                     builder.Append(this.DbFieldDownList.Items[i].Value + ",");
                     flag = false;
                 }
             }
             if (flag)
             {
                 this.query.SelectAllColumns();
             }
             else
             {
                 this.query.SelectColumns(builder.ToString().Split(new char[] { ',' }));
             }
             this.querycount.SelectColumn("count(*)");
             this.QueryProc(-1);
         }
         else
         {
             string selectedValue = this.Dbtj.SelectedValue;
             if (selectedValue != null)
             {
                 if (!(selectedValue == "InnerJoin"))
                 {
                     if (selectedValue == "LeftJoin")
                     {
                         if (this.Dbys.SelectedValue == "=")
                         {
                             this.query.AddJoin(JoinType.LeftJoin, this.DbTableDownList2.SelectedValue, this.DbFieldList2.SelectedValue, Comparison.Equals, this.DbTableDownList.SelectedValue, this.DbFieldList.SelectedValue);
                             this.querycount.AddJoin(JoinType.LeftJoin, this.DbTableDownList2.SelectedValue, this.DbFieldList2.SelectedValue, Comparison.Equals, this.DbTableDownList.SelectedValue, this.DbFieldList.SelectedValue);
                         }
                         else
                         {
                             this.query.AddJoin(JoinType.LeftJoin, this.DbTableDownList2.SelectedValue, this.DbFieldList2.SelectedValue, Comparison.Like, this.DbTableDownList.SelectedValue, this.DbFieldList.SelectedValue);
                             this.querycount.AddJoin(JoinType.LeftJoin, this.DbTableDownList2.SelectedValue, this.DbFieldList2.SelectedValue, Comparison.Like, this.DbTableDownList.SelectedValue, this.DbFieldList.SelectedValue);
                         }
                     }
                     else if (selectedValue == "OuterJoin")
                     {
                         if (this.Dbys.SelectedValue == "=")
                         {
                             this.query.AddJoin(JoinType.OuterJoin, this.DbTableDownList2.SelectedValue, this.DbFieldList2.SelectedValue, Comparison.Equals, this.DbTableDownList.SelectedValue, this.DbFieldList.SelectedValue);
                             this.querycount.AddJoin(JoinType.OuterJoin, this.DbTableDownList2.SelectedValue, this.DbFieldList2.SelectedValue, Comparison.Equals, this.DbTableDownList.SelectedValue, this.DbFieldList.SelectedValue);
                         }
                         else
                         {
                             this.query.AddJoin(JoinType.OuterJoin, this.DbTableDownList2.SelectedValue, this.DbFieldList2.SelectedValue, Comparison.Like, this.DbTableDownList.SelectedValue, this.DbFieldList.SelectedValue);
                             this.querycount.AddJoin(JoinType.OuterJoin, this.DbTableDownList2.SelectedValue, this.DbFieldList2.SelectedValue, Comparison.Like, this.DbTableDownList.SelectedValue, this.DbFieldList.SelectedValue);
                         }
                     }
                     else if (selectedValue == "RightJoin")
                     {
                         if (this.Dbys.SelectedValue == "=")
                         {
                             this.query.AddJoin(JoinType.RightJoin, this.DbTableDownList2.SelectedValue, this.DbFieldList2.SelectedValue, Comparison.Equals, this.DbTableDownList.SelectedValue, this.DbFieldList.SelectedValue);
                             this.querycount.AddJoin(JoinType.RightJoin, this.DbTableDownList2.SelectedValue, this.DbFieldList2.SelectedValue, Comparison.Equals, this.DbTableDownList.SelectedValue, this.DbFieldList.SelectedValue);
                         }
                         else
                         {
                             this.query.AddJoin(JoinType.RightJoin, this.DbTableDownList2.SelectedValue, this.DbFieldList2.SelectedValue, Comparison.Like, this.DbTableDownList.SelectedValue, this.DbFieldList.SelectedValue);
                             this.querycount.AddJoin(JoinType.RightJoin, this.DbTableDownList2.SelectedValue, this.DbFieldList2.SelectedValue, Comparison.Like, this.DbTableDownList.SelectedValue, this.DbFieldList.SelectedValue);
                         }
                     }
                 }
                 else if (this.Dbys.SelectedValue == "=")
                 {
                     this.query.AddJoin(JoinType.InnerJoin, this.DbTableDownList2.SelectedValue, this.DbFieldList2.SelectedValue, Comparison.Equals, this.DbTableDownList.SelectedValue, this.DbFieldList.SelectedValue);
                     this.querycount.AddJoin(JoinType.InnerJoin, this.DbTableDownList2.SelectedValue, this.DbFieldList2.SelectedValue, Comparison.Equals, this.DbTableDownList.SelectedValue, this.DbFieldList.SelectedValue);
                 }
                 else
                 {
                     this.query.AddJoin(JoinType.InnerJoin, this.DbTableDownList2.SelectedValue, this.DbFieldList2.SelectedValue, Comparison.Like, this.DbTableDownList.SelectedValue, this.DbFieldList.SelectedValue);
                     this.querycount.AddJoin(JoinType.InnerJoin, this.DbTableDownList2.SelectedValue, this.DbFieldList2.SelectedValue, Comparison.Like, this.DbTableDownList.SelectedValue, this.DbFieldList.SelectedValue);
                 }
             }
             int irlist = 0;
             for (int j = 0; j < this.DbFieldDownList.Items.Count; j++)
             {
                 if (this.DbFieldDownList.Items[j].Selected)
                 {
                     builder.Append(this.DbTableDownList.SelectedValue + "." + this.DbFieldDownList.Items[j].Value + ",");
                     flag = false;
                     irlist++;
                 }
             }
             if (flag)
             {
                 irlist = this.DbFieldDownList.Items.Count;
                 builder.Append(this.DbTableDownList.SelectedValue + ".*,");
             }
             for (int k = 0; k < this.DbFieldDownList2.Items.Count; k++)
             {
                 if (this.DbFieldDownList2.Items[k].Selected)
                 {
                     builder.Append(this.DbTableDownList2.SelectedValue + "." + this.DbFieldDownList2.Items[k].Value + ",");
                     flag2 = false;
                 }
             }
             if (flag2)
             {
                 builder.Append(this.DbTableDownList2.SelectedValue + ".*");
             }
             this.query.SelectColumns(builder.ToString().Split(new char[] { ',' }));
             this.querycount.SelectColumn("count(*)");
             this.QueryProc(irlist);
         }
         if (flag3)
         {
             this.query.AddWhere("rownum", Comparison.LessOrEquals, DataConverter.CLng(this.TxtOutNum.Text), 0);
         }
         else if (!flag4)
         {
             this.query.TopRecords = DataConverter.CLng(this.TxtOutNum.Text);
         }
         if (flag4)
         {
             this.TxtSqlstr.Text = this.query.BuildQuery();
             if (DataConverter.CLng(this.TxtOutNum.Text) > 0)
             {
                 this.TxtSqlstr.Text = this.TxtSqlstr.Text + " limit " + this.TxtOutNum.Text;
             }
         }
         else
         {
             this.TxtSqlstr.Text = this.query.BuildQuery();
         }
         if ((string.Compare(this.Dbtype.Split(new char[] { '_' })[0], "sql", StringComparison.Ordinal) != 0) && !flag3)
         {
             this.TxtSqlPage.Text = this.query.BuildQuery();
         }
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            this.m_LabelName    = BasePage.RequestString("name").Trim();
            this.m_LabelLibPath = "~/" + SiteConfig.SiteOption.LabelDir;
            this.InitDropLabelType();
            this.DropLabelType.Attributes.Add("onChange", "addclass('" + this.DropLabelType.ClientID + "','" + this.TxtLabelType.ClientID + "')");
            if (!this.Page.IsPostBack)
            {
                if (string.IsNullOrEmpty(this.m_LabelName))
                {
                    this.TxtLabelName.Text = this.m_LabelName;
                    if (!string.IsNullOrEmpty(this.TxtLabelName.Text))
                    {
                        string path    = WebConfigurationManager.AppSettings["EasyOne:LabelXsltPath"];
                        string xmlpath = HttpContext.Current.Server.MapPath(path) + @"\" + this.TxtLabelName.Text + ".config";
                        this.SetInit(xmlpath);
                    }
                    else
                    {
                        this.PanelOutSide.Visible = false;
                    }
                }
                else
                {
                    this.TxtLabelName.Text         = this.m_LabelName;
                    this.ViewState["oldlabelname"] = this.m_LabelName;
                    string str  = WebConfigurationManager.AppSettings["EasyOne:LabelXsltPath"];
                    string str2 = HttpContext.Current.Server.MapPath(str) + @"\" + this.m_LabelName + ".config";
                    string str3 = HttpContext.Current.Server.MapPath(this.m_LabelLibPath) + @"\" + this.m_LabelName + ".config";
                    if (File.Exists(str3))
                    {
                        if (File.Exists(str2))
                        {
                            File.Delete(str2);
                        }
                        File.Copy(str3, str2, true);
                    }
                    this.SetInit(str2);
                    string str4 = XmlManage.ReadFileNode(str2, "root/OutType");
                    this.BtnSave.Visible  = true;
                    this.LinkJump.Visible = true;
                    ListItem item = new ListItem();
                    item.Text = "跳转到";
                    this.LinkJump.Items.Add(item);
                    this.LinkJump.AutoPostBack = true;
                    ListItem item2 = new ListItem();
                    item2.Text  = "设置标签参数";
                    item2.Value = "LabelProperty.aspx?action=modify&name=" + base.Server.UrlEncode(this.m_LabelName);
                    this.LinkJump.Items.Add(item2);
                    ListItem item3         = new ListItem();
                    string   selectedValue = this.RbtDataType.SelectedValue;
                    if (selectedValue != null)
                    {
                        if (!(selectedValue == "static"))
                        {
                            if ((selectedValue == "sql_sysstoredquery") || (selectedValue == "xml_read"))
                            {
                                item3.Text  = "标签内容编辑";
                                item3.Value = "LabelTemplate.aspx?action=modify&name=" + base.Server.UrlEncode(this.m_LabelName);
                                this.LinkJump.Items.Add(item3);
                                goto Label_0412;
                            }
                        }
                        else
                        {
                            item3.Text = "标签内容编辑";
                            switch (str4)
                            {
                            case "txt":
                            case "xml":
                                item3.Value = "LabelTemplateStatic.aspx?action=modify&name=" + base.Server.UrlEncode(this.m_LabelName);
                                break;

                            default:
                                item3.Value = "LabelTemplate.aspx?action=modify&name=" + base.Server.UrlEncode(this.m_LabelName);
                                break;
                            }
                            this.LinkJump.Items.Add(item3);
                            goto Label_0412;
                        }
                    }
                    item3.Text  = "标签查询设置";
                    item3.Value = "LabelSqlBuild.aspx?action=modify&name=" + base.Server.UrlEncode(this.m_LabelName);
                    this.LinkJump.Items.Add(item3);
                    ListItem item4 = new ListItem();
                    item4.Text  = "标签内容编辑";
                    item4.Value = "LabelTemplate.aspx?action=modify&name=" + base.Server.UrlEncode(this.m_LabelName);
                    this.LinkJump.Items.Add(item4);
                }
            }
Label_0412:
            this.SmpNavigator.AdditionalNode = this.m_LabelName;
        }