Esempio n. 1
0
        void preparePaggin(ScoopPagging node)
        {
            new Translation(getComponentValue(Component.Paggin), node.Page.ToString())
            .Finally(_translations.Add);

            new Translation(getComponentValue(Component.Paggin), node.PageCount.ToString())
            .Finally(_translations.Add);
        }
Esempio n. 2
0
 void Evaluate(ScoopPagging pagePagging)
 {
     switch (_currentComponent)
     {
     case Component.Paggin:
         preparePaggin(pagePagging);
         break;
     }
 }
Esempio n. 3
0
        void prepareDataTablesRequest(IDataTablesRequest node)
        {
            if (node == null)
            {
                return;
            }


            if (!string.IsNullOrEmpty(node.Search.Value))
            {
                string str = "(";
                foreach (string str2 in (from x in node.Columns select x.Data).ToArray <string>())
                {
                    if (!string.IsNullOrEmpty(str2))
                    {
                        str = str + string.Format("{0} Like('%{1}%') or ", str2, node.Search.Value);
                    }
                }
                str = str.Substring(0, str.Length - 3) + ")";
                new Translation(getComponentValue(Component.Where), str).Finally(_translations.Add);
            }
            if (_components.Count(x => (x.ComponentType == Component.Count)) <= 0)
            {
                var column = (from x in node.Columns
                              where x.IsOrdered
                              select x).FirstOrDefault();
                if (column != null)
                {
                    if (column.SortDirection == Column.OrderDirection.Ascendant)
                    {
                        this.prepareOrderBy(null, false, column.Data);
                    }
                    else
                    {
                        this.prepareOrderByDesc(null, false, column.Data);
                    }
                }
                var pagging = new ScoopPagging {
                    Page = node.Start, PageCount = node.Length
                };
                preparePaggin(pagging);
                getComponentValue(Component.DataTablesRequest);
            }
        }