当前位置: 首页>>代码示例>>C#>>正文


C# SortDirection类代码示例

本文整理汇总了C#中SortDirection的典型用法代码示例。如果您正苦于以下问题:C# SortDirection类的具体用法?C# SortDirection怎么用?C# SortDirection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SortDirection类属于命名空间,在下文中一共展示了SortDirection类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Initialize

        private void Initialize(string sortExpression)
        {
            FieldName = string.Empty;
            Direction = SortDirection.Ascending;

            if (string.IsNullOrEmpty(sortExpression))
                return;

            var sortExp = sortExpression.Trim();

            if (sortExp.EndsWith(" DESC"))
            {
                sortExp = sortExp.Remove(sortExp.LastIndexOf(" DESC"));
                this.Direction = SortDirection.Descending;
            }
            else if (sortExp.EndsWith(" ASC"))
            {
                sortExp = sortExp.Remove(sortExp.LastIndexOf(" ASC"));
                this.Direction = SortDirection.Ascending;
            }

            this.FullName = sortExp;

            var separatorIndex = sortExp.IndexOf('.');
            if (separatorIndex >= 0)
                sortExp = sortExp.Substring(separatorIndex + 1);

            this.FieldName = sortExp;
        }
开发者ID:maxpavlov,项目名称:FlexNet,代码行数:29,代码来源:SortingInfo.cs

示例2: Search

        public List<BRAND> Search(BRAND Brand, int PageSize, int PageIndex, out int TotalRecords, string OrderExp, SortDirection SortDirection)
        {
            var result = Context.BRAND.AsQueryable();
            if (Brand != null)
            {
                if (!String.IsNullOrEmpty(Brand.Name))
                {
                    result = result.Where(b => b.Name.Contains(Brand.Name));
                }

                if (!String.IsNullOrEmpty(Brand.ShowName))
                {
                    result = result.Where(b => b.ShowName.Contains(Brand.ShowName));
                }

                if (!String.IsNullOrEmpty(Brand.Description))
                {
                    result = result.Where(b => b.Description.Contains(Brand.Description));
                }

                if (!String.IsNullOrEmpty(Brand.Email))
                {
                    result = result.Where(b => b.Email.Contains(Brand.Email));
                }
            }
            TotalRecords = result.Count();

            GenericSorterCaller<BRAND> sorter = new GenericSorterCaller<BRAND>();
            result = sorter.Sort(result, string.IsNullOrEmpty(OrderExp) ? DEFAULT_ORDER_EXP : OrderExp, SortDirection);

            // pagination
            return result.Skip(PageIndex * PageSize).Take(PageSize).ToList();
        }
开发者ID:gertgjoka,项目名称:fashion-commerce,代码行数:33,代码来源:BrandDAO.cs

示例3: PagingInfo

 public PagingInfo(
     string sortTitle,
     string sortExpression,
     SortDirection sortDirection)
 {
     AddSortExpression(sortTitle, sortExpression, sortDirection);
 }
开发者ID:Neilski,项目名称:URF-Identity,代码行数:7,代码来源:PagingInfo.cs

示例4: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                SetPageRibbon(StandardModuleRibbons.SetupRibbon());
                SID.Text = Session["SID"] == null ? "" : Session["SID"].ToString();
                if (SID.Text == "") Response.Redirect("SurveyList.aspx");
                var s = Survey.FetchObject(int.Parse(SID.Text));
                lblSurvey.Text = string.Format("{0} - {1}", s.Name, s.LongName);
                if (s.Status > 1) ReadOnly.Text = "true";
            }

            MasterPage.RequiredPermission = 5200;
            MasterPage.IsSecure = true;
            MasterPage.PageTitle = string.Format("{0}", "Survey/Test Question List");

            _mStrSortExp = String.Empty;
            if (!IsPostBack)
            {
                _mStrSortExp = String.Empty;
            }
            else
            {
                if (null != ViewState["_SortExp_"])
                {
                    _mStrSortExp = ViewState["_SortExp_"] as String;
                }

                if (null != ViewState["_Direction_"])
                {
                    _mSortDirection = (SortDirection)ViewState["_Direction_"];
                }
            }
        }
开发者ID:justinmeiners,项目名称:greatreadingadventure,代码行数:34,代码来源:SurveyQuestionList.aspx.cs

示例5: SortableField

        public SortableField(string name, SortDirection sortDirection = SortDirection.Asc)
        {
            Ensure.That(name, "name").IsNotNullOrWhiteSpace();

            Name = name;
            SortDirection = sortDirection;
        }
开发者ID:aldass,项目名称:mycouch,代码行数:7,代码来源:SortableField.cs

示例6: SortExpressionLink

        public static MvcHtmlString SortExpressionLink(
            this HtmlHelper helper,
            string title,
            string sortExpression,
            SortDirection direction = SortDirection.Ascending,
            object htmlAttributes = null)
        {
            var a = new TagBuilder("a");

            if (htmlAttributes != null)
            {
                // get the attributes
                IDictionary<string, object> attributes =
                    HtmlHelper.AnonymousObjectToHtmlAttributes(htmlAttributes)
                        as IDictionary<string, object>;

                // set the attributes
                a.MergeAttributes(attributes);
            }

            var i = new TagBuilder("i");
            i.MergeAttribute("class", "indicator");

            a.AddCssClass("sort-expression-link");

            a.MergeAttribute("title", title);
            a.MergeAttribute("href", "#" + sortExpression);
            a.MergeAttribute("data-sort-expression", sortExpression);
            a.MergeAttribute("data-sort-direction", direction.ToString());
            a.InnerHtml = title + i.ToString(TagRenderMode.Normal);

            return
                MvcHtmlString.Create(a.ToString(TagRenderMode.Normal));
        }
开发者ID:Neilski,项目名称:URF-Identity,代码行数:34,代码来源:SortExpressionLink.cs

示例7: Init

        public void Init(ParsingContext context, ParseTreeNode parseNode)
        {
            if (HasChildNodes(parseNode))
            {
                if (parseNode.ChildNodes[3] != null && HasChildNodes(parseNode.ChildNodes[3]) && parseNode.ChildNodes[3].ChildNodes[0].Term.Name.ToUpper() == "DESC")
                    _OrderDirection = SortDirection.Desc;
                else
                    _OrderDirection = SortDirection.Asc;

                _OrderByAttributeList = new List<OrderByAttributeDefinition>();

                foreach (ParseTreeNode treeNode in parseNode.ChildNodes[2].ChildNodes)
                {
                    if (treeNode.AstNode != null && treeNode.AstNode is IDNode)
                    {

                        _OrderByAttributeList.Add(new OrderByAttributeDefinition(((IDNode)treeNode.AstNode).IDChainDefinition, null));
                    }
                    else
                    {
                        _OrderByAttributeList.Add(new OrderByAttributeDefinition(null, treeNode.Token.ValueString));
                    }
                }

                OrderByDefinition = new OrderByDefinition(_OrderDirection, _OrderByAttributeList);
            }
        }
开发者ID:anukat2015,项目名称:sones,代码行数:27,代码来源:OrderByNode.cs

示例8: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            MasterPage.RequiredPermission = 4500;
            MasterPage.IsSecure = true;
            MasterPage.PageTitle = string.Format("{0}", "Events List");

            _mStrSortExp = String.Empty;

            if (!IsPostBack)
            {
                SetPageRibbon(StandardModuleRibbons.SetupRibbon());

                //if (WasFiltered())
                //{
                //    GetFilterSessionValues();
                //}

                _mStrSortExp = String.Empty;
            }
            else
            {
                if (null != ViewState["_SortExp_"])
                {
                    _mStrSortExp = ViewState["_SortExp_"] as String;
                }

                if (null != ViewState["_Direction_"])
                {
                    _mSortDirection = (SortDirection)ViewState["_Direction_"];
                }
            }
        }
开发者ID:haraldnagel,项目名称:greatreadingadventure,代码行数:32,代码来源:EventList.aspx.cs

示例9: OrderByField

 /// <summary>
 /// Creates new instance of OrderByField
 /// </summary>
 /// <param name="OrderField">Field to order by</param>
 /// <param name="Direction">Sort direction</param>
 public OrderByField(Field OrderField, SortDirection Direction)
 {
     if (OrderField == null)
         throw new ArgumentNullException("OrderField");
     this.Field = OrderField;
     this.Direction = Direction;
 }
开发者ID:williams55,项目名称:clinic-doctor,代码行数:12,代码来源:OrderByField.cs

示例10: GridView1_Sorting

    protected void GridView1_Sorting(object sender, GridViewSortEventArgs e)
    {
        DataTable dataTable = GridView1.DataSource as DataTable;
        string sortExpression = e.SortExpression;
        string direction = string.Empty;

        if (dataTable != null)
        {
            DataView dataView = new DataView(dataTable);

            if (SortDirection == SortDirection.Descending)
            {
                SortDirection = SortDirection.Ascending;
                direction = " ASC";
            }
            else
            {
                SortDirection = SortDirection.Descending;
                direction = " DESC";
            }

            DataTable table = GridView1.DataSource as DataTable;
            table.DefaultView.Sort = sortExpression + direction;

            GridView1.DataSource = table;
            GridView1.DataBind();

        }
    }
开发者ID:kevindenham,项目名称:PDQ_Web,代码行数:29,代码来源:Applications.aspx.cs

示例11: ReportSortOptions

 public ReportSortOptions(string criterium, SortDirection direction)
     : base(criterium, direction)
 {
     var allowedCriteria = new string[] { "Operator.Name", "CreateDate" };
     if (!allowedCriteria.Contains(criterium))
         throw new ArgumentException("criterium");
 }
开发者ID:alinadar1985,项目名称:incident-management-android-app,代码行数:7,代码来源:SortOptions.cs

示例12: IndexKeyColumn

        public IndexKeyColumn(Column column, SortDirection sortDirection)
        {
            if (column == null) throw new ArgumentNullException("column");

            Column = column;
            SortDirection = sortDirection;
        }
开发者ID:Inferis,项目名称:KindjesNet,代码行数:7,代码来源:IndexKeyColumn.cs

示例13: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            MasterPage.RequiredPermission = 4100;
            MasterPage.IsSecure = true;
            MasterPage.PageTitle = string.Format("{0}", "School and District Crosswalk");

            if (!IsPostBack)
            {
                SetPageRibbon(StandardModuleRibbons.SettingsRibbon());

                //LoadData();

            }

            _mStrSortExp = String.Empty;
            if (!IsPostBack)
            {
                _mStrSortExp = String.Empty;
            }
            else
            {
                if (null != ViewState["_SortExp_"])
                {
                    _mStrSortExp = ViewState["_SortExp_"] as String;
                }

                if (null != ViewState["_Direction_"])
                {
                    _mSortDirection = (SortDirection)ViewState["_Direction_"];
                }
            }

        }
开发者ID:haraldnagel,项目名称:greatreadingadventure,代码行数:33,代码来源:SchoolDistrict.aspx.cs

示例14: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            MasterPage.RequiredPermission = 4400;
            MasterPage.IsSecure = true;
            
            if (!IsPostBack)
            {
                SetPageRibbon(StandardModuleRibbons.SetupRibbon());

                lblPK.Text = Session["BLL"] == null ? "" : Session["BLL"].ToString(); //Session["BLL"]= string.Empty;
                var bl = BookList.FetchObject(int.Parse(lblPK.Text));
                MasterPage.PageTitle = string.Format("Tasks in the \"{0}\" Challenge", bl.AdminName);
             }

            
            _mStrSortExp = String.Empty;
            if (!IsPostBack)
            {
                _mStrSortExp = String.Empty;
            }
            else
            {
                if (null != ViewState["_SortExp_"])
                {
                    _mStrSortExp = ViewState["_SortExp_"] as String;
                }

                if (null != ViewState["_Direction_"])
                {
                    _mSortDirection = (SortDirection)ViewState["_Direction_"];
                }
            }
        }
开发者ID:justinmeiners,项目名称:greatreadingadventure,代码行数:33,代码来源:BookListBooksList.aspx.cs

示例15: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            MasterPage.RequiredPermission = 8000;
            MasterPage.IsSecure = true;
            MasterPage.PageTitle = string.Format("{0}", "Organization List");

            if (!(bool)CRIsMasterTenant)
            {
                Response.Redirect("MyTenantAccount.aspx");
            }

            _mStrSortExp = String.Empty;

            if (!IsPostBack)
            {
                SetPageRibbon(StandardModuleRibbons.MasterTenantRibbon());

                _mStrSortExp = String.Empty;
            }
            else
            {
                if (null != ViewState["_SortExp_"])
                {
                    _mStrSortExp = ViewState["_SortExp_"] as String;
                }
 
                if (null != ViewState["_Direction_"])
                {
                    _mSortDirection = (SortDirection)ViewState["_Direction_"];
                }
            }
        }
开发者ID:haraldnagel,项目名称:greatreadingadventure,代码行数:32,代码来源:TenantList.aspx.cs


注:本文中的SortDirection类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。