protected void dxcbotitle_ItemRequestedByValue(object source, DevExpress.Web.ASPxEditors.ListEditItemRequestedByValueEventArgs e) { ASPxComboBox _combo = ((ASPxComboBox)this.dxgridTitles.FindEditRowCellTemplateControl( this.dxgridTitles.Columns["colTitle"] as GridViewDataComboBoxColumn, "dxcbotitle")); Int32 _id = 0; if (e.Value != null) { _id = wwi_func.vint(e.Value.ToString()); } //use datareaders - much faster than loading into collections string[] _cols = { "ItemTable.TitleID, ItemTable.Title" }; SubSonic.SqlQuery _query = new SubSonic.SqlQuery(); _query = DAL.Logistics.DB.Select(_cols).From(DAL.Logistics.Tables.ItemTable).WhereExpression("TitleID").IsEqualTo(_id); IDataReader _rd = _query.ExecuteReader(); _combo.DataSource = _rd; _combo.ValueField = "TitleID"; _combo.ValueType = typeof(Int32); _combo.TextField = "Title"; _combo.DataBind(); }
protected void colSupplierCode_ItemRequestedByValue(object source, DevExpress.Web.ASPxEditors.ListEditItemRequestedByValueEventArgs e) { ASPxComboBox combo = (ASPxComboBox)source; if (e.Value == null) { return; } string sql = "select result.Code, result.Name" + " from (select a.Code, b.Name" + " from dbo.Supplier a, dbo.SupplierProperty b" + " where a.SupplierId = b.SupplierId" + " and b.Language = @lang" + " and ((a.Code = @filter))) as result"; SupplierSDS.SelectCommand = sql; SupplierSDS.SelectParameters.Clear(); SupplierSDS.SelectParameters.Add("filter", TypeCode.String, e.Value.ToString()); SupplierSDS.SelectParameters.Add("lang", TypeCode.String, "VN"); combo.DataSource = SupplierSDS; combo.DataBind(); }
protected void dxcbocompany_ItemRequestedByValue(object source, DevExpress.Web.ASPxEditors.ListEditItemRequestedByValueEventArgs e) { DevExpress.Web.ASPxEditors.ASPxComboBox _combo = (DevExpress.Web.ASPxEditors.ASPxComboBox)source; Int32 _id = 0; //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) // { if (e.Value != null) { _id = wwi_func.vint(e.Value.ToString()); } //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).WhereExpression("CompanyID").IsEqualTo(_id); SubSonic.SqlQuery _query = DAL.Logistics.DB.Select(_cols).From("view_delivery_address").WhereExpression("CompanyID").IsEqualTo(_id); IDataReader _rd = _query.ExecuteReader(); _combo.DataSource = _rd; _combo.ValueField = "CompanyID"; _combo.ValueType = typeof(int); _combo.TextField = "CompanyName"; _combo.DataBindItems(); // } //} }
protected void dxcbocompany_ItemRequestedByValue(object source, DevExpress.Web.ASPxEditors.ListEditItemRequestedByValueEventArgs e) { //check value of e //when itemrequestedby fucntionality is being used in the grid edit template this will not be set when a new record is initialised //and will display as a js error "obejct reference not set to an instance of an object". //You can verify this by setting the ASPxGridView.EnableCallBacks property to "false" //this will then display the server error page not the js error message if (e.Value != null) { DevExpress.Web.ASPxEditors.ASPxComboBox _combo = (DevExpress.Web.ASPxEditors.ASPxComboBox)source; Int32 _id = 0; //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) // { _id = wwi_func.vint(e.Value.ToString()); //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).WhereExpression("CompanyID").IsEqualTo(_id); SubSonic.SqlQuery _query = DAL.Logistics.DB.Select(_cols).From("view_delivery_address").WhereExpression("CompanyID").IsEqualTo(_id); IDataReader _rd = _query.ExecuteReader(); _combo.DataSource = _rd; _combo.ValueField = "CompanyID"; _combo.TextField = "CompanyName"; _combo.DataBindItems(); // } //} } }
protected void combo_ItemRequestedByValue(object source, DevExpress.Web.ASPxEditors.ListEditItemRequestedByValueEventArgs e) { if (AccountActorComboBoxStrategy == null) { return; } AccountActorComboBoxStrategy.ItemRequestedByValue(session, source, e); }
protected void cboSourceOrganization_ItemRequestedByValue(object source, DevExpress.Web.ASPxEditors.ListEditItemRequestedByValueEventArgs e) { Organization obj = session.GetObjectByKey <Organization>(e.Value); if (obj != null) { cboSourceOrganization.DataSource = new Organization[] { obj }; cboSourceOrganization.DataBindItems(); } }
protected void combo_ItemRequestedByValue(object source, DevExpress.Web.ASPxEditors.ListEditItemRequestedByValueEventArgs e) { string value = e.Value == null ? String.Empty : e.Value.ToString(); if (e.Value != null) { conditionTemplate = "WHERE [ProductID] = {0}"; } BindComboBox(source, value, 0, 1); }
public void ItemRequestedByValue(Session session, object source, DevExpress.Web.ASPxEditors.ListEditItemRequestedByValueEventArgs e) { ASPxComboBox combo = source as ASPxComboBox; Organization obj = session.GetObjectByKey <Organization>(e.Value); if (obj != null) { combo.DataSource = new Organization[] { obj }; combo.DataBindItems(); } }
protected void cbIdentifIdentAte_ItemRequestedByValue(object source, DevExpress.Web.ASPxEditors.ListEditItemRequestedByValueEventArgs e) { if (e.Value == null || Convert.ToString(e.Value) == string.Empty) { return; } ASPxComboBox comboBox = (ASPxComboBox)source; var daoIdentAtencion = BusinessMapper.GetDaoByEntity(BusinessMapper.eEntities.IdentAtencion); comboBox.DataSource = daoIdentAtencion.FindValue(Convert.ToString(e.Value)); comboBox.DataBind(); }
protected void cboBalanceInitAccount_ItemRequestedByValue(object source, DevExpress.Web.ASPxEditors.ListEditItemRequestedByValueEventArgs e) { ASPxComboBox combo = source as ASPxComboBox; if (e.Value == null) { return; } Account obj = session.GetObjectByKey <Account>(Guid.Parse(e.Value.ToString())); if (obj != null) { combo.DataSource = new Account[] { obj }; combo.DataBindItems(); } }
protected void cboBalanceInitCurrency_ItemRequestedByValue(object source, DevExpress.Web.ASPxEditors.ListEditItemRequestedByValueEventArgs e) { ASPxComboBox comboBox = (ASPxComboBox)source; try { NAS.DAL.Accounting.Currency.Currency obj = session.GetObjectByKey <NAS.DAL.Accounting.Currency.Currency>(Guid.Parse(e.Value.ToString())); if (obj != null) { comboBox.DataSource = new NAS.DAL.Accounting.Currency.Currency[] { obj }; comboBox.DataBindItems(); } } catch { } }
protected void cboItem_ItemRequestedByValue(object source, DevExpress.Web.ASPxEditors.ListEditItemRequestedByValueEventArgs e) { ASPxComboBox comboItemUnit = source as ASPxComboBox; try { BillItem obj = session.GetObjectByKey <BillItem>(Guid.Parse(e.Value.ToString())); if (obj != null) { comboItemUnit.DataSource = new BillItem[] { obj }; comboItemUnit.DataBindItems(); } } catch { } }
protected void colAccount_OnItemRequestedByValue(object source, DevExpress.Web.ASPxEditors.ListEditItemRequestedByValueEventArgs e) { ASPxComboBox comboBox = (ASPxComboBox)source; try { Account obj = m_Session.GetObjectByKey <Account>(Guid.Parse(e.Value.ToString())); if (obj != null) { comboBox.DataSource = new Account[] { obj }; comboBox.DataBindItems(); } } catch { } }
protected void cboManufacturer_ItemRequestedByValue(object source, DevExpress.Web.ASPxEditors.ListEditItemRequestedByValueEventArgs e) { if (e.Value == null) { return; } string sql = "select result.Code, result.Name" + " from (select a.Code, b.Name" + " from dbo.Manufacturer a, dbo.ManufacturerProperty b" + " where a.ManufacturerId = b.ManufacturerId" + " and b.Language = @lang" + " and ((a.Code = @filter))) as result"; ManufacturerSDS.SelectCommand = sql; ManufacturerSDS.SelectParameters.Add("filter", TypeCode.String, e.Value.ToString()); ManufacturerSDS.SelectParameters.Add("lang", TypeCode.String, "VN"); }
protected void ComboCompanyList_ItemRequestedByValue(object source, DevExpress.Web.ASPxEditors.ListEditItemRequestedByValueEventArgs e) { ASPxComboBox comboBox = (ASPxComboBox)source; SQLDsClientProfile.ConnectionString = (new igFunctions.DB().getConStr()); long value = 0; string Qry = string.Empty; if (e.Value == null || !Int64.TryParse(e.Value.ToString(), out value)) { if (rate_type == 4) { Qry = SQLConstants.SELECT_LIST_ORGANIZATION_ALL; } else { Qry = SQLConstants.SELECT_LIST_ORGANIZATION_AGENT; } SQLDsClientProfile.SelectCommand = Qry; SQLDsClientProfile.SelectParameters.Clear(); SQLDsClientProfile.SelectParameters.Add("elt_account_number", TypeCode.Int32, elt_account_number.ToString()); SQLDsClientProfile.SelectParameters.Add("startIndex", TypeCode.Int64, "1"); SQLDsClientProfile.SelectParameters.Add("endIndex", TypeCode.Int64, "10"); comboBox.DataBind(); } else { if (rate_type == 4) { Qry = SQLConstants.SELECT_LIST_ORGANIZATION_FOR_VALUE; } else { Qry = SQLConstants.SELECT_LIST_ORGANIZATION_AGENT_FOR_VALUE; } SQLDsClientProfile.SelectCommand = Qry; SQLDsClientProfile.SelectParameters.Clear(); SQLDsClientProfile.SelectParameters.Add("elt_account_number", TypeCode.Int32, elt_account_number.ToString()); SQLDsClientProfile.SelectParameters.Add("org_account_number", TypeCode.Int64, e.Value.ToString()); comboBox.DataBind(); } }
protected void dxcboVesselID_ItemRequestedByValue(object source, DevExpress.Web.ASPxEditors.ListEditItemRequestedByValueEventArgs e) { DevExpress.Web.ASPxEditors.ASPxComboBox _combo = (DevExpress.Web.ASPxEditors.ASPxComboBox)source; Int32 _id = 0; if (e.Value != null) { _id = wwi_func.vint(e.Value.ToString()); } //use datareaders - much faster than loading into collections string[] _cols = { "VoyageID", "Joined", "ETS", "ETA", "DestinationPortID", "OriginPortID" }; //SubSonic.SqlQuery _query = DAL.Logistics.DB.Select(_cols).From(DAL.Logistics.Tables.NameAndAddressBook).WhereExpression("CompanyID").IsEqualTo(_id); SubSonic.SqlQuery _query = DAL.Logistics.DB.Select(_cols).From("Page2VesselView").WhereExpression("VoyageID").IsEqualTo(_id); IDataReader _rd = _query.ExecuteReader(); _combo.DataSource = _rd; _combo.ValueField = "VoyageID"; _combo.TextField = "Joined"; _combo.DataBindItems(); }
protected void cboManufacturerProduct_ItemRequestedByValue(object source, DevExpress.Web.ASPxEditors.ListEditItemRequestedByValueEventArgs e) { /* * if (e.Value == null) * { * return; * } * * string sql = "select result.Code, result.Name" + * " from (select a.Code, b.Name" + * " from dbo.Manufacturer a, dbo.ManufacturerProperty b" + * " where a.ManufacturerId = b.ManufacturerId" + * " and b.Language = @lang" + * " and ((a.Code = @filter))) as result"; * * ManufacturerSDS.SelectCommand = sql; * * ManufacturerSDS.SelectParameters.Add("filter", TypeCode.String, e.Value.ToString()); * ManufacturerSDS.SelectParameters.Add("lang", TypeCode.String, "VN"); * * cboManufacturer.DataSource = ManufacturerSDS; * cboManufacturer.DataBind(); */ }
public override void ComboBoxItem_ItemRequestedByValue(DevExpress.Xpo.Session session, object source, DevExpress.Web.ASPxEditors.ListEditItemRequestedByValueEventArgs e) { ASPxComboBox combo = source as ASPxComboBox; Item obj = session.GetObjectByKey <Item>(e.Value); if (obj != null) { combo.DataSource = new Item[] { obj }; combo.DataBindItems(); } }
/////////////////////////////////PartnerCategory public void cboPartnerCategory_ItemRequestedByValue(object source, DevExpress.Web.ASPxEditors.ListEditItemRequestedByValueEventArgs e) { }
public void ProductUnitItemRequestedByValue(object source, DevExpress.Web.ASPxEditors.ListEditItemRequestedByValueEventArgs e) { }
public void BuyingProductCategoryItemRequestedByValue(object source, DevExpress.Web.ASPxEditors.ListEditItemRequestedByValueEventArgs e) { }