Пример #1
0
        public bool Display(ApplicationCommand cmd, string columns, Locator locator)
        {
            SqlBuilder builder;

            if (cmd.wildcard == null)
            {
                builder = new SqlBuilder().SELECT().TOP(cmd.Top).COLUMNS(columns).FROM(tname);
                if (locator != null)
                {
                    builder.WHERE(locator);
                }
            }
            else
            {
                Locator where = LikeExpr(cmd.wildcard, cmd.Columns);
                if (locator != null)
                {
                    where = locator.And(where);
                }

                builder = new SqlBuilder().SELECT().COLUMNS(columns).FROM(tname).WHERE(where);
            }

            return(Display(cmd, builder, tname, cmd.Top));
        }
Пример #2
0
        public Locator GetCombinedLocator(TreeNode <IDataPath> pt1)
        {
            if (pt1.Item is Locator)
            {
                Locator locator = new Locator((Locator)pt1.Item);
                var     pt2     = pt1;
                while (pt2.Parent.Item is Locator)
                {
                    pt2 = pt2.Parent;
                    locator.And((Locator)pt2.Item);
                }

                return(locator);
            }
            else
            {
                return(null);
            }
        }
Пример #3
0
        private bool TypeLocatorData(TreeNode <IDataPath> pt, ApplicationCommand cmd)
        {
            if (!(pt.Item is Locator))
            {
                return(false);
            }

            TableName tname   = this.GetCurrentPath <TableName>();
            Locator   locator = GetCombinedLocator(pt);

            var xnode = pt;

            while (xnode.Parent.Item is Locator)
            {
                xnode = xnode.Parent;
                locator.And((Locator)xnode.Item);
            }

            tout = new TableOut(tname);
            return(tout.Display(cmd, "*", locator));
        }