void BindgvwActiveMenuItems()
        {
            try
            {
                List <hccMenuItem> activeItems = hccMenuItem.GetBy(false);

                if (!string.IsNullOrWhiteSpace(CurrentAlphaSelection))
                {
                    activeItems = activeItems.Where(a => a.Name.ToLower().StartsWith(CurrentAlphaSelection.ToLower())).ToList();
                }

                var pi = typeof(hccMenuItem).GetProperty(NewSortExpression);

                if (LastSortDirection == SortDirection.Ascending)
                {
                    activeItems = activeItems.OrderBy(x => pi.GetValue(x, null)).ToList();
                }
                else if (LastSortDirection == SortDirection.Descending)
                {
                    activeItems = activeItems.OrderByDescending(x => pi.GetValue(x, null)).ToList();
                }

                //gvwActiveMenuItems.DataSource = activeItems;
                // gvwActiveMenuItems.DataBind();
            }
            catch (Exception)
            {
                throw;
            }
        }
Ejemplo n.º 2
0
        void BindgvwRetiredIngreds()
        {
            List <hccIngredient> retIngr = hccIngredient.GetRetired();

            if (!string.IsNullOrWhiteSpace(CurrentAlphaSelection))
            {
                retIngr = retIngr.Where(a => a.Name.ToLower().StartsWith(CurrentAlphaSelection.ToLower())).ToList();
            }

            //gvwRetiredIngreds.DataSource = retIngr;
            //gvwRetiredIngreds.DataBind();
        }