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


C# Query.AND方法代码示例

本文整理汇总了C#中Query.AND方法的典型用法代码示例。如果您正苦于以下问题:C# Query.AND方法的具体用法?C# Query.AND怎么用?C# Query.AND使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Query的用法示例。


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

示例1: objdsOrders_Selecting

    /// <summary>
    /// pass filter field AND contact id for selecting by user
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void objdsOrders_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)
    {
        Int32 _userid = Page.Session["user"] != null ? (Int32)((UserClass)Page.Session["user"]).UserId : -1;
        Int32 _companyid = Page.Session["user"] != null ? (Int32)((UserClass)Page.Session["user"]).CompanyId : -1;
        
        //e.InputParameters["ContactID"] = _userid;
        Query _qry = new Query(PublishipAdvanceOrderTable.Schema);
        
        if (this.dxcbofields.Text.ToString() != string.Empty && this.txtQuickSearch.Text.ToString() != string.Empty)
        {
            string _fieldname = this.dxcbofields.SelectedItem.GetValue("fieldname").ToString();
            string _txtsearch = this.txtQuickSearch.Text.ToLower();

            _qry.AND(_fieldname, Comparison.Equals, _txtsearch);
        }

        if (!string.IsNullOrEmpty((string)this.dxcbocompany.Value))
        {
            _qry.AND("CompanyID", Comparison.Equals, this.dxcbocompany.Value.ToString());  
        }
        
        e.InputParameters["qry"] = _qry;
    }
开发者ID:Publiship,项目名称:WWI_CRM_folders,代码行数:28,代码来源:advance_audit.aspx.cs

示例2: get_datatable_subsonic

    //
    public DataTable get_datatable_subsonic()
    {
        //using a collection as it's the only way to directly apply a query string!
        //query to grid
        //Int32 _page = this.gridOrder.PageIndex;
        //Int32 _pagesize = this.gridOrder.SettingsPager.PageSize;
        //
        String _companyid = "";
        String _filter = "";

        //check to see if we have a company id
        //user MUST be logged in for advanced searches
        Query _qry = new Query(Views.ViewOrder);

        //need to switch this off when we are testing!
        Page.Session.Remove("user");
        if (Page.Session["user"] != null)
        {
            _companyid = ((UserClass)Page.Session["user"]).CompanyId.ToString();
            _qry.WHERE("CompanyID = " + _companyid);
            //_query = "WHERE CompanyId = " + _companyid; 
        }

        if (Session["filter"] != null)
        {
            _filter = Session["filter"].ToString();
            if (_companyid != string.Empty) { _qry.AND(_filter); } else { _qry.WHERE(_filter); }
            //if (_companyid != string.Empty) { _query+= "AND " + _filter; } else {_query = " WHERE " + _filter ; }

        }

        //InlineQuery _qry = new InlineQuery();

        //_qry.PageIndex = _page+1; //gridview page is 0 based, but subsonic is 1 based
        //_qry.PageSize = _pagesize;

        ViewOrderCollection _order = new ViewOrderCollection();
        _order.LoadAndCloseReader(_qry.ExecuteReader());
        DataTable _dt = (DataTable)_order.ToDataTable();

        return _dt;
    }
开发者ID:Publiship,项目名称:WWI_CRM_folders,代码行数:43,代码来源:container_tracking.aspx.cs

示例3: GetQuery

 public static Query GetQuery(int hostID, int? userID, Nullable<ActionType> actionType, int? storyID, int? chatID)
 {
     Query query = new Query(UserAction.Schema).WHERE(UserAction.Columns.HostID, hostID).ORDER_BY(UserAction.Columns.CreatedOn, "DESC");
     if (userID.HasValue)
         query = query.AND(UserAction.Columns.UserID, userID);
     if (actionType.HasValue)
         query = query.AND(UserAction.Columns.UserActionTypeID, (int)actionType.Value);
     if (storyID.HasValue)
         query = query.AND(UserAction.Columns.StoryID, storyID);
     if (chatID.HasValue)
         query = query.AND(UserAction.Columns.ChatID, chatID);
     return query;
 }
开发者ID:Letractively,项目名称:dotnetkicks,代码行数:13,代码来源:UserAction.cs


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