Esempio n. 1
0
        internal void InheriteFromBase(TagBase tag)
        {
            string strTemp = tag.GetAttribute("ID");

            //标志
            if (strTemp != null)
            {
                this.IDentity = strTemp;
            }

            //是否总是显示
            strTemp = tag.GetAttribute("AlwaysShow");
            if (strTemp != null)
            {
                this.AlwaysShow = (strTemp.ToLower() == "true");
            }

            //分页格式定义
            strTemp = tag.GetAttribute("PageFormat");
            if (strTemp != null)
            {
                this.PageFormat = strTemp;
            }
        }
Esempio n. 2
0
        internal void InheriteFromBase(TagBase tag)
        {
            string strTemp = tag.GetAttribute("ID");
            //标志
            if (strTemp != null) { this.IDentity = strTemp; }

            //是否总是显示
            strTemp = tag.GetAttribute("AlwaysShow");
            if (strTemp != null) { this.AlwaysShow = (strTemp.ToLower()=="true"); }

            //分页格式定义
            strTemp = tag.GetAttribute("PageFormat");
            if (strTemp != null) { this.PageFormat = strTemp; }
        }
Esempio n. 3
0
File: ListTag.cs Progetto: vbyte/fmq
        internal void InheriteFromBase(TagBase tag)
        {
            string strTemp = tag.GetAttribute("ID");
            //标志
            if (!string.IsNullOrEmpty(strTemp)) { this.IDentity = strTemp; }

            //指定另外的Access数据库
            strTemp = tag.GetAttribute("ConnKey");
            if (!string.IsNullOrEmpty(strTemp)) { this.BindConnKey = strTemp; }

            //指定前几条
            strTemp = tag.GetAttribute("Top");
            if (!string.IsNullOrEmpty(strTemp)) { this.TopCount = int.Parse(strTemp); }

            //指定每行显示的项数
            strTemp = tag.GetAttribute("RowSize");
            if (!string.IsNullOrEmpty(strTemp)) { this.RowSize = int.Parse(strTemp); }

            strTemp = tag.GetAttribute("PageSize");
            if (!string.IsNullOrEmpty(strTemp)) { this.PageSize = int.Parse(strTemp); }

            //指定绑定表格
            strTemp = tag.GetAttribute("Table");
            if (!string.IsNullOrEmpty(strTemp)) { this.BindTableName = strTemp; }

            //指定选取字段列表
            strTemp = tag.GetAttribute("Fields");
            if (!string.IsNullOrEmpty(strTemp)) { this.Fields = strTemp.Trim('"', '\''); }

            //指定选取字段列表
            strTemp = tag.GetAttribute("OrderBy");
            if (!string.IsNullOrEmpty(strTemp)) { this.OrderBy = strTemp; }

            //自定义查询条件
            strTemp = tag.GetAttribute("Query");
            if (!string.IsNullOrEmpty(strTemp)) { this.Query = strTemp; return; }

            object objTemp = null;
            #region sql查询条件
            foreach (string s in tag.GetObjAttributes())
            {
                string value = tag.GetAttribute(s);

                //OleDbHelper.AppendToFile("~/debug.log", System.Environment.NewLine + " Value:" + value);

                if ((s[0] == '%' && s[s.Length - 1] == '%') ||
                    (s[0] == '(' && value[value.Length - 1] == ')'))
                {
                    strTemp = (s[1] != '@') ? ((s[1] == '~') ? " like " : "=") : "";
                    string newCondition = s.Trim('%', '(', '~', '@')
                        + strTemp
                        + value.Replace('"', '\'').Trim(')');

                    #region 处理值中的系统标签或函数
                    if (value.StartsWith("$") && value.EndsWith("$"))
                    {
                        //OleDbHelper.AppendToFile("~/debug.log", System.Environment.NewLine + " Value:" + value);
                        if (this.GetResourceDependency() != null)
                        {
                            //OleDbHelper.AppendToFile("~/debug.log", System.Environment.NewLine + " Res:" + this.GetResourceDependency().ToString());

                            objTemp = this.GetResourceDependency().GetDefinition("{#" + value + "#}");

                            if (string.IsNullOrEmpty(objTemp.ToString()))
                            {
                                newCondition = "";
                            }
                            else
                            {
                                newCondition = s.Trim('%', '(', '~', '@') + strTemp + objTemp.ToString();
                            }

                        }
                        else
                        {
                            newCondition = "";
                        }
                    }
                    #endregion

                    if (newCondition.Length > 0)
                    {
                        if (this._filterCondition != "")
                        {
                            this._filterCondition += " And " + newCondition;
                        }
                        else
                        {
                            this._filterCondition = newCondition;
                        }
                    }
                }
            }
            //Util.Debug(false, this.FilterCondition);
            #endregion
        }
Esempio n. 4
0
        internal void InheriteFromBase(TagBase tag)
        {
            string strTemp = tag.GetAttribute("ID");

            //标志
            if (!string.IsNullOrEmpty(strTemp))
            {
                this.IDentity = strTemp;
            }

            //指定另外的Access数据库
            strTemp = tag.GetAttribute("ConnKey");
            if (!string.IsNullOrEmpty(strTemp))
            {
                this.BindConnKey = strTemp;
            }

            //指定前几条
            strTemp = tag.GetAttribute("Top");
            if (!string.IsNullOrEmpty(strTemp))
            {
                this.TopCount = int.Parse(strTemp);
            }

            //指定每行显示的项数
            strTemp = tag.GetAttribute("RowSize");
            if (!string.IsNullOrEmpty(strTemp))
            {
                this.RowSize = int.Parse(strTemp);
            }

            strTemp = tag.GetAttribute("PageSize");
            if (!string.IsNullOrEmpty(strTemp))
            {
                this.PageSize = int.Parse(strTemp);
            }

            //指定绑定表格
            strTemp = tag.GetAttribute("Table");
            if (!string.IsNullOrEmpty(strTemp))
            {
                this.BindTableName = strTemp;
            }

            //指定选取字段列表
            strTemp = tag.GetAttribute("Fields");
            if (!string.IsNullOrEmpty(strTemp))
            {
                this.Fields = strTemp.Trim('"', '\'');
            }

            //指定选取字段列表
            strTemp = tag.GetAttribute("OrderBy");
            if (!string.IsNullOrEmpty(strTemp))
            {
                this.OrderBy = strTemp;
            }

            //自定义查询条件
            strTemp = tag.GetAttribute("Query");
            if (!string.IsNullOrEmpty(strTemp))
            {
                this.Query = strTemp; return;
            }

            object objTemp = null;

            #region sql查询条件
            foreach (string s in tag.GetObjAttributes())
            {
                string value = tag.GetAttribute(s);

                //OleDbHelper.AppendToFile("~/debug.log", System.Environment.NewLine + " Value:" + value);

                if ((s[0] == '%' && s[s.Length - 1] == '%') ||
                    (s[0] == '(' && value[value.Length - 1] == ')'))
                {
                    strTemp = (s[1] != '@') ? ((s[1] == '~') ? " like " : "=") : "";
                    string newCondition = s.Trim('%', '(', '~', '@')
                                          + strTemp
                                          + value.Replace('"', '\'').Trim(')');

                    #region 处理值中的系统标签或函数
                    if (value.StartsWith("$") && value.EndsWith("$"))
                    {
                        //OleDbHelper.AppendToFile("~/debug.log", System.Environment.NewLine + " Value:" + value);
                        if (this.GetResourceDependency() != null)
                        {
                            //OleDbHelper.AppendToFile("~/debug.log", System.Environment.NewLine + " Res:" + this.GetResourceDependency().ToString());

                            objTemp = this.GetResourceDependency().GetDefinition("{#" + value + "#}");

                            if (string.IsNullOrEmpty(objTemp.ToString()))
                            {
                                newCondition = "";
                            }
                            else
                            {
                                newCondition = s.Trim('%', '(', '~', '@') + strTemp + objTemp.ToString();
                            }
                        }
                        else
                        {
                            newCondition = "";
                        }
                    }
                    #endregion

                    if (newCondition.Length > 0)
                    {
                        if (this._filterCondition != "")
                        {
                            this._filterCondition += " And " + newCondition;
                        }
                        else
                        {
                            this._filterCondition = newCondition;
                        }
                    }
                }
            }
            //Util.Debug(false, this.FilterCondition);
            #endregion
        }