private void cboSystem_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e) { cboSystem.Items.Clear(); Facade.ImportMessage facImportMessages = new Facade.ImportMessage(); DataSet ds = facImportMessages.GetAllSystems(); int itemsPerRequest = 20; int itemOffset = e.NumberOfItems; int endOffset = itemOffset + itemsPerRequest; if (endOffset > ds.Tables[0].Rows.Count) { endOffset = ds.Tables[0].Rows.Count; } DataTable dt = ds.Tables[0]; Telerik.Web.UI.RadComboBoxItem rcItem = null; for (int i = itemOffset; i < endOffset; i++) { rcItem = new Telerik.Web.UI.RadComboBoxItem(); rcItem.Text = dt.Rows[i]["System"].ToString(); cboSystem.Items.Add(rcItem); } if (dt.Rows.Count > 0) { e.Message = string.Format("Items <b>1</b>-<b>{0}</b> out of <b>{1}</b>", endOffset.ToString(), dt.Rows.Count.ToString()); } //if (dt.Rows.Count > 0) // e.Message = string.Format("Items <b>1</b>-<b>{0}</b> out of <b>{1}</b>", endOffSet.ToString(), dt.Rows.Count.ToString()); }
public Controls_SpreadsheetWhere(string selected_condition_1st_field) { Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID]; if ((bool)State["IsFirstCommandCondition"]) { condition_operation.Items.Clear(); condition_operation.Items.Add(new Telerik.Web.UI.RadComboBoxItem("Where", "Where")); } ArrayList fields = (ArrayList)State["DataSourceDatabaseTableFields"]; bool is_found = false; foreach (string name in fields) { Telerik.Web.UI.RadComboBoxItem item = new Telerik.Web.UI.RadComboBoxItem(name, name); condition_1st_field.Items.Add(item); if (selected_condition_1st_field == name) { item.Selected = true; is_found = true; } } if (!is_found) { condition_1st_field.Items.Insert(0, new RadComboBoxItem("Select ->", "no_value")); condition_1st_field.SelectedIndex = 0; } }
private void Perfil_Cargar(int idEmpresa, string descripcion) { string ValorCero; PerfilWCFClient objPerfilWCF = new PerfilWCFClient(); List <Perfil_ListarResult> listPerfil = new List <Perfil_ListarResult>(); ValorCero = "SELECCIONAR"; cboPerfil.Items.Clear(); cboPerfil.Items.Insert(0, ValorCero); cboPerfil.Items.FindItemByText(ValorCero).Value = "0"; try { listPerfil = objPerfilWCF.Perfil_Listar(idEmpresa, "").ToList(); if (listPerfil.Count > 0) { foreach (Perfil_ListarResult objPerfil in listPerfil) { Telerik.Web.UI.RadComboBoxItem item = new Telerik.Web.UI.RadComboBoxItem(objPerfil.nombrePerfil.ToString().Trim(), objPerfil.idPerfil.ToString()); cboPerfil.Items.Add(item); } } } catch (Exception ex) { throw ex; } }
void cboResource_ItemsRequested(object o, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e) { cboResource.Items.Clear(); Facade.IResource facResource = new Facade.Resource(); DataSet ds = facResource.GetAllResourcesFiltered(e.Text, false, true); int itemsPerRequest = 20; int itemOffset = e.NumberOfItems; int endOffset = itemOffset + itemsPerRequest; if (endOffset > ds.Tables[0].Rows.Count) { endOffset = ds.Tables[0].Rows.Count; } DataTable dt = ds.Tables[0]; Telerik.Web.UI.RadComboBoxItem rcItem; for (int i = itemOffset; i < endOffset; i++) { rcItem = new Telerik.Web.UI.RadComboBoxItem(); rcItem.Text = dt.Rows[i]["Description"].ToString(); rcItem.Value = dt.Rows[i]["ResourceId"].ToString(); cboResource.Items.Add(rcItem); } if (dt.Rows.Count > 0) { e.Message = string.Format("Items <b>1</b>-<b>{0}</b> out of <b>{1}</b>", endOffset, dt.Rows.Count); } }
void cboTown_ItemsRequested(object o, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e) { cboTown.Items.Clear(); Orchestrator.Facade.IReferenceData facRefData = new Orchestrator.Facade.ReferenceData(); DataSet ds = facRefData.GetTownForTownName(e.Text); int itemsPerRequest = 20; int itemOffset = e.NumberOfItems; int endOffset = itemOffset + itemsPerRequest; if (endOffset > ds.Tables[0].Rows.Count) { endOffset = ds.Tables[0].Rows.Count; } DataTable dt = ds.Tables[0]; Telerik.Web.UI.RadComboBoxItem rcItem = null; for (int i = itemOffset; i < endOffset; i++) { rcItem = new Telerik.Web.UI.RadComboBoxItem(); rcItem.Text = dt.Rows[i]["Description"].ToString(); rcItem.Value = dt.Rows[i]["TownId"].ToString(); cboTown.Items.Add(rcItem); } if (dt.Rows.Count > 0) { e.Message = string.Format("Items <b>1</b>-<b>{0}</b> out of <b>{1}</b>", endOffset.ToString(), dt.Rows.Count.ToString()); } }
void cboOrganisation_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e) { Page.Response.Cache.SetCacheability(HttpCacheability.NoCache); RadComboBox cboOrganisation = (RadComboBox)o; cboOrganisation.Items.Clear(); Facade.IReferenceData facReferenceData = new Facade.ReferenceData(); DataSet dsOrganisationNames = facReferenceData.GetAllOrganisationsFiltered(e.Text, eOrganisationType.ClientCustomer); if (dsOrganisationNames.Tables[0].Rows.Count > 0) { int itemsToRequest = 20; if (dsOrganisationNames.Tables[0].Rows.Count < itemsToRequest) { itemsToRequest = dsOrganisationNames.Tables[0].Rows.Count; } Telerik.Web.UI.RadComboBoxItem rcItem = null; for (int rowIndex = 0; rowIndex < itemsToRequest; rowIndex++) { DataRow dr = dsOrganisationNames.Tables[0].Rows[rowIndex]; rcItem = new Telerik.Web.UI.RadComboBoxItem(); rcItem.Text = dr["OrganisationName"].ToString(); rcItem.Value = dr["IdentityID"].ToString(); cboOrganisation.Items.Add(rcItem); } } }
void cboSubContractor_ItemsRequested(object o, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e) { cboSubContractor.Items.Clear(); Orchestrator.Facade.IReferenceData facRefData = new Orchestrator.Facade.ReferenceData(); DataSet ds = facRefData.GetAllSubContractorsFiltered(e.Text, false); int itemsPerRequest = 20; int itemOffset = e.NumberOfItems; int endOffset = itemOffset + itemsPerRequest; if (endOffset > ds.Tables[0].Rows.Count) { endOffset = ds.Tables[0].Rows.Count; } DataTable dt = ds.Tables[0]; Telerik.Web.UI.RadComboBoxItem rcItem; for (int i = itemOffset; i < endOffset; i++) { rcItem = new Telerik.Web.UI.RadComboBoxItem(); rcItem.Text = dt.Rows[i]["OrganisationName"].ToString(); rcItem.Value = dt.Rows[i]["IdentityId"].ToString(); cboSubContractor.Items.Add(rcItem); } if (dt.Rows.Count > 0) { e.Message = string.Format("Items <b>1</b>-<b>{0}</b> out of <b>{1}</b>", endOffset, dt.Rows.Count); } }
void cboPoint_ItemsRequested(object o, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e) { Page.Response.Cache.SetCacheability(HttpCacheability.NoCache); cboPoint.Items.Clear(); int identityId = 0; string searchText = ""; if (e.Context["FilterString"] != null && e.Context["FilterString"].ToString() != "") { string[] values = e.Context["FilterString"].ToString().Split(';'); try { identityId = int.Parse(values[0]); } catch { } if (values.Length > 1 && values[1] != "false" && !string.IsNullOrEmpty(values[1])) { searchText = values[1]; } else if (!string.IsNullOrEmpty(e.Text)) { searchText = e.Text; } } else { searchText = e.Context["FilterString"].ToString(); } Orchestrator.Facade.IPoint facPoint = new Orchestrator.Facade.Point(); DataSet ds = facPoint.GetAllForOrganisation(identityId, ePointType.Any, 0, searchText); System.Diagnostics.Debug.Write(e.Value + " " + e.Text); int itemsPerRequest = 20; int itemOffset = e.NumberOfItems; int endOffset = itemOffset + itemsPerRequest; if (endOffset > ds.Tables[0].Rows.Count) { endOffset = ds.Tables[0].Rows.Count; } DataTable dt = ds.Tables[0]; Telerik.Web.UI.RadComboBoxItem rcItem = null; for (int i = itemOffset; i < endOffset; i++) { rcItem = new Telerik.Web.UI.RadComboBoxItem(); rcItem.Text = dt.Rows[i]["Description"].ToString(); rcItem.Value = dt.Rows[i]["PointId"].ToString(); cboPoint.Items.Add(rcItem); } if (dt.Rows.Count > 0) { e.Message = string.Format("Items <b>1</b>-<b>{0}</b> out of <b>{1}</b>", endOffset.ToString(), dt.Rows.Count.ToString()); } }
private void PopulateCountryCombo() { this.cboCountry.Items.Clear(); Orchestrator.Facade.IReferenceData facRef = new Orchestrator.Facade.ReferenceData(); DataSet countries = facRef.GetAllCountries(); foreach (DataRow row in countries.Tables[0].Rows) { Telerik.Web.UI.RadComboBoxItem rcItem = new Telerik.Web.UI.RadComboBoxItem(); rcItem.Text = row["CountryDescription"].ToString(); rcItem.Value = row["CountryId"].ToString(); this.cboCountry.Items.Add(rcItem); } }
void cboTown_ItemsRequested(object o, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e) { cboTown.Items.Clear(); int countryId = 1; //UK if (e.Context["FilterString"] != null && e.Context["FilterString"].ToString().ToLower().IndexOf("countryid=") > -1) { string countryIdString = e.Context["FilterString"].ToString().ToLower().Replace("countryid=", ""); countryIdString = countryIdString.Substring(0, countryIdString.IndexOf(';')); countryId = Convert.ToInt32(countryIdString); } Orchestrator.Facade.IReferenceData facRefData = new Orchestrator.Facade.ReferenceData(); DataSet ds = facRefData.GetTownForTownNameAndCountry(e.Text, countryId); int itemsPerRequest = 20; int itemOffset = e.NumberOfItems; int endOffset = itemOffset + itemsPerRequest; if (endOffset > ds.Tables[0].Rows.Count) { endOffset = ds.Tables[0].Rows.Count; } DataTable dt = ds.Tables[0]; Telerik.Web.UI.RadComboBoxItem rcItem = null; for (int i = itemOffset; i < endOffset; i++) { rcItem = new Telerik.Web.UI.RadComboBoxItem(); rcItem.Text = dt.Rows[i]["Description"].ToString(); rcItem.Value = dt.Rows[i]["TownId"].ToString(); cboTown.Items.Add(rcItem); } if (dt.Rows.Count > 0) { e.Message = string.Format("Items <b>1</b>-<b>{0}</b> out of <b>{1}</b>", endOffset.ToString(), dt.Rows.Count.ToString()); } else { this.cboTown.Text = String.Empty; } }
private void CargarComboTipoU_Autoriza3() { try { CapaNegocios.CN__Comun CN_Comun = new CapaNegocios.CN__Comun(); Sesion Sesion = new Sesion(); Sesion = (Sesion)Session["Sesion" + Session.SessionID]; CN_Comun.LlenaCombo(1, Sesion.Id_Emp, Sesion.Emp_Cnx, "SpSysTipoUsuario_Combo", ref this.cmbAutoriza3); //Comentado porque ya no hay usuarios que dependan del administrador Telerik.Web.UI.RadComboBoxItem item = new Telerik.Web.UI.RadComboBoxItem(); item.Value = "0"; item.Text = "-- Seleccionar --"; } catch (Exception ex) { throw ex; } }
public void LlenaComboTabla(Int32 Id1, Int32 Id2, Int32 Id3, string conexion, string SP, ref Telerik.Web.UI.RadComboBox RadComboBox) { try { System.Collections.Generic.List <Comun> Lista = new System.Collections.Generic.List <Comun>(); CapaDatos.CD__Comun claseCapaDatos = new CapaDatos.CD__Comun(); claseCapaDatos.LlenaComboTabla(Id1, Id2, Id3, SP, conexion, ref Lista); for (Int32 i = 0; i <= Lista.Count - 1; i++) { Telerik.Web.UI.RadComboBoxItem Item = new Telerik.Web.UI.RadComboBoxItem(); Item.Value = Lista[i].Id.ToString(); Item.Text = Lista[i].Descripcion; RadComboBox.Items.Add(Item); } } catch (Exception ex) { throw ex; } }
public Controls_DatabaseToDeviceField(string selected_database_field) { Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID]; ArrayList fields = (ArrayList)State["DataSourceDatabaseTableFields"]; bool is_found = false; foreach (string name in fields) { RadComboBoxItem item = new Telerik.Web.UI.RadComboBoxItem(name, name); database_field.Items.Add(item); if (selected_database_field == name) { item.Selected = true; is_found = true; } } if (!is_found) { database_field.Items.Insert(0, new RadComboBoxItem("Select ->", "no_value")); database_field.SelectedIndex = 0; } }
protected void cboDriver_ItemsRequested(object sender, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e) { Page.Response.Cache.SetCacheability(HttpCacheability.NoCache); ((Telerik.Web.UI.RadComboBox)sender).Items.Clear(); Facade.IResource facResource = new Facade.Resource(); DataSet ds = null; #region Get ControlArea and Traffic Area // As thgis is only set when there is no call back or post back we need to get the correct values #endregion ds = facResource.GetAllResourcesFiltered("%" + e.Text, eResourceType.Driver, false); int itemsPerRequest = 30; int itemOffset = e.NumberOfItems; int endOffset = itemOffset + itemsPerRequest; if (endOffset > ds.Tables[0].Rows.Count) { endOffset = ds.Tables[0].Rows.Count; } DataTable dt = ds.Tables[0]; Telerik.Web.UI.RadComboBoxItem rcItem = null; for (int i = itemOffset; i < endOffset; i++) { rcItem = new Telerik.Web.UI.RadComboBoxItem(); rcItem.Text = dt.Rows[i]["Description"].ToString(); rcItem.Value = dt.Rows[i]["ResourceId"].ToString(); ((Telerik.Web.UI.RadComboBox)sender).Items.Add(rcItem); } if (dt.Rows.Count > 0) { e.Message = string.Format("Items <b>1</b>-<b>{0}</b> out of <b>{1}</b>", endOffset.ToString(), dt.Rows.Count.ToString()); } }
protected void BindAlerts() { try { txtComments.Visible = false; RequiredFieldValidator11.Enabled = false; RequiredFieldValidator11.ValidationGroup = string.Empty; BECommon objBEComon = new BECommon(); BCommon objBCommon = new BCommon(); objBEComon.intRoleID = Convert.ToInt32(Session["RoleID"].ToString()); objBCommon.BGetAlerts(objBEComon); ddlAlerts.AppendDataBoundItems = true; Telerik.Web.UI.RadComboBoxItem item = new Telerik.Web.UI.RadComboBoxItem("--Please select--", "0"); ddlAlerts.Items.Add(item); ddlAlerts.DataSource = objBEComon.DtResult; ddlAlerts.DataValueField = "AlertID"; ddlAlerts.DataTextField = "AlertText"; ddlAlerts.DataBind(); } catch { } }
public Controls_DatabaseCommand(string selected_table_name) { Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID]; ArrayList tables = (ArrayList)State["DataSourceDatabaseTables"]; table.Items.Clear(); bool is_found = false; foreach (string name in tables) { Telerik.Web.UI.RadComboBoxItem item = new Telerik.Web.UI.RadComboBoxItem(name, name); table.Items.Add(item); if (selected_table_name == name) { item.Selected = true; is_found = true; } } if (!is_found) { table.Items.Insert(0, new RadComboBoxItem("Select ->", "no_value")); table.SelectedIndex = 0; } }
protected void RadAjaxPanel_AnswerWindow_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e) { Int32 Index = -1; Int64 Key = 0; if (e.Argument != string.Empty) { Index = Layer01_Common.Common.Methods.Convert_Int32(e.Argument); try { Key = Layer01_Common.Common.Methods.Convert_Int64(this.RadGrid1.MasterTableView.Items[Index].GetDataKeyValue("TmpKey").ToString()); } catch { } } bool IsNew = false; if (Key != 0) { Layer02_Objects.Modules_Objects.ClsQuestion Obj = (Layer02_Objects.Modules_Objects.ClsQuestion)this.mObj_Base; Layer02_Objects.Modules_Objects.ClsAnswer Obj_Answer = null; System.Data.DataRow Dr_QA = null; System.Data.DataRow[] Arr_Dr = Obj.pDt_QuestionAnswer.Select("TmpKey = " + Key); if (Arr_Dr.Length > 0) { Dr_QA = Arr_Dr[0]; Obj_Answer = (Layer02_Objects.Modules_Objects.ClsAnswer)Obj.pBO_Answer[Key.ToString()]; this.RadWindow1_Hid_TmpKey.Value = Key.ToString(); Telerik.Web.UI.RadComboBoxItem Ci = new Telerik.Web.UI.RadComboBoxItem( (string)Layer01_Common.Common.Methods.IsNull(Obj_Answer.pDr["Answer"], "") , Convert.ToInt64(Layer01_Common.Common.Methods.IsNull(Obj_Answer.pDr["RecruitmentTestAnswersID"], 0)).ToString()); this.RadWindow1_RadComboBox1.Items.Clear(); this.RadWindow1_RadComboBox1.Items.Add(Ci); this.RadWindow1_RadComboBox1.SelectedIndex = 0; this.RadWindow1_RadComboBox1.Text = Ci.Text; this.RadWindow1_Chk_IsAnswer.Checked = (bool)Layer01_Common.Common.Methods.IsNull(Dr_QA["IsAnswer"], false); } else { IsNew = true; } } else { IsNew = true; } if (IsNew) { this.RadWindow1_Hid_TmpKey.Value = string.Empty; this.RadWindow1_RadComboBox1.Items.Clear(); this.RadWindow1_RadComboBox1.Text = string.Empty; this.RadWindow1_Chk_IsAnswer.Checked = false; } }
/// <summary> /// Populate Static Controls /// </summary> private void PopulateStaticControls() { if (Orchestrator.Globals.Configuration.FleetMetrikInstance) { OnlyEnableFleetMetrikFields(); } cboTitle.DataSource = Utilities.UnCamelCase(Enum.GetNames(typeof(eTitle))); cboTitle.DataBind(); IDriver facDriver = new Facade.Resource(); cboDriverType.DataSource = facDriver.GetAllDriverTypes(); cboDriverType.DataTextField = "Description"; cboDriverType.DataValueField = "DriverTypeID"; cboDriverType.DataBind(); cboDriverType.Items.Insert(0, new ListItem("--- [ Please Select ] ---", "")); // Configure the attributes for the address target textboxes. txtAddressLine1.Attributes.Add("onfocus", "this.blur();" + txtPostCode.ClientID + ".focus();"); txtAddressLine2.Attributes.Add("onfocus", "this.blur();" + txtPostCode.ClientID + ".focus();"); txtAddressLine3.Attributes.Add("onfocus", "this.blur();" + txtPostCode.ClientID + ".focus();"); txtPostTown.Attributes.Add("onfocus", "this.blur();" + txtPostCode.ClientID + ".focus();"); txtCounty.Attributes.Add("onfocus", "this.blur();" + txtPostCode.ClientID + ".focus();"); IVehicle facVehicle = new Facade.Resource(); var dsVehicles = facVehicle.GetAllVehicles(); cboVehicle.DataSource = dsVehicles; cboVehicle.DataTextField = "RegNo"; cboVehicle.DataValueField = "ResourceId"; cboVehicle.DataBind(); cboVehicle.Items.Insert(0, new ListItem("--- [ Please Select ] ---", "-1")); IOrganisationLocation facOrganiastionLocation = new Facade.Organisation(); cboDepot.DataSource = facOrganiastionLocation.GetAllDepots(Configuration.IdentityId); cboDepot.DataValueField = "OrganisationLocationId"; cboDepot.DataTextField = "OrganisationLocationName"; cboDepot.DataBind(); cboDepot.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("--- [ Please Select ] ---")); IControlArea facControlArea = new Facade.Traffic(); cboControlArea.DataSource = facControlArea.GetAll(); cboControlArea.DataTextField = "Description"; cboControlArea.DataValueField = "ControlAreaId"; cboControlArea.DataBind(); cboControlArea.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("--- [ Please Select ] ---")); var facTrafficArea = (ITrafficArea)facControlArea; cboTrafficArea.DataSource = facTrafficArea.GetAll(); cboTrafficArea.DataTextField = "Description"; cboTrafficArea.DataValueField = "TrafficAreaId"; cboTrafficArea.DataBind(); cboTrafficArea.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("--- [ Please Select ] ---")); this.dteDOB.MinDate = new DateTime(1900, 1, 1); IUser facUser = new Facade.User(); cboDriverPlanner.DataSource = facUser.GetAllUsersInRole(eUserRole.Planner); cboDriverPlanner.DataValueField = "IdentityID"; cboDriverPlanner.DataTextField = "FullName"; cboDriverPlanner.DataBind(); cboDriverPlanner.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("--- [ Please Select ] ---")); //Load Agencies using (var uow = DIContainer.CreateUnitOfWork()) { var agenciesRepo = DIContainer.CreateRepository <IAgencyRepository>(uow); var agencies = agenciesRepo.GetAgencies(); foreach (var ag in agencies) { var rcItem = new Telerik.Web.UI.RadComboBoxItem(); rcItem.Text = ag.Name; rcItem.Value = ag.AgencyId.ToString(); cboAgency.Items.Add(rcItem); } } InitialiseTelematicsSolution(); BindDriverCommunicationTypes(); }