// Token: 0x060027F1 RID: 10225 RVA: 0x000E220C File Offset: 0x000E040C protected void RenderPhoneProperties() { int num = ContactUtilities.PhoneNumberProperties.Length; DropDownListItem[] array = new DropDownListItem[num]; StringBuilder stringBuilder = new StringBuilder(); for (int i = 0; i < num; i++) { ContactPropertyInfo contactPropertyInfo = ContactUtilities.PhoneNumberProperties[i]; string propertyValue = this.GetPropertyValue(contactPropertyInfo.PropertyDefinition); stringBuilder.Append("<input id=\""); stringBuilder.Append(contactPropertyInfo.Id); stringBuilder.Append("\""); array[i] = new DropDownListItem(contactPropertyInfo.Id, contactPropertyInfo.Label, "drp_" + contactPropertyInfo.Id, !string.IsNullOrEmpty(propertyValue.Trim())); if (contactPropertyInfo != this.firstPhoneProperty) { stringBuilder.Append(" style=\"display:none\""); } stringBuilder.Append(" maxlength=\"256\" class=\"cntWell\" type=\"text\" value=\""); stringBuilder.Append(Utilities.HtmlEncode(propertyValue)); stringBuilder.Append("\">"); } base.Response.Write("<div class=\"cntLabelCombo\">"); DropDownList dropDownList = new DropDownList("divPH", this.firstPhoneProperty.Id, array); dropDownList.Render(base.Response.Output); base.Response.Write("</div><div class=\"cntField\">"); base.Response.Write(stringBuilder); base.Response.Write("</div>"); }
// Token: 0x06002BB7 RID: 11191 RVA: 0x000F4688 File Offset: 0x000F2888 private static SanitizedHtmlString BuildDayDropdownList(DaysOfWeek daysOfWeek) { string[] dayNames = CultureInfo.CurrentCulture.DateTimeFormat.DayNames; DropDownListItem[] listItems = new DropDownListItem[] { new DropDownListItem(127, 696030412), new DropDownListItem(62, 394490012), new DropDownListItem(65, 1137128015), new DropDownListItem(1, dayNames[0]), new DropDownListItem(2, dayNames[1]), new DropDownListItem(4, dayNames[2]), new DropDownListItem(8, dayNames[3]), new DropDownListItem(16, dayNames[4]), new DropDownListItem(32, dayNames[5]), new DropDownListItem(64, dayNames[6]) }; SanitizingStringWriter <OwaHtml> sanitizingStringWriter = new SanitizingStringWriter <OwaHtml>(); sanitizingStringWriter.Write("</div><div class=\"fltBefore rcrDropdown recurrenceDialogText\">"); TextWriter writer = sanitizingStringWriter; string id = "divDLst"; int num = (int)daysOfWeek; DropDownList.RenderDropDownList(writer, id, num.ToString(CultureInfo.InvariantCulture), listItems); sanitizingStringWriter.Write("</div><div class=\"fltBefore recurrenceDialogText\">"); sanitizingStringWriter.Close(); return(sanitizingStringWriter.ToSanitizedString <SanitizedHtmlString>()); }
public IList <ComplexDataViewModel> GetData() { if (dtmStart.SelectedDate != null && dtmEnd.SelectedDate != null) { DateTime startDate = (DateTime)dtmStart.SelectedDate; DateTime endDate = (DateTime)dtmEnd.SelectedDate; List <string> loggerIds = new List <string>(); DropDownListItem selectedItem = DropDownSite.SelectedItem; loggerIds.Add(_siteBL.GetSite(selectedItem.Value).LoggerId); var listDailyComplexData = _complexDataHelper.GetDailyComplexData_Multiple(loggerIds, startDate, endDate); //var tempMaxFlow = listDailyComplexData.Max(d => d.MaxFlowRate); //var maxFlow = listDailyComplexData.Where(d => d.MaxFlowRate == tempMaxFlow).ToList(); //var tempMinFlow = listDailyComplexData.Min(d => d.MinFlowRate); //var minFlow = listDailyComplexData.Where(d => d.MinFlowRate == tempMinFlow).ToList(); //var tempMaxPress = listDailyComplexData.Max(d => d.MaxPressure); //var maxPress = listDailyComplexData.Where(d => d.MaxPressure == tempMaxPress).ToList(); //var tempMinPress = listDailyComplexData.Min(d => d.MinPressure); //var minPress = listDailyComplexData.Where(d => d.MinPressure == tempMinPress).ToList(); return(listDailyComplexData); } else { return(null); } }
// Token: 0x06002BB8 RID: 11192 RVA: 0x000F47AC File Offset: 0x000F29AC private static SanitizedHtmlString BuildMonthDropdownList() { string[] monthNames = CultureInfo.CurrentCulture.DateTimeFormat.MonthNames; DropDownListItem[] listItems = new DropDownListItem[] { new DropDownListItem("1", monthNames[0]), new DropDownListItem("2", monthNames[1]), new DropDownListItem("3", monthNames[2]), new DropDownListItem("4", monthNames[3]), new DropDownListItem("5", monthNames[4]), new DropDownListItem("6", monthNames[5]), new DropDownListItem("7", monthNames[6]), new DropDownListItem("8", monthNames[7]), new DropDownListItem("9", monthNames[8]), new DropDownListItem("10", monthNames[9]), new DropDownListItem("11", monthNames[10]), new DropDownListItem("12", monthNames[11]) }; SanitizingStringWriter <OwaHtml> sanitizingStringWriter = new SanitizingStringWriter <OwaHtml>(); sanitizingStringWriter.Write("</div><div class=\"fltBefore rcrDropdown recurrenceDialogText\">"); DropDownList.RenderDropDownList(sanitizingStringWriter, "divMLst", "1", listItems); sanitizingStringWriter.Write("</div><div class=\"fltBefore recurrenceDialogText\" id=\"divRcrDayInput\">"); sanitizingStringWriter.Close(); return(sanitizingStringWriter.ToSanitizedString <SanitizedHtmlString>()); }
private IEnumerator GetPatientsFromDoc(string id) { Debug.Log("Obteniendo pacientes del Doc."); string urlString = _postURL1 + "?" + "id_doc=" + WWW.EscapeURL(id); WWW postName = new WWW(urlString); yield return(postName); Debug.Log("Pacientes:" + postName.text.ToString() + "FIN"); //namesP = postName.text.ToString (); string[] patients = postName.text.ToString().Split(';'); foreach (string p in patients) { if (p.Length > 2) { Debug.Log(p + "paciente"); DropDownListItem etemporal = new DropDownListItem(); etemporal.Caption = p.ToString().Substring(0, p.LastIndexOf("_")); //aaqui tengo que poner el id del paceinte etemporal.ID = p.ToString().Substring(p.LastIndexOf("_") + 1); pacientes.Items.Add(etemporal); } } Debug.Log(postName); Debug.Log("termine"); pacientes.RebuildPanel(); Debug.Log("termine"); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { DropDownListinvoicetype.DataSource = DB.Invoice_Ts.Where(a => a.IsDisable.Equals(false)).Select(a => new { ID = a.Invoice_T_Id, name = a.Invoice_T_Name }); DropDownListinvoicetype.DataBind(); if (DropDownListinvoicetype.SelectedValue == "1") { DropDownListcontac.DataSource = DB.Contact2s.Where(a => a.IsDisable.Equals(false) && a.Client_Type.Equals(1)).Select(a => new { ID = a.Contact_Id, name = a.Contact_Name }); DropDownListcontac.DataBind(); DropDownListcontacttype2.SelectedValue = "1"; } else if (DropDownListinvoicetype.SelectedValue == "2") { DropDownListcontac.DataSource = DB.Contact2s.Where(a => a.IsDisable.Equals(false) && a.Client_Type.Equals(3)).Select(a => new { ID = a.Contact_Id, name = a.Contact_Name }); DropDownListcontac.DataBind(); DropDownListcontacttype2.SelectedValue = "3"; } DropDownListItem.DataSource = DB.Items.Where(a => a.IsDisable.Equals(false)).Select(a => new { ID = a.Items_Id, Name = a.Items_Name }); DropDownListItem.DataBind(); DropDownListItem.Items.Insert(0, new ListItem("Choose", "0")); DropDownListcontac.Items.Insert(0, new ListItem("Choose", "0")); DropDownListcontacttype2.DataSource = DB.Contat_Ts.Where(a => a.IsDisable.Equals(false)).Select(a => new { a.Contat_T_Id, a.Contat_T_Name }); DropDownListcontacttype2.DataBind(); } }
public ActionResult GetPreviewImage(int page) { if (sessionService.LastGeneratedReport == null) { var closedErfassungsperiodenDropDownItems = reportControllerService.GetClosedErfassungsperiodenDropDownItems <TReportParameter, TPresentationObject>(); DropDownListItem erfassungsPeriodDropDownItem = closedErfassungsperiodenDropDownItems.SingleOrDefault(ep => ep.Selected); var emsgPoProvider = GetPoProviderForPreview(new TReportParameter { ErfassungsPeriodId = erfassungsPeriodDropDownItem == null ? (Guid?)null : new Guid(erfassungsPeriodDropDownItem.Value), IsPreview = true }); sessionService.LastGeneratedReport = serverReportGenerator.GenerateReport(emsgPoProvider); } var pngStream = new MemoryStream(); PreviewPages[page].Save(pngStream, ImageFormat.Png); pngStream.Seek(0, 0); return(File(pngStream.ToArray(), "image/png")); }
/// <summary> /// Defines a item. /// </summary> /// <returns></returns> public DropDownListItemBuilder Add() { DropDownListItem item = new DropDownListItem(); container.Add(item); return new DropDownListItemBuilder(item); }
/// <summary> /// Defines a item. /// </summary> /// <returns></returns> public DropDownListItemBuilder Add() { DropDownListItem item = new DropDownListItem(); container.Add(item); return(new DropDownListItemBuilder(item)); }
//protected void SetInterval(object sender, EventArgs e) //{ //} protected void ddlBelgeTipleriPopulate() { EFDal ed = new EFDal(); ddlDokumanTipi.DataSource = ed.ImzaliDokumanTipleriDon(); ddlDokumanTipi.DataValueField = "Id"; ddlDokumanTipi.DataTextField = "DokumanTipiAdi"; ddlDokumanTipi.DataBind(); DropDownListItem li = new DropDownListItem(); li.Value = "0"; li.Text = "Lütfen göndereceğiniz doküman tipini seçiniz"; ddlDokumanTipi.Items.Insert(0, li); }
void ObtieneRutinas() { DirectoryInfo dir = new DirectoryInfo(GameSaveLoad._FileLocation); FileInfo[] info = dir.GetFiles("*_sandwichRutina.xml"); foreach (FileInfo f in info) { Debug.Log(f + "ruta"); DropDownListItem temporal = new DropDownListItem(); temporal.Caption = f.ToString().Substring(f.ToString().LastIndexOf("\\") + 1); temporal.ID = GameSaveLoad._FileLocation + "\\" + temporal.Caption; temporal.Caption = temporal.Caption.Substring(0, temporal.Caption.LastIndexOf("_")); temporal.Caption = temporal.Caption.Substring(temporal.Caption.IndexOf("_") + 1); rutinas.Items.Add(temporal); } rutinas.RebuildPanel(); }
public static ICollection <DropDownListItem> ToDropDownList(this IDictionary <string, string> source) { ICollection <DropDownListItem> list = new HashSet <DropDownListItem>(); foreach (KeyValuePair <string, string> item in source) { DropDownListItem listItem = new DropDownListItem(); listItem.GetType().GetProperty("Text").SetValue(listItem, item.Key, null); listItem.GetType().GetProperty("Value").SetValue(listItem, item.Value, null); list.Add(listItem); } return(list); }
protected void btnSumbititem_Click(object sender, EventArgs e) { Item newobject = new Item(); newobject.RecTime = DateTime.Now; newobject.User_Id = 0; newobject.IsDisable = false; newobject.AverageCost = Convert.ToDouble(TextBoxcost0.Text); newobject.HasStock = Convert.ToInt32(CheckBoxhasstock.Checked); newobject.Items_Name = TextBoxName.Text; newobject.Items_Notes = "ADD by invoice page"; newobject.Items_Price = Convert.ToDouble(textboxprice.Text); newobject.Type_Id = Convert.ToInt32(DropDownListitem0.SelectedValue); DB.Items.InsertOnSubmit(newobject); DB.SubmitChanges(); if (CheckBoxhasstock.Checked == true) { Stock newstock = new Stock(); newstock.Item_Id = newobject.Items_Id; newstock.IsDisable = false; if (TextBoxquantity.Text != "") { newstock.Stock_Quantity = Convert.ToInt32(TextBoxquantity.Text); } else { newstock.Stock_Quantity = 0; } newstock.LastModifyDate = DateTime.Now; newstock.Last_UserId = 0; DB.Stocks.InsertOnSubmit(newstock); DB.SubmitChanges(); } DropDownListItem.DataSource = DB.Items.Where(a => a.IsDisable.Equals(false)).Select(a => new { ID = a.Items_Id, Name = a.Items_Name }).OrderByDescending(a => a.ID); DropDownListItem.DataBind(); changedrop(); }
private void ActualizaDropList(string postName) { string[] patients = postName.Split(';'); foreach (string p in patients) { if (p.Length > 2) { Debug.Log(p + "paciente"); DropDownListItem etem = new DropDownListItem(); etem.Caption = p.ToString().Substring(0, p.LastIndexOf("_")); //aaqui tengo que poner el id del paceinte etem.ID = p.ToString().Substring(p.LastIndexOf("_") + 1); pacientes.Items.Add(etem); } } Debug.Log(postName); Debug.Log("termine"); pacientes.RebuildPanel(); }
protected virtual TReportParameter PrepareViewBagForIndex() { var closedErfassungsperiodenDropDownItems = reportControllerService.GetClosedErfassungsperiodenDropDownItems <TReportParameter, TPresentationObject>().ToArray(); ViewBag.SupportedYears = reportControllerService.GetSupportedErfassungsperioden <TReportParameter>().Select(e => e.Id); ViewBag.ClosedErfassungsperiods = closedErfassungsperiodenDropDownItems; DropDownListItem erfassungsPeriodDropDownItem = closedErfassungsperiodenDropDownItems.SingleOrDefault(ep => ep.Selected); Guid? erfassungsPeriodId = erfassungsPeriodDropDownItem == null ? (Guid?)null : new Guid(erfassungsPeriodDropDownItem.Value); var parameter = new TReportParameter { ErfassungsPeriodId = erfassungsPeriodId }; ViewBag.NetzErfassungsmodus = reportControllerService.GetNetzErfassungsmodus(parameter.ErfassungsPeriodId); return(parameter); }
public void LoadSerialPorts() { string[] portNames = SerialPort.GetPortNames(); string allnames = ""; List <DropDownListItem> items = new List <DropDownListItem>(); foreach (string p in portNames) { //Debug.Log(p); DropDownListItem item = new DropDownListItem(p, p); items.Add(item); allnames += p + ", "; } Debug.LogError("ALL PORT NAMES: " + allnames); arduinoPortsList.Items = items; }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { DropDownListItem dropDownListItem = new DropDownListItem(); dropDownListItem.Text = "ENG"; dropDownListItem.Value = "en-US"; RadDropDownListLanguage.Items.Add(dropDownListItem); dropDownListItem = new DropDownListItem(); dropDownListItem.Text = "FR"; dropDownListItem.Value = "fr-FR"; RadDropDownListLanguage.Items.Add(dropDownListItem); dropDownListItem = new DropDownListItem(); dropDownListItem.Text = "NL"; dropDownListItem.Value = "nl-NL"; RadDropDownListLanguage.Items.Add(dropDownListItem); DropDownListItem selectedDropDownListItem = null; if (Session["CurrentLanguage"] != null) { selectedDropDownListItem = RadDropDownListLanguage.FindItemByValue(Session["CurrentLanguage"].ToString()); } else { selectedDropDownListItem = RadDropDownListLanguage.FindItemByValue("en-US"); } RadDropDownListLanguage.SelectedIndex = selectedDropDownListItem.Index; //HttpCookie httpCookie = Request.Cookies["CurrentLanguage"]; //if (httpCookie != null && httpCookie.Value != null) // selectedDropDownListItem = RadDropDownListLanguage.FindItemByValue(httpCookie.Value); //else // selectedDropDownListItem = RadDropDownListLanguage.FindItemByValue("en-US"); //RadDropDownListLanguage.SelectedIndex = selectedDropDownListItem.Index; } }
protected void RadDropDownListLanguage_SelectedIndexChanged(object sender, DropDownListEventArgs e) { DropDownListItem selectedDropDownListItem = RadDropDownListLanguage.SelectedItem; switch (selectedDropDownListItem.Value) { case "fr-FR": Session["CurrentLanguage"] = "fr-FR"; break; case "nl-NL": Session["CurrentLanguage"] = "nl-NL"; break; default: Session["CurrentLanguage"] = "en-US"; break; } Response.Redirect(Request.RawUrl); }
void Start() { gc = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameController>(); checkers = new List <IPropertyChecker>(); //generate all checks checkers.Add(new PropertyCheckers.Identity()); foreach (string property in gc.pieceInfo.properties.Keys) { foreach (string value in gc.pieceInfo.properties[property]) { checkers.Add(new PropertyCheckers.PropertyHasValue(property, value)); } } //TODO - piece specific properties e.g. face value etc. //generate the selectable list for (int i = 0; i < checkers.Count; i++) { IPropertyChecker check = checkers[i]; DropDownListItem listItem = Instantiate(listItemPrefab).GetComponent <DropDownListItem>(); listItem.transform.SetParent(dropDownList); listItem.Init(this, check.ToString(), i); } /* * //add the negations of each property * for(int i = 0; i < checkers.Count; i++) { * IPropertyChecker check = new PropertyCheckers.Not(checkers[i]); * DropDownListItem listItem = Instantiate(listItemPrefab).GetComponent<DropDownListItem>(); * listItem.transform.SetParent(dropDownList); * listItem.Init(this, check.ToString(), i); * * } */ dropDownList.gameObject.SetActive(false); selectedItemIndex = -1; }
public virtual ActionResult Index() { var closedErfassungsperiodenDropDownItems = reportControllerService.GetClosedErfassungsperiodenDropDownItems <TReportParameter, TPresentationObject>(); ViewBag.ClosedErfassungsperiods = closedErfassungsperiodenDropDownItems; DropDownListItem erfassungsPeriodDropDownItem = closedErfassungsperiodenDropDownItems.SingleOrDefault(ep => ep.Selected); Guid? erfassungsPeriodId = erfassungsPeriodDropDownItem == null ? (Guid?)null : new Guid(erfassungsPeriodDropDownItem.Value); if (!erfassungsPeriodId.HasValue) { ViewBag.NetzErfassungsmodus = erfassungsPeriodService.GetCurrentErfassungsPeriod().NetzErfassungsmodus; } else { var erfassungsPeriod = erfassungsPeriodService.GetEntityById(erfassungsPeriodId.Value); ViewBag.NetzErfassungsmodus = erfassungsPeriod.NetzErfassungsmodus; } PrepareViewBagForIndex(erfassungsPeriodId); return(View()); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { rDDSeason.DataSource = SeasonBLL.ListSeason(); rDDSeason.DataValueField = "SeasonID"; rDDSeason.DataTextField = "SeasonName"; rDDSeason.DataBind(); rDDSeason.SelectedIndex = 0; var itemBatter = new DropDownListItem("Hitters", "1"); rDDPositionType.Items.Add(itemBatter); var itemPitchers = new DropDownListItem("Pitchers", "2"); rDDPositionType.Items.Add(itemPitchers); rDDPositionType.SelectedIndex = 0; var grid = (RadGrid)ucPlayerStats.FindControl("rGridStats"); grid.MasterTableView.EnableGroupsExpandAll = false; } ucPlayerStats.BindChildStatsGrid(); }
protected void LoadrDDSeasonTeam() { // Manually load dropdown list try { List <SeasonTeamDomainModel> ds = SeasonTeamBLL.SeasonTeamOrder(Convert.ToInt32(rDDSeason.SelectedValue)).OrderBy(o => o.TeamName).ToList(); rDDSeasonTeam.Items.Clear(); var itemRecycle = new DropDownListItem("Recycle Bin", "0"); rDDSeasonTeam.Items.Add(itemRecycle); foreach (var element in ds) { var item = new DropDownListItem(element.TeamName.ToString(), element.TeamID.ToString()); if (CanTeamBid(element.SeasonID, element.TeamID, element.MaxBid)) { item.Enabled = true; } else { item.Enabled = false; item.BackColor = System.Drawing.Color.LightBlue; } rDDSeasonTeam.Items.Add(item); } } catch (Exception ex) { StackTrace st = new StackTrace(); StackFrame sf = st.GetFrame(0); string errMethod = sf.GetMethod().Name.ToString(); // Get the current method name string errMsg = "600"; // Gotta pass something, we're retro-fitting an existing method Session["LastException"] = ex; // Throw the exception in the session variable, will be used in error page string url = string.Format(ConfigurationManager.AppSettings["ErrorPageURL"], errMethod, errMsg); //Set the URL Response.Redirect(url); // Go to the error page. } }
protected void dropdownlist() { DropDownListItem.DataSource = DB.Items.Where(a => a.IsDisable.Equals(false)).Select(a => new { ID = a.Items_Id, Name = a.Items_Name }); DropDownListItem.DataBind(); }
protected void databind(string id) { Invoice object1 = DB.Invoices.Where(a => a.Invoice_Id.Equals(id)).SingleOrDefault(); //GridView1.DataSource = DB.Bank_Names.Where(a => a.IsDisable.Equals(false)).Select(a => new { ID = a.BankName_Id, Name = a.Bank_Name1, a.AccountNo, DateOFOpen = a.DateOfOpen, a.Phone, a.Loation, a.PersonInCharge, a.Phone_PersonInCharge, Note = a.Bank_Name_Notes }); ; //GridView1.DataBind(); DropDownListinvoicetype.DataSource = DB.Invoice_Ts.Where(a => a.IsDisable.Equals(false)).Select(a => new { ID = a.Invoice_T_Id, name = a.Invoice_T_Name }); DropDownListinvoicetype.DataBind(); DropDownListinvoicetype.SelectedValue = Convert.ToString(object1.Invoice_Type_Id); DropDownListcontacttype2.DataSource = DB.Contat_Ts.Where(a => a.IsDisable.Equals(false)).Select(a => new { a.Contat_T_Id, a.Contat_T_Name }); DropDownListcontacttype2.DataBind(); if (DropDownListinvoicetype.SelectedValue == "1") { DropDownListcontac.DataSource = DB.Contact2s.Where(a => a.IsDisable.Equals(false) && a.Client_Type.Equals(3)).Select(a => new { ID = a.Contact_Id, name = a.Contact_Name }); DropDownListcontac.DataBind(); DropDownListcontacttype2.SelectedValue = "3"; } else if (DropDownListinvoicetype.SelectedValue == "2") { DropDownListcontac.DataSource = DB.Contact2s.Where(a => a.IsDisable.Equals(false) && a.Client_Type.Equals(1)).Select(a => new { ID = a.Contact_Id, name = a.Contact_Name }); DropDownListcontac.DataBind(); DropDownListcontacttype2.SelectedValue = "1"; } TextBoxInvoiceno.Text = Convert.ToString(Convert.ToInt32(DB.Invoice_Serial_Collects.Where(a => a.Invoice_Serial_Collect_Collecting.Equals(DropDownListinvoicetype.SelectedValue)).SingleOrDefault().Invoice) + 1); datepicker.Text = Convert.ToString(DateTime.Now); DropDownListItem.DataSource = DB.Items.Where(a => a.IsDisable.Equals(false)).Select(a => new { ID = a.Items_Id, Name = a.Items_Name }); DropDownListItem.DataBind(); DropDownListtax.DataSource = DB.Taxes.Where(a => a.IsDisable.Equals(false)).Select(a => new { ID = a.Tax_Id, name = a.Tax_Name }); DropDownListtax.DataBind(); Labelid.Text = Convert.ToString(id); TextBoxAfterDiscount.Text = Convert.ToString(object1.Invoice_AfterDiscountprice); TextBoxTax.Text = Convert.ToString(object1.Invoice_AfterDiscountprice_ATax); datepicker.Text = Convert.ToString(object1.Invoice_Date); //CheckBoxDone.Checked = Convert.ToBoolean(object1.Invoice_IsDone); TextBoxInvoiceno.Text = Convert.ToString(object1.Invoice_No); TextBoxNote.Text = object1.Invoice_Note; TextBoxtotalprice.Text = Convert.ToString(object1.Invoice_Price); TextBoxcost.Text = Convert.ToString(object1.Invoice_TotalCost); //DropDownListinvoicetype.SelectedValue = Convert.ToString(object1.Invoice_Type_Id); DropDownListcontac.SelectedValue = Convert.ToString(object1.Contact_Id); Labelstatus.Text = "Invoice No=" + object1.Invoice_No + " -Date of Invoice" + object1.Invoice_Date; TextBoxtaxpercentage0.Text = Convert.ToString(DB.Taxes.Where(a => a.Tax_Id.Equals(DropDownListtax.SelectedValue)).SingleOrDefault().Tax_Percentage); DropDownListitem0.DataSource = DB.Item_Types.Where(a => a.IsDisable.Equals(false)).Select(a => new { ID = a.Item_Type1, name = a.Item_Type_Name }); DropDownListitem0.DataBind(); }
/// <summary> /// Initializes a new instance of the <see cref="DropDownListItemBuilder"/> class. /// </summary> /// <param name="item">The item.</param> public DropDownListItemBuilder(DropDownListItem item) { this.item = item; }
void populateDropDownList() { List<string> portNames = GetPortNames(); portDropDownList.Items = new List<DropDownListItem>(); foreach(string portName in portNames){ DropDownListItem item = new DropDownListItem(portName); portDropDownList.Items.Add(item); } // dropDownList.ItemsToDisplay = dropDownList.Items.Count; }
void ResetLists() { lock (this) { notifyLevel++; Function1DItem f; if (function.SelectedItem != null) { f = ((DropDownListItem <Function1DItem>)function.SelectedItem).Item; } else { f = null; } DataItem d; if (data.SelectedItem != null) { d = ((DropDownListItem <DataItem>)data.SelectedItem).Item; } else { d = null; } function.Items.Clear(); data.Items.Clear(); foreach (Item x in model.Items) { if ((x is Function1DItem) && ((Function1DItem)x).Fitable) { function.Items.Add(new DropDownListItem <Function1DItem>(x)); } if (x is DataItem) { data.Items.Add(new DropDownListItem <DataItem>(x)); } } DropDownListItem <DataItem> selectedd = DropDownListItem <DataItem> .ListItem(data.Items, d); if (selectedd == null && data.Items.Count > 0) { selectedd = (DropDownListItem <DataItem>)data.Items[0]; } DropDownListItem <Function1DItem> selectedf = DropDownListItem <Function1DItem> .ListItem(function.Items, f); if (selectedf == null && function.Items.Count > 0) { selectedf = (DropDownListItem <Function1DItem>)function.Items[0]; } if (data.SelectedItem != selectedd || function.SelectedItem != selectedf) { data.SelectedItem = selectedd; function.SelectedItem = selectedf; ResetPar(); } notifyLevel--; } }
protected void LoadInformation() { // set up for adding the header info List <PRIVGROUP> pl = SQMModelMgr.SelectPrivGroupList(new SysPriv[1] { SysPriv.originate }, SysScope.audit, ""); // SQMModelMgr.SelectPrivGroupJobcodeList(SysPriv.originate, SysScope.audit); DropDownListItem item = new DropDownListItem(); UpdateAuditTypes(); if (rddlAuditJobcodes.Items.Count == 0) { rddlAuditJobcodes.DataSource = pl; rddlAuditJobcodes.DataTextField = "DESCRIPTION"; rddlAuditJobcodes.DataValueField = "PRIV_GROUP"; rddlAuditJobcodes.DataBind(); item = new DropDownListItem("[Select a Group]", ""); rddlAuditJobcodes.Items.Insert(0, item); } if (rddlDayOfWeek.Items.Count == 0) { rddlDayOfWeek.Items.Clear(); rddlDayOfWeek.DataSource = EHS_Audit_Scheduler.GetAll <DayOfWeek>(); rddlDayOfWeek.DataTextField = "Value"; rddlDayOfWeek.DataValueField = "Key"; rddlDayOfWeek.DataBind(); item = new DropDownListItem("[Select a Day]", ""); rddlDayOfWeek.Items.Insert(0, item); } if (IsEditContext || CurrentStep > 0) { // in edit mode, load the header field values and make all fields display only AUDIT_SCHEDULER scheduler = EHSAuditMgr.SelectAuditSchedulerById(entities, EditAuditScheduleId); BusinessLocation location = new BusinessLocation().Initialize((decimal)scheduler.PLANT_ID); rddlAuditType.SelectedValue = scheduler.AUDIT_TYPE_ID.ToString(); rddlAuditType.Enabled = false; rddlAuditType.Visible = false; lblScheduleAuditType.Visible = true; lblScheduleAuditType.Text = rddlAuditType.SelectedText.ToString(); hdnAuditLocation.Value = location.Plant.PLANT_ID.ToString(); lblAuditLocation.Text = location.Plant.PLANT_NAME + " " + location.BusinessOrg.ORG_NAME; lblAuditLocation.Visible = true; ddlAuditLocation.Visible = false; mnuAuditLocation.Visible = false; rddlDayOfWeek.SelectedValue = scheduler.DAY_OF_WEEK.ToString(); cbInactive.Checked = scheduler.INACTIVE; // build the audit jobcode list PRIVGROUP pv = pl.Where(i => i.PRIV_GROUP.ToString() == scheduler.JOBCODE_CD).FirstOrDefault(); lblAuditJobcode.Text = pv.DESCRIPTION; lblAuditJobcode.Visible = true; rddlAuditJobcodes.SelectedValue = scheduler.JOBCODE_CD.ToString(); rddlAuditJobcodes.Visible = false; } else { if (UserContext.GetMaxScopePrivilege(SysScope.audit) <= SysPriv.config) { List <BusinessLocation> locationList = SessionManager.PlantList; locationList = UserContext.FilterPlantAccessList(locationList); if (locationList.Select(l => l.Plant.BUS_ORG_ID).Distinct().Count() > 1 && SessionManager.IsUserAgentType("ipad,iphone") == false) { if (mnuAuditLocation.Items.Count == 0) { mnuAuditLocation.Items.Clear(); ddlAuditLocation.Visible = false; mnuAuditLocation.Visible = true; mnuAuditLocation.Enabled = true; SQMBasePage.SetLocationList(mnuAuditLocation, locationList, 0, "Select a Location", "", true); } } else { if (ddlAuditLocation.Items.Count == 0) { ddlAuditLocation.Items.Clear(); ddlAuditLocation.Visible = true; ddlAuditLocation.Enabled = true; mnuAuditLocation.Visible = false; SQMBasePage.SetLocationList(ddlAuditLocation, locationList, 0, true); ddlAuditLocation.Items[0].ImageUrl = "~/images/defaulticon/16x16/user-alt-2.png"; } } } // set defaults for add mode rddlAuditType.Enabled = true; rddlAuditType.Visible = true; lblAuditLocation.Visible = false; rddlAuditJobcodes.Enabled = true; rddlAuditJobcodes.Visible = true; lblAuditJobcode.Visible = false; lblScheduleAuditType.Visible = false; } }
// Set the controls by the value of the parameters private void SetControlObjectByValue(Control aControl, string aValue) { string _type = aControl.GetType().Name; if (_type == "RadTextBox") { RadTextBox _box = (RadTextBox)aControl; _box.Text = aValue; } else if (_type == "RadDropDownList") { RadDropDownList _list = (RadDropDownList)aControl; DropDownListItem _item = _list.FindItemByValue(aValue); int _selectedIndex = 0; if (_item != null) { _selectedIndex = _item.Index; } _list.SelectedIndex = _selectedIndex; } else if (_type == "RadNumericTextBox") { RadNumericTextBox _numeric = (RadNumericTextBox)aControl; _numeric.Value = Convert.ToDouble(aValue); } else if (_type == "RadSearchBox") { RadSearchBox _search = (RadSearchBox)aControl; if (aValue.Contains('^')) { string[] _splitForContext = aValue.Split('^'); _search.Text = _splitForContext[0].Trim(); int _selectedCtx = Convert.ToInt32(_splitForContext[1].Trim()); if (_selectedCtx != -1) { _search.SearchContext.Items[_selectedCtx].Selected = true; } } else { _search.Text = aValue; } } else if (_type == "RadComboBox") { RadComboBox _combo = (RadComboBox)aControl; if (_combo.CheckBoxes) { for (int i = 0; i < _combo.Items.Count; i++) { _combo.Items[i].Checked = aValue[i] == '1'; } } else { RadComboBoxItem _item = _combo.FindItemByValue(aValue); if (_item != null) { _item.Selected = true; } else { _combo.Text = aValue; } } } else if (_type == "RadButton") { RadButton _button = (RadButton)aControl; // TODO: Set all checks here if (_button.ToggleType == ButtonToggleType.CustomToggle) { _button.SelectedToggleStateIndex = Convert.ToInt32(aValue); } // For everything else else { _button.Checked = aValue == "1"; } } else if (_type == "RadDatePicker") { RadDatePicker _date = (RadDatePicker)aControl; _date.SelectedDate = DateTime.Parse(aValue); } else if (_type == "RadTabStrip") { RadTabStrip _tabstrip = (RadTabStrip)aControl; int _index = Convert.ToInt32(aValue); _tabstrip.SelectedIndex = _index; _tabstrip.MultiPage.SelectedIndex = _index; } }
protected virtual void LoadItemsInternal() { base.Items.Clear(); if (this.FirstItemEmpty) base.Items.Add(XDropDown.CreateEmptyItem()); using (IDataReader dr = this.CreateDataReader()) { StringBuilder sb = new StringBuilder(); while (dr.Read()) { int j = 1; for (; j < dr.FieldCount - 1; ++j) { object value = dr[j]; if (value != DBNull.Value) { sb.Append(value); sb.Append(" - "); } } sb.Append(dr[j]); DropDownListItem item = new DropDownListItem(sb.ToString(), dr[0].ToString()); base.Items.Add(item); sb.Length = 0; } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { DropDownListItem dropDownListItem = new DropDownListItem(); dropDownListItem.Text = "ENG"; dropDownListItem.Value = "en-US"; RadDropDownListLanguage.Items.Add(dropDownListItem); dropDownListItem = new DropDownListItem(); dropDownListItem.Text = "FR"; dropDownListItem.Value = "fr-FR"; RadDropDownListLanguage.Items.Add(dropDownListItem); dropDownListItem = new DropDownListItem(); dropDownListItem.Text = "NL"; dropDownListItem.Value = "nl-NL"; RadDropDownListLanguage.Items.Add(dropDownListItem); DropDownListItem selectedDropDownListItem = null; if (Session["CurrentLanguage"] != null) selectedDropDownListItem = RadDropDownListLanguage.FindItemByValue(Session["CurrentLanguage"].ToString()); else selectedDropDownListItem = RadDropDownListLanguage.FindItemByValue("en-US"); RadDropDownListLanguage.SelectedIndex = selectedDropDownListItem.Index; //HttpCookie httpCookie = Request.Cookies["CurrentLanguage"]; //if (httpCookie != null && httpCookie.Value != null) // selectedDropDownListItem = RadDropDownListLanguage.FindItemByValue(httpCookie.Value); //else // selectedDropDownListItem = RadDropDownListLanguage.FindItemByValue("en-US"); //RadDropDownListLanguage.SelectedIndex = selectedDropDownListItem.Index; } }
/// <summary> /// Metodo que carga un registro a un DropDownList /// </summary> /// <param name="cboDropDownList">Control DropDownList al que se le van a cargar los datos</param> /// <param name="strText">Texto del registro</param> /// <param name="strValue">Valor del registro</param> /// <param name="blnAddFirstItem">True si desea adicionarlo al inicio o False de lo contrario</param> /// <remarks> /// <list>Creaciòn: Jul 12/2013 - Ing. Paulo Cesar Pacheco Tovar</list> /// </remarks> public static void AddItemToDropDownList(ref RadDropDownList cboDropDownList, string strText, string strValue, bool blnAddFirstItem = false) { if (cboDropDownList == null) { throw new ArgumentNullException("El argumento cboDropDownList no puede ser nulo"); } if (strValue == string.Empty) { throw new ArgumentException("El argumento strValue no puede estar vacio"); } DropDownListItem objListItem = new DropDownListItem(strText, strValue); try { if (blnAddFirstItem) { cboDropDownList.Items.Insert(0, objListItem); } else { cboDropDownList.Items.Add(objListItem); } } catch (Exception ex) { throw ex; } }