//incremental filtering for large datasets on combos /// <summary> /// incremental filtering and partial loading of vessels for speed /// both ItemsRequestedByFilterCondition and ItemRequestedByValue must be set up for this to work /// </summary> /// <param name="source"></param> /// <param name="e"></param> protected void dxcboVesselID_ItemsRequestedByFilterCondition(object source, DevExpress.Web.ASPxEditors.ListEditItemsRequestedByFilterConditionEventArgs e) { DevExpress.Web.ASPxEditors.ASPxComboBox _combo = (DevExpress.Web.ASPxEditors.ASPxComboBox)source; string _filter = !string.IsNullOrEmpty(e.Filter) ? e.Filter : ""; //use datareaders - much faster than loading into collections string[] _cols = { "VoyageID", "Joined", "ETS", "ETA", "DestinationPortID", "OriginPortID" }; string[] _sort = { "Joined" }; //additional filters on this dll string _originportid = this.dxhfOrder.Contains("ptstart") ? this.dxhfOrder.Get("ptstart").ToString() : ""; string _destportid = this.dxhfOrder.Contains("ptend") ? this.dxhfOrder.Get("ptend").ToString() : ""; if (_originportid != "" && _destportid != "") { //SubSonic.SqlQuery _query = DAL.Logistics.DB.Select(_cols).From(DAL.Logistics.Tables.NameAndAddressBook).Paged(e.BeginIndex + 1, e.EndIndex + 1, "CompanyID").WhereExpression("CompanyName").Like(string.Format("%{0}%", e.Filter.ToString())); SubSonic.SqlQuery _query = DAL.Logistics.DB.Select(_cols).From("Page2VesselView").Paged(e.BeginIndex + 1, e.EndIndex + 1, "VoyageID").Where("Joined").Like(string.Format("{0}%", e.Filter.ToString())).And("DestinationPortID").IsEqualTo(_destportid).And("OriginPortID").IsEqualTo(_originportid).OrderAsc(_sort); string test = _query.ToString(); IDataReader _rd = _query.ExecuteReader(); _combo.DataSource = _rd; _combo.ValueField = "VoyageID"; _combo.TextField = "Joined"; _combo.DataBindItems(); } }
public void ItemsRequestedByFilterCondition(Session session, object source, DevExpress.Web.ASPxEditors.ListEditItemsRequestedByFilterConditionEventArgs e) { ASPxComboBox combo = source as ASPxComboBox; XPCollection <Department> collection = new XPCollection <Department>(session); collection.SkipReturnedObjects = e.BeginIndex; collection.TopReturnedObjects = e.EndIndex - e.BeginIndex + 1; CriteriaOperator criteria = CriteriaOperator.And( //row status is active new BinaryOperator("OrganizationId.OrganizationId", Utility.CurrentSession.Instance.AccessingOrganizationId), new BinaryOperator("RowStatus", Utility.Constant.ROWSTATUS_ACTIVE), CriteriaOperator.Or( //find code contains the filter new BinaryOperator("Code", String.Format("%{0}%", e.Filter), BinaryOperatorType.Like), //find name contains the filter new BinaryOperator("Name", String.Format("%{0}%", e.Filter), BinaryOperatorType.Like) ) ); collection.Criteria = criteria; collection.Sorting.Add(new SortProperty("Code", DevExpress.Xpo.DB.SortingDirection.Ascending)); combo.DataSource = collection; combo.DataBindItems(); }
//14/07/14 dxcboVesselID_ItemRequestedByValue and dxcboVesselID_ItemsRequestedByFilterCondition DEPRECATED //can't use OnItemsRequestedByFilterCondition and OnItemRequestedByValue on this combo as server-side filtring makes the search case sensitive //incremental filtering for large datasets on combos /// <summary> /// incremental filtering and partial loading of name and address book for speed /// both ItemsRequestedByFilterCondition and ItemRequestedByValue must be set up for this to work /// company name is only available to publiship users /// </summary> /// <param name="source"></param> /// <param name="e"></param> protected void dxcbocompany_ItemsRequestedByFilterCondition(object source, DevExpress.Web.ASPxEditors.ListEditItemsRequestedByFilterConditionEventArgs e) { DevExpress.Web.ASPxEditors.ASPxComboBox _combo = (DevExpress.Web.ASPxEditors.ASPxComboBox)source; //if (Page.Session["user"] != null) //if publiship user allow filter to be used otherwise filter null //{ // Int32 _companyid = wwi_func.vint(((UserClass)Page.Session["user"]).CompanyId.ToString()); // if (_companyid == -1) // { string _filter = !string.IsNullOrEmpty(e.Filter) ? e.Filter : ""; //use datareaders - much faster than loading into collections string[] _cols = { "CompanyID", "CompanyName", "Address1", "Address2", "Address3", "CountryName", "TelNo", "Customer" }; //SubSonic.SqlQuery _query = DAL.Logistics.DB.Select(_cols).From(DAL.Logistics.Tables.NameAndAddressBook).Paged(e.BeginIndex + 1, e.EndIndex + 1, "CompanyID").WhereExpression("CompanyName").Like(string.Format("%{0}%", e.Filter.ToString())); SubSonic.SqlQuery _query = DAL.Logistics.DB.Select(_cols).From("view_delivery_address").Paged(e.BeginIndex + 1, e.EndIndex + 1, "CompanyID").WhereExpression("CompanyName").Like(string.Format("{0}%", e.Filter.ToString())); IDataReader _rd = _query.ExecuteReader(); _combo.DataSource = _rd; _combo.ValueField = "CompanyID"; _combo.ValueType = typeof(int); _combo.TextField = "CompanyName"; _combo.DataBindItems(); // } //} }
protected void cboItem_ItemsRequestedByFilterCondition(object source, DevExpress.Web.ASPxEditors.ListEditItemsRequestedByFilterConditionEventArgs e) { try { ASPxComboBox comboItemUnit = source as ASPxComboBox; XPCollection <BillItem> collection = new XPCollection <BillItem>(session); collection.SkipReturnedObjects = e.BeginIndex; collection.TopReturnedObjects = e.EndIndex - e.BeginIndex + 1; CriteriaOperator criteria = CriteriaOperator.And( CriteriaOperator.Or( new BinaryOperator("ItemUnitId.ItemId.Code", String.Format("%{0}%", e.Filter), BinaryOperatorType.Like), new BinaryOperator("ItemUnitId.ItemId.Name", String.Format("%{0}%", e.Filter), BinaryOperatorType.Like) ), new BinaryOperator("BillId.BillId", bill.BillId, BinaryOperatorType.Equal)); collection.Criteria = criteria; collection.Sorting.Add(new SortProperty("ItemUnitId.ItemId.Code", DevExpress.Xpo.DB.SortingDirection.Ascending)); comboItemUnit.DataSource = collection; comboItemUnit.DataBindItems(); } catch { } }
protected void combo_ItemsRequestedByFilterCondition(object source, DevExpress.Web.ASPxEditors.ListEditItemsRequestedByFilterConditionEventArgs e) { if (AccountActorComboBoxStrategy == null) { return; } AccountActorComboBoxStrategy.ItemsRequestedByFilterCondition(session, source, e); }
protected void combo_ItemsRequestedByFilterCondition(object source, DevExpress.Web.ASPxEditors.ListEditItemsRequestedByFilterConditionEventArgs e) { if (!String.IsNullOrEmpty(e.Filter)) { conditionTemplate = "WHERE [ProductName] like '{0}%'"; } BindComboBox(source, e.Filter, e.BeginIndex, e.EndIndex); }
public void ProductUnitItemsRequestedByFilterCondition(object source, DevExpress.Web.ASPxEditors.ListEditItemsRequestedByFilterConditionEventArgs e) { ASPxComboBox comboBox = (ASPxComboBox)source; //XPCollection<ViewProductUnit> collection = new XPCollection<ViewProductUnit>(session); //collection.SkipReturnedObjects = e.BeginIndex; //collection.TopReturnedObjects = e.EndIndex - e.BeginIndex + 1; //collection.Criteria = new BinaryOperator("Name", String.Format("%{0}%", e.Filter), BinaryOperatorType.Like); //collection.Sorting.Add(new SortProperty("Name", DevExpress.Xpo.DB.SortingDirection.Ascending)); //comboBox.DataSource = collection; //comboBox.DataBindItems(); }
protected void colAccount_OnItemsRequestedByFilterCondition(object source, DevExpress.Web.ASPxEditors.ListEditItemsRequestedByFilterConditionEventArgs e) { ASPxComboBox comboBox = (ASPxComboBox)source; XPCollection <Account> collection = new XPCollection <Account>(m_Session); collection.SkipReturnedObjects = e.BeginIndex; collection.TopReturnedObjects = e.EndIndex - e.BeginIndex + 1; collection.Criteria = new GroupOperator(GroupOperatorType.And, CriteriaOperator.Or( new BinaryOperator("Code", String.Format("%{0}%", e.Filter), BinaryOperatorType.Like), new BinaryOperator("Name", String.Format("%{0}%", e.Filter), BinaryOperatorType.Like)), new BinaryOperator("RowStatus", "1", BinaryOperatorType.GreaterOrEqual)); collection.Sorting.Add(new SortProperty("Code", DevExpress.Xpo.DB.SortingDirection.Ascending)); comboBox.DataSource = collection; comboBox.DataBindItems(); }
/// <summary> /// applies to the Title column editform template /// incremental filtering and partial loading of name and address book for speed /// both ItemsRequestedByFilterCondition and ItemRequestedByValue must be set up for this to work /// company name is only available to publiship users /// </summary> /// <param name="source"></param> /// <param name="e"></param> protected void dxcbotitle_ItemsRequestedByFilterCondition(object source, DevExpress.Web.ASPxEditors.ListEditItemsRequestedByFilterConditionEventArgs e) { //ASPxComboBox _combo = (ASPxComboBox)source; //ASPxComboBox _combo = ((ASPxComboBox)this.dxgridTitles.FindEditRowCellTemplateControl( // this.dxgridTitles.Columns["colTitle"] as GridViewDataComboBoxColumn, "dxcbotitle")); ////use datareaders - much faster than loading into collections //string[] _cols = { "ItemTable.TitleID, ItemTable.Title" }; ////SubSonic.SqlQuery _query = DAL.Logistics.DB.Select(_cols).From(DAL.Logistics.Tables.NameAndAddressBook).Paged(e.BeginIndex + 1, e.EndIndex +1, "CompanyID").WhereExpression("CompanyName").Like(string.Format("%{0}%", e.Filter.ToString())).And("Customer").IsEqualTo(true) ; //SubSonic.SqlQuery _query = new SubSonic.SqlQuery(); //_query = DAL.Logistics.DB.Select(_cols).From(DAL.Logistics.Tables.ItemTable).Paged(e.BeginIndex + 1, e.EndIndex + 1, "TitleID").WhereExpression("Title").StartsWith(string.Format("{0}%", e.Filter.ToString())); //IDataReader _rd = _query.ExecuteReader(); //_combo.DataSource = _rd; //_combo.ValueField = "TitleID"; //_combo.ValueType = typeof(Int32); //_combo.TextField = "Title"; //_combo.DataBind(); }
protected void dxcboVesselID_ItemsRequestedByFilterCondition(object source, DevExpress.Web.ASPxEditors.ListEditItemsRequestedByFilterConditionEventArgs e) { DevExpress.Web.ASPxEditors.ASPxComboBox _combo = (DevExpress.Web.ASPxEditors.ASPxComboBox)source; string _filter = !string.IsNullOrEmpty(e.Filter) ? e.Filter : ""; //use datareaders - much faster than loading into collections string[] _cols = { "VesselID", "VesselName" }; string[] _sort = { "VesselName" }; //SubSonic.SqlQuery _query = DAL.Logistics.DB.Select(_cols).From(DAL.Logistics.Tables.NameAndAddressBook).Paged(e.BeginIndex + 1, e.EndIndex + 1, "CompanyID").WhereExpression("CompanyName").Like(string.Format("%{0}%", e.Filter.ToString())); SubSonic.SqlQuery _query = DAL.Logistics.DB.Select(_cols).From(DAL.Logistics.Tables.VesselTable).Paged(e.BeginIndex + 1, e.EndIndex + 1).Where("VesselName").Like(string.Format("{0}%", _filter)); IDataReader _rd = _query.ExecuteReader(); _combo.DataSource = _rd; _combo.ValueField = "VesselID"; _combo.TextField = "VesselName"; _combo.DataBindItems(); }
//protected void SqlDsAgentOrg_Init(object sender, EventArgs e) //{ // SqlDsAgentOrg.SelectCommand = SQLConstants.SELECT_LIST_AGENT; // SqlDsAgentOrg.DataSourceMode = SqlDataSourceMode.DataSet; // SqlDsAgentOrg.ConnectionString = (new igFunctions.DB().getConStr()); // SqlDsAgentOrg.SelectParameters.Clear(); // SqlDsAgentOrg.SelectParameters.Add("EmailItemID", TypeCode.Int32, EmailItemID.ToString()); //} protected void ComboCompanyList_ItemsRequestedByFilterCondition(object source, DevExpress.Web.ASPxEditors.ListEditItemsRequestedByFilterConditionEventArgs e) { string Qry = string.Empty; if (e.Filter == "") { if (rate_type == 4) { Qry = SQLConstants.SELECT_LIST_ORGANIZATION_ALL; } else { Qry = SQLConstants.SELECT_LIST_ORGANIZATION_AGENT; } } else { if (rate_type == 4) { Qry = SQLConstants.SELECT_LIST_ORGANIZATION_WITH_FILTER_START_END_INDEX; } else { Qry = SQLConstants.SELECT_LIST_ORGANIZATION_AGENT_WITH_FILTER_START_END_INDEX; } } ASPxComboBox comboBox = (ASPxComboBox)source; SQLDsClientProfile.SelectCommand = Qry; SQLDsClientProfile.SelectParameters.Clear(); SQLDsClientProfile.SelectParameters.Add("elt_account_number", TypeCode.Int32, elt_account_number.ToString()); SQLDsClientProfile.SelectParameters.Add("filter", TypeCode.String, string.Format("%{0}%", e.Filter)); SQLDsClientProfile.SelectParameters.Add("startIndex", TypeCode.Int64, (e.BeginIndex + 1).ToString()); SQLDsClientProfile.SelectParameters.Add("endIndex", TypeCode.Int64, (e.EndIndex + 1).ToString()); SQLDsClientProfile.ConnectionString = (new igFunctions.DB().getConStr()); comboBox.DataBind(); }
public void ItemsRequestedByFilterCondition(Session session, object source, DevExpress.Web.ASPxEditors.ListEditItemsRequestedByFilterConditionEventArgs e) { ASPxComboBox combo = source as ASPxComboBox; XPCollection <Organization> collection = new XPCollection <Organization>(session); collection.SkipReturnedObjects = e.BeginIndex; collection.TopReturnedObjects = e.EndIndex - e.BeginIndex + 1; OrganizationType subOrgOrganizationType = Util.getXPCollection <OrganizationType>(session, "Name", OrganizationTypeConstant.NAAN_CUSTOMER_SUB_ORGANIZATION.Value).FirstOrDefault(); CriteriaOperator criteria = CriteriaOperator.And( CriteriaOperator.Or( new BinaryOperator("OrganizationId", Utility.CurrentSession.Instance.AccessingOrganizationId), //CriteriaOperator.And( //new BinaryOperator("ParentOrganizationId!Key", Utility.CurrentSession.Instance.AccessingOrganizationId), new BinaryOperator("OrganizationTypeId", subOrgOrganizationType) //) ), //row status is active new BinaryOperator("RowStatus", Utility.Constant.ROWSTATUS_ACTIVE), CriteriaOperator.Or( //find code contains the filter new BinaryOperator("Code", String.Format("%{0}%", e.Filter), BinaryOperatorType.Like), //find name contains the filter new BinaryOperator("Name", String.Format("%{0}%", e.Filter), BinaryOperatorType.Like) ) ); collection.Criteria = criteria; collection.Sorting.Add(new SortProperty("Code", DevExpress.Xpo.DB.SortingDirection.Ascending)); combo.DataSource = collection; combo.DataBindItems(); }
public void ItemsRequestedByFilterCondition(Session session, object source, DevExpress.Web.ASPxEditors.ListEditItemsRequestedByFilterConditionEventArgs e) { ASPxComboBox combo = source as ASPxComboBox; XPCollection <Organization> collection = new XPCollection <Organization>(session); collection.SkipReturnedObjects = e.BeginIndex; collection.TopReturnedObjects = e.EndIndex - e.BeginIndex + 1; //Get SUPPLIER trading type TradingCategory supplierTradingCategory = session.FindObject <TradingCategory>(new BinaryOperator("Code", "SUPPLIER")); CriteriaOperator criteria = CriteriaOperator.And( //row status is active new BinaryOperator("RowStatus", Utility.Constant.ROWSTATUS_ACTIVE), CriteriaOperator.Or( //find code contains the filter new BinaryOperator("Code", String.Format("%{0}%", e.Filter), BinaryOperatorType.Like), //find name contains the filter new BinaryOperator("Name", String.Format("%{0}%", e.Filter), BinaryOperatorType.Like) ), //find customer and supplier new ContainsOperator("OrganizationCategories", CriteriaOperator.And( new BinaryOperator("TradingCategoryId", supplierTradingCategory), new BinaryOperator("RowStatus", Utility.Constant.ROWSTATUS_ACTIVE) ) ) ); collection.Criteria = criteria; collection.Sorting.Add(new SortProperty("Code", DevExpress.Xpo.DB.SortingDirection.Ascending)); combo.DataSource = collection; combo.DataBindItems(); }
public override void ItemsRequestedByFilterCondition(DevExpress.Xpo.Session session, object source, DevExpress.Web.ASPxEditors.ListEditItemsRequestedByFilterConditionEventArgs e) { ASPxComboBox combo = source as ASPxComboBox; XPCollection <SalesInvoice> collection = new XPCollection <SalesInvoice>(session); collection.SkipReturnedObjects = e.BeginIndex; collection.TopReturnedObjects = e.EndIndex - e.BeginIndex + 1; CriteriaOperator criteria = CriteriaOperator.And( //row status is active new BinaryOperator("RowStatus", Utility.Constant.ROWSTATUS_ACTIVE, BinaryOperatorType.GreaterOrEqual), new BinaryOperator("Code", String.Format("%{0}%", e.Filter), BinaryOperatorType.Like) ); collection.Criteria = criteria; collection.Sorting.Add(new SortProperty("Code", DevExpress.Xpo.DB.SortingDirection.Ascending)); combo.DataSource = collection; combo.DataBindItems(); }
public override void ComboBoxItem_ItemsRequestedByFilterCondition(DevExpress.Xpo.Session session, object source, DevExpress.Web.ASPxEditors.ListEditItemsRequestedByFilterConditionEventArgs e) { ASPxComboBox combo = source as ASPxComboBox; XPCollection <Item> collection = new XPCollection <Item>(session); collection.SkipReturnedObjects = e.BeginIndex; collection.TopReturnedObjects = e.EndIndex - e.BeginIndex + 1; CriteriaOperator criteria = CriteriaOperator.And( //row status is active new BinaryOperator("RowStatus", Utility.Constant.ROWSTATUS_ACTIVE), CriteriaOperator.Or( //find code contains the filter new BinaryOperator("Code", String.Format("%{0}%", e.Filter), BinaryOperatorType.Like), //find name contains the filter new BinaryOperator("Name", String.Format("%{0}%", e.Filter), BinaryOperatorType.Like) ), new ContainsOperator("ItemCustomTypes", new BinaryOperator("ObjectTypeId", ObjectType.GetDefault(session, ObjectTypeEnum.FIXED_ASSETS))) ); collection.Criteria = criteria; collection.Sorting.Add(new SortProperty("Code", DevExpress.Xpo.DB.SortingDirection.Ascending)); combo.DataSource = collection; combo.DataBindItems(); }
public override void ItemsRequestedByFilterCondition(DevExpress.Xpo.Session session, object source, DevExpress.Web.ASPxEditors.ListEditItemsRequestedByFilterConditionEventArgs e) { ASPxComboBox combo = source as ASPxComboBox; XPCollection <InventoryCommand> collection = new XPCollection <InventoryCommand>(session); collection.SkipReturnedObjects = e.BeginIndex; collection.TopReturnedObjects = e.EndIndex - e.BeginIndex + 1; //Get SUPPLIER trading type //TradingCategory supplierTradingCategory = // session.FindObject<TradingCategory>(new BinaryOperator("Code", "SUPPLIER")); CriteriaOperator criteria = CriteriaOperator.And( //row status is active //CriteriaOperator.Or( new BinaryOperator("RowStatus", Utility.Constant.ROWSTATUS_ACTIVE), // new BinaryOperator("RowStatus", Utility.Constant.ROWSTATUS_BOOKED_ENTRY) //), CriteriaOperator.Or( //find code contains the filter new BinaryOperator("Code", String.Format("%{0}%", e.Filter), BinaryOperatorType.Like), //find name contains the filter new BinaryOperator("Name", String.Format("%{0}%", e.Filter), BinaryOperatorType.Like) ), new BinaryOperator("CommandType", 'I', BinaryOperatorType.Equal) ); collection.Criteria = criteria; collection.Sorting.Add(new SortProperty("Code", DevExpress.Xpo.DB.SortingDirection.Ascending)); combo.DataSource = collection; combo.DataBindItems(); }
protected void cbIdentifIdentAte_ItemsRequestedByFilterCondition(object source, DevExpress.Web.ASPxEditors.ListEditItemsRequestedByFilterConditionEventArgs e) { ASPxComboBox comboBox = (ASPxComboBox)source; var daoIdentAtencion = BusinessMapper.GetDaoByEntity(BusinessMapper.eEntities.IdentAtencion); comboBox.DataSource = daoIdentAtencion.FindPaginado(e.Filter, (e.BeginIndex + 1), (e.EndIndex + 1)); comboBox.DataBind(); }
public void ProductUnitItemsRequestedByFilterCondition(object source, DevExpress.Web.ASPxEditors.ListEditItemsRequestedByFilterConditionEventArgs e) { }
protected void cboManufacturer_ItemsRequestedByFilterCondition(object source, DevExpress.Web.ASPxEditors.ListEditItemsRequestedByFilterConditionEventArgs e) { string sql = "select result.Code, result.Name" + " from (select a.Code, b.Name, row_number() over(order by a.Code) as rowno" + " from dbo.Manufacturer a, dbo.ManufacturerProperty b" + " where a.ManufacturerId = b.ManufacturerId" + " and b.Language = @lang" + " and ((a.Code LIKE @filter or b.Name like @filter))) as result" + " where result.rowno between @startIndex and @endIndex"; ManufacturerSDS.SelectCommand = sql; ManufacturerSDS.SelectParameters.Clear(); ManufacturerSDS.SelectParameters.Add("filter", TypeCode.String, string.Format("%{0}%", e.Filter)); ManufacturerSDS.SelectParameters.Add("startIndex", TypeCode.Int64, (e.BeginIndex + 1).ToString()); ManufacturerSDS.SelectParameters.Add("endIndex", TypeCode.Int64, (e.EndIndex + 1).ToString()); ManufacturerSDS.SelectParameters.Add("lang", TypeCode.String, "VN"); }
protected void cboBalanceInitAccount_ItemsRequestedByFilterCondition(object source, DevExpress.Web.ASPxEditors.ListEditItemsRequestedByFilterConditionEventArgs e) { ASPxComboBox comboItemUnit = source as ASPxComboBox; XPCollection <Account> collection = new XPCollection <Account>(session); collection.SkipReturnedObjects = e.BeginIndex; collection.TopReturnedObjects = e.EndIndex - e.BeginIndex + 1; XPCollection <Account> _childAccount = AccountingBO.getNotParentAccountCollection(session); CriteriaOperator _filter = CriteriaOperator.Or( new BinaryOperator("AccountTypeId.AccountCategoryId.AccountCategoryId", Guid.Parse("A5FD76BB-F0D8-40F5-ADF8-6648804BDC62"), BinaryOperatorType.Equal), new BinaryOperator("AccountTypeId.AccountCategoryId.AccountCategoryId", Guid.Parse("387208A7-8D9E-49DA-8131-A83BA97B9D6B"), BinaryOperatorType.Equal), new BinaryOperator("AccountTypeId.AccountCategoryId.AccountCategoryId", Guid.Parse("FF561A7E-00D8-4596-B46A-29064BCB09D2"), BinaryOperatorType.Equal), new BinaryOperator("AccountTypeId.AccountCategoryId.AccountCategoryId", Guid.Parse("C1EC8F33-C4F6-4312-AE4A-6F8FD3A1F5DB"), BinaryOperatorType.Equal)); _childAccount.Filter = _filter; CriteriaOperator criteria = CriteriaOperator.And( CriteriaOperator.Or( new BinaryOperator("Code", String.Format("%{0}%", e.Filter), BinaryOperatorType.Like), new BinaryOperator("Name", String.Format("%{0}%", e.Filter), BinaryOperatorType.Like) ), new BinaryOperator("RowStatus", 1, BinaryOperatorType.GreaterOrEqual), new InOperator("this", _childAccount) ); collection.Criteria = criteria; collection.Sorting.Add(new SortProperty("Code", DevExpress.Xpo.DB.SortingDirection.Ascending)); comboItemUnit.DataSource = collection; comboItemUnit.DataBindItems(); }
protected void colSupplierCode_ItemsRequestedByFilterCondition(object source, DevExpress.Web.ASPxEditors.ListEditItemsRequestedByFilterConditionEventArgs e) { /* * ASPxComboBox combo = (ASPxComboBox)source; * * string sql = "select result.Code, result.Name" + * " from (select a.Code, b.Name, row_number() over(order by a.Code) as rowno" + * " from dbo.Supplier a, dbo.SupplierProperty b" + * " where a.SupplierId = b.SupplierId" + * " and b.Language = @lang" + * " and ((a.Code LIKE @filter or b.Name like @filter))) as result" + * " where result.rowno between @startIndex and @endIndex"; * * SupplierSDS.SelectCommand = sql; * * SupplierSDS.SelectParameters.Clear(); * SupplierSDS.SelectParameters.Add("filter", TypeCode.String, string.Format("%{0}%", e.Filter)); * SupplierSDS.SelectParameters.Add("startIndex", TypeCode.Int64, (e.BeginIndex + 1).ToString()); * SupplierSDS.SelectParameters.Add("endIndex", TypeCode.Int64, (e.EndIndex + 1).ToString()); * SupplierSDS.SelectParameters.Add("lang", TypeCode.String, "VN"); * * combo.DataSource = SupplierSDS; * combo.DataBind(); */ }