Ejemplo n.º 1
0
        private string GetSortOrder(int page, string column)
        {
            // Храним модель сортировки в SessionState
            SortModel sm = new SortModel(); // Stable dependency

            if (Session["SortModel"] != null)
            {
                sm = (Session["SortModel"] as SortModel);
            }
            string sort = ""; // Порядок сортировки

            if (page == -1)
            {
                // Выбран новый файл. Сброс сортировки
                sm.Clear();
            }
            else
            {
                sm.UpdateModel(column);
                sort = sm.GetSortOrder();
            }
            Session["SortModel"] = sm;
            ViewBag.SortModel    = sm;
            return(sort);
        }