public static void CargarDatosComboAlumnos(ref MetroComboBox cbo) { IServicioAlumno servicio = DI.Create <IServicioAlumno>(); var lista = servicio.GetAlumnos(); AlumnoListDto alumnoDto = new AlumnoListDto { AlumnoId = 0, NombreCompleto = "<Seleccione un Alumno>" }; lista.Insert(0, alumnoDto); cbo.DataSource = lista; cbo.DisplayMember = "NombreCompleto"; cbo.ValueMember = "AlumnoId"; cbo.SelectedIndex = 0; }
public static void CargarComboTipoTarea(ref MetroComboBox cbo) { IServicioTipoDeTarea serviceTipo = DI.Create <IServicioTipoDeTarea>(); var listaTarea = serviceTipo.GetLista(); var defaultTarea = new TipoDeTareaListDto { TipoDeTareaId = 0, Descripcion = "<Seleccione un Tipo de Tarea>" }; listaTarea.Insert(0, defaultTarea); cbo.DataSource = listaTarea; cbo.ValueMember = "TipoDeTareaId"; cbo.DisplayMember = "Descripcion"; cbo.SelectedIndex = 0; }
internal static void CargarComboEstadoLibro(ref MetroComboBox estadoLibroMetroComboBox) { IServiciosEstado serviciosEstado = new ServiciosEstado(); var lista = serviciosEstado.GetEstados(); var defaultEstado = new EstadoListDto { EstadoId = 0, Descripcion = "Seleccione un estado" }; lista.Insert(0, defaultEstado); estadoLibroMetroComboBox.DataSource = lista; estadoLibroMetroComboBox.ValueMember = "EstadoId"; estadoLibroMetroComboBox.DisplayMember = "Descripcion"; estadoLibroMetroComboBox.SelectedIndex = 0; }
internal static void CargarComboEditoriales(ref MetroComboBox editorialMetroComboBox, PaisListDto paisDto) { IServicioEditoriales serviciosEditorial = new ServicioEditoriales(); var lista = serviciosEditorial.GetLista(paisDto); var defaultEditorial = new EditorialListDto { EditorialId = 0, NombreEditorial = "Seleccione una Editorial" }; lista.Insert(0, defaultEditorial); editorialMetroComboBox.DataSource = lista; editorialMetroComboBox.ValueMember = "EditorialId"; editorialMetroComboBox.DisplayMember = "NombreEditorial"; editorialMetroComboBox.SelectedIndex = 0; }
public static void CargarComboLocalidad(ref MetroComboBox cbo) { IServicioLocalidad serviceLocalidad = DI.Create <IServicioLocalidad>(); var listaLocalidad = serviceLocalidad.GetLista(null); var defaultLocalidad = new LocalidadListDto { LocalidadId = 0, NombreLocalidad = "<Seleccione una Localidad>" }; listaLocalidad.Insert(0, defaultLocalidad); cbo.DataSource = listaLocalidad; cbo.ValueMember = "LocalidadId"; cbo.DisplayMember = "NombreLocalidad"; cbo.SelectedIndex = 0; }
public static void CargarDatosComboProfesores(ref MetroComboBox cbo) { IServicioProfesor servicioProfesor = new ServicioProfesores(); var listaProfesores = servicioProfesor.GetProfesores(); ProfesorListDto profesorDto = new ProfesorListDto { ProfesorId = 0, NombreCompleto = "<Seleccione un Profesor>" }; listaProfesores.Insert(0, profesorDto); cbo.DataSource = listaProfesores; cbo.DisplayMember = "NombreCompleto"; cbo.ValueMember = "ProfesorId"; cbo.SelectedIndex = 0; }
internal static void CargarComboDeLibros(ref MetroComboBox libroIdMetroComboBox) { IServicioLibros servicio = new ServicioLibros(); var lista = servicio.GetLista(); var defaultLibros = new LibroListDto() { LibroId = 0, Titulo = "Seleccione un Libro" }; lista.Insert(0, defaultLibros); libroIdMetroComboBox.DataSource = lista; libroIdMetroComboBox.ValueMember = "LibroId"; libroIdMetroComboBox.DisplayMember = "Titulo"; libroIdMetroComboBox.SelectedIndex = 0; }
public static void CargarComboTipoDeDocumento(ref MetroComboBox cbo) { IServicioTipoDeDocumento serviceTipoDeDocumento = DI.Create <IServicioTipoDeDocumento>(); var listaTipoDeDocumento = serviceTipoDeDocumento.GetTipoDeDocumento(); var defaultTipoDeDocumento = new TipoDeDocumentoListDto { TipoDeDocumentoId = 0, Descripcion = "<Seleccione un Tipo de Documento>" }; listaTipoDeDocumento.Insert(0, defaultTipoDeDocumento); cbo.DataSource = listaTipoDeDocumento; cbo.ValueMember = "TipoDeDocumentoId"; cbo.DisplayMember = "Descripcion"; cbo.SelectedIndex = 0; }
ComboBox createExpiryCB() { MetroComboBox expiry = new MetroComboBox(); expiry.FormattingEnabled = true; expiry.Anchor = AnchorStyles.None; expiry.Location = new System.Drawing.Point(558, 0); expiry.FontWeight = MetroComboBoxWeight.Regular; expiry.FontSize = MetroComboBoxSize.Small; expiry.Name = "expiry" + numberOfItems; expiry.Tag = numberOfItems; expiry.SelectedIndexChanged += (s, args) => assignMaxQty(int.Parse(expiry.Tag.ToString())); //expiry.Size = new System.Drawing.Size(100, 28); expiry.Width = 100; return(expiry); }
public static void CargarDatosComboCursos(ref MetroComboBox cbo) { IServicioCurso servicio = new ServicioCursos(); var lista = servicio.GetCursos(); CursoListDto cursoDto = new CursoListDto { CursoId = 0, Nombre = "<Seleccione un Curso>" }; lista.Insert(0, cursoDto); cbo.DataSource = lista; cbo.DisplayMember = "Nombre"; cbo.ValueMember = "CursoId"; cbo.SelectedIndex = 0; }
private void LanguageComboBox_SelectionChangeCommitted(object sender, EventArgs e) { MetroComboBox comboBox = (MetroComboBox)sender; if (comboBox.SelectedItem != null) { Program.settings.TwoLetterISOLanguage = ((CultureInfo)comboBox.SelectedItem).TwoLetterISOLanguageName; if (MetroMessageBox.Show(this, Program.settings.localize.Translate("requires_restart"), Program.settings.localize.Translate("requires_confirmation"), MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) == DialogResult.Yes) { this.WaitsForRestart = true; this.Close(); } } }
public static void CargarComboRaza(ref MetroComboBox cbo) { IServicioRaza serviceRaza = DI.Create <IServicioRaza>(); var listaRaza = serviceRaza.GetLista(null); var razaListDto = new RazaListDto { RazaId = 0, Descripcion = "<Seleccione una Raza>" }; listaRaza.Insert(0, razaListDto); cbo.DataSource = listaRaza; cbo.ValueMember = "RazaId"; cbo.DisplayMember = "Descripcion"; cbo.SelectedIndex = 0; }
internal static void CargarComboSubGenero(ref MetroComboBox comboSubGenero, GeneroListDto generoListDto) { IServiciosSubGeneros servicioSubGenero = new ServicioSubGeneros(); var lista = servicioSubGenero.GetLista(generoListDto); var defaultSubGenero = new SubGeneroListDto { SubGeneroId = 0, NombreSubGenero = "Seleccione un SubGenero", }; lista.Insert(0, defaultSubGenero); comboSubGenero.DataSource = lista; comboSubGenero.ValueMember = "SubGeneroId"; comboSubGenero.DisplayMember = "NombreSubGenero"; comboSubGenero.SelectedIndex = 0; }
internal static void CargarComboSocios(ref MetroComboBox socioIdMetroComboBox) { IServicioSocios servicio = new ServicioSocios(); var lista = servicio.GetLista();//nul,nul var defaultSocio = new SocioListDto() { SocioId = 0, NroDoc = "Seleccione Nº Doc Socio" }; lista.Insert(0, defaultSocio); socioIdMetroComboBox.DataSource = lista; socioIdMetroComboBox.ValueMember = "SocioId"; socioIdMetroComboBox.DisplayMember = "NroDoc"; socioIdMetroComboBox.SelectedIndex = 0; }
public static void CargarComboCliente(ref MetroComboBox cbo) { IServicioCliente serviceCliente = DI.Create <IServicioCliente>(); var listaCliente = serviceCliente.GetLista(); var clienteListDto = new ClienteListDto { ClienteId = 0, Nombre = "<Seleccione un Cliente>" }; listaCliente.Insert(0, clienteListDto); cbo.DataSource = listaCliente; cbo.ValueMember = "ClienteId"; cbo.DisplayMember = "NombreCompleto"; cbo.SelectedIndex = 0; }
internal static void CargarComboDeGenero(ref MetroComboBox generoMetroComboBox) { IServiciosGenero servicioGenero = new ServiciosGenero(); var lista = servicioGenero.GetGeneros(); var defaultGenero = new GeneroListDto { GeneroId = 0, Descripcion = "Seleccione Genero", }; lista.Insert(0, defaultGenero); generoMetroComboBox.DataSource = lista; generoMetroComboBox.ValueMember = "GeneroId"; generoMetroComboBox.DisplayMember = "Descripcion"; generoMetroComboBox.SelectedIndex = 0; }
public static void CargarComboProvincias(ref MetroComboBox cbo) { IServicioProvincia serviceProvincia = DI.Create <IServicioProvincia>(); var listaProvincia = serviceProvincia.GetLista(); var defaultProvincia = new ProvinciaListDto { ProvinciaId = 0, NombreProvincia = "<Seleccione una Provincia>" }; listaProvincia.Insert(0, defaultProvincia); cbo.DataSource = listaProvincia; cbo.ValueMember = "ProvinciaId"; cbo.DisplayMember = "NombreProvincia"; cbo.SelectedIndex = 0; }
private void AddCouplingControls(TabPage tabPage) { // // label_Coupling // Label labelCoupling = new Label(); // // label_Coupling // labelCoupling.ForeColor = System.Drawing.Color.Silver; labelCoupling.Location = new System.Drawing.Point(17, 57); labelCoupling.Name = "label_Coupling"; labelCoupling.Size = new System.Drawing.Size(67, 20); labelCoupling.TabIndex = 5; labelCoupling.Text = "Coupling:"; labelCoupling.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; labelCoupling.Font = new System.Drawing.Font("Verdana", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); // // metroComboBox_coupling // MetroComboBox metroComboBoxCoupling = new MetroComboBox(); metroComboBoxCoupling.BackColor = Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17))))); metroComboBoxCoupling.DrawMode = DrawMode.OwnerDrawFixed; metroComboBoxCoupling.DropDownStyle = ComboBoxStyle.DropDownList; metroComboBoxCoupling.FlatStyle = FlatStyle.Flat; metroComboBoxCoupling.FontSize = MetroFramework.MetroLinkSize.Small; metroComboBoxCoupling.FontWeight = MetroFramework.MetroLinkWeight.Regular; metroComboBoxCoupling.ForeColor = System.Drawing.SystemColors.WindowText; metroComboBoxCoupling.FormattingEnabled = true; metroComboBoxCoupling.Items.AddRange(Enum.GetNames(typeof(Coupling))); metroComboBoxCoupling.ItemHeight = 19; metroComboBoxCoupling.Location = new Point(90, 55); metroComboBoxCoupling.Name = "metroComboBox_coupling"; metroComboBoxCoupling.Size = new Size(89, 25); metroComboBoxCoupling.Style = MetroFramework.MetroColorStyle.Silver; metroComboBoxCoupling.StyleManager = null; metroComboBoxCoupling.TabIndex = 11; metroComboBoxCoupling.Theme = MetroFramework.MetroThemeStyle.Dark; metroComboBoxCoupling.SelectedIndexChanged += new System.EventHandler(CouplingSelectionChanged); metroComboBoxCoupling.SelectedIndex = 0; tabPage.Controls.Add(labelCoupling); tabPage.Controls.Add(metroComboBoxCoupling); }
private void CbxServers_SelectedIndexChanged(object sender, EventArgs e) { if (AllStarted) { foreach (object s in cbxServers.Items) { MetroComboBox currentSender = sender as MetroComboBox; if (s.Equals(currentSender.SelectedItem.ToString())) { cbxServers.SelectedItem = currentSender.SelectedItem.ToString(); LoaderConfig.DefaultServer = LoaderConfig.Servers.Where(x => x.ServerName == currentSender.SelectedItem.ToString()).FirstOrDefault(); SetServerStatus(); Core.SaveLoaderConfig(LoaderConfig); } } } }
private void InitializeUseLocationCbx(MetroComboBox customerCombox, MetroComboBox useLocationCombox) { useLocationCombox.Items.Clear(); useLocationCombox.Items.Add(new KeyValuePair <string, string>("0", "所有")); SortedList condition = new SortedList(); CnasRemotCall remoteCall = new CnasRemotCall(); if (customerCombox.SelectedIndex > 0 && customerCombox.SelectedItem != null && customerCombox.SelectedItem is KeyValuePair <string, string> ) { condition.Add(1, ((KeyValuePair <string, string>)customerCombox.SelectedItem).Key); } else { string customerIds = string.Empty; foreach (var item in customerCombox.Items) { KeyValuePair <string, string> cbxData = (KeyValuePair <string, string>)item; customerIds += string.Format("'{0}',", cbxData.Key); } customerIds = customerIds.TrimEnd(','); condition.Add(1, customerIds); } string sql = "HCS-use-location-sec002"; if (_appID == "1050") { sql = "HCS-use-location-sec011"; condition.Add(2, CnasBaseData.UserBaseInfo.UserID); } string sqlTest = remoteCall.RemotInterface.CheckSelectData(sql, condition); DataTable data = remoteCall.RemotInterface.SelectData(sql, condition); if (data != null && data.Rows.Count > 0) { foreach (DataRow item in data.Rows) { string key = item["id"].ToString(); string value = item["u_uname"].ToString(); KeyValuePair <string, string> cbxItem = new KeyValuePair <string, string>(key, value); useLocationCombox.Items.Add(cbxItem); } useLocationCombox.SelectedIndex = 0; useLocationCombox.Enabled = data.Rows.Count != 1 || customerCombox.SelectedIndex != 0; } }
public void DatosDynamics(MetroComboBox descrip, MetroComboBox marca, MetroComboBox Categoria, MetroComboBox Lavado, MetroComboBox Espec, MetroComboBox Division, MetroComboBox Cliente) { var datos = DbD.Inventario(); var datos1 = DbD.Inventario1(); var datos2 = DbD.Inventario2(); var datodescrip = datos.Select(x => x.Descripcion).ToList(); var datomarca = datos.Select(x => x.Marca).ToList(); var datoCategoria = datos.Select(x => x.Categoria).ToList(); var datoLavado = datos.Select(x => x.Lavado).ToList(); var datoIdEstilos = datos.Select(x => x.IdEstilos).ToList(); var datoEspec = datos1.Select(x => x.Espec).ToList(); var datoDivision = datos1.Select(x => x.Division).ToList(); var datoCliente = datos2.Select(x => new { x.IdCliente, x.Cliente }).ToList(); descrip.Items.Clear(); descrip.ValueMember = "Descripcion"; descrip.DisplayMember = "Descripcion"; descrip.DataSource = datodescrip; marca.Items.Clear(); marca.ValueMember = "Marca"; marca.DisplayMember = "Marca"; marca.DataSource = datomarca; Categoria.Items.Clear(); Categoria.ValueMember = "Categoria"; Categoria.DisplayMember = "Categoria"; Categoria.DataSource = datoCategoria; Lavado.Items.Clear(); Lavado.ValueMember = "Lavado"; Lavado.DisplayMember = "Lavado"; Lavado.DataSource = datoLavado; Espec.Items.Clear(); Espec.ValueMember = "Espec"; Espec.DisplayMember = "Espec"; Espec.DataSource = datoEspec; Division.Items.Clear(); Division.ValueMember = "Division"; Division.DisplayMember = "Division"; Division.DataSource = datoDivision; Cliente.Items.Clear(); Cliente.ValueMember = "IdCLiente"; Cliente.DisplayMember = "Cliente"; Cliente.DataSource = datoCliente; if (descrip.Items.Count > 0) { } }
/// <summary> /// 获取相应值 /// </summary> /// <param name="type"></param> /// <returns></returns> private string GetSelectComBoBox(MetroComboBox cbb, int type) { if (cbb.SelectedItem != null) { KeyValuePair <string, string> item = (KeyValuePair <string, string>)cbb.SelectedItem; if (type == 1) { return(item.Key); } else if (type == 2) { return(item.Value); } return(string.Empty); } return(string.Empty); }
//Все модели принтеров public void Load(DataGridView dgv, MetroComboBox printerFrimcb) { using (ContextModel db = new ContextModel()) { printerFrimcb.DataSource = db.PrinterFirm.ToList(); printerFrimcb.DisplayMember = "PrinterFirmName"; printerFrimcb.ValueMember = "PrinterFirmID"; var printerModel = from mp in db.PrinterModel select new { mp.PrinterModelID, mp.PrinterModelName, PrinterFirm = mp.PrinterFirm.PrinterFirmName }; dgv.DataSource = printerModel.ToList(); } }
public ComboBox createItemDescCombo() { MetroComboBox itemDescCombo = new MetroComboBox(); itemDescCombo.Anchor = AnchorStyles.None; itemDescCombo.Font = new Font("Microsoft Sans Serif", 9.75F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0))); itemDescCombo.FormattingEnabled = true; itemDescCombo.Location = new Point(108, 0); itemDescCombo.FontWeight = MetroComboBoxWeight.Regular; itemDescCombo.FontSize = MetroComboBoxSize.Small; itemDescCombo.Name = "itemDescCombo" + numberOfItems; itemDescCombo.Size = new Size(71, 20); itemDescCombo.DropDownStyle = ComboBoxStyle.DropDownList; itemDescCombo.Tag = numberOfItems; itemDescCombo.TextChanged += (s, args) => assignMaxQty(int.Parse(itemDescCombo.Tag.ToString())); return(itemDescCombo); }
public static void CargarDatosComboProvincias(ref MetroComboBox combo) { //cargo las provincias en el ComboBox IServiciosProvincia servicioProvincia = new ServiciosProvincias(); var lista = servicioProvincia.GetProvincias(); var defaultProvincia = new Provincia { ProvinciaId = 0, NombreProvincia = "Seleccione Provincia" }; lista.Insert(0, defaultProvincia); combo.DataSource = lista; combo.ValueMember = "ProvinciaId"; combo.DisplayMember = "NombreProvincia"; combo.SelectedIndex = 0; }
public static void CargarDatosComboPais(ref MetroComboBox paisMetroComboBox) { //cargo los paises en el ComboBox IServiciosPais servicioPais = new ServiciosPaises(); var lista = servicioPais.GetPaises(); var defaultPais = new PaisListDto { PaisId = 0, NombrePais = "Seleccione Pais" }; lista.Insert(0, defaultPais); paisMetroComboBox.DataSource = lista; paisMetroComboBox.ValueMember = "PaisId"; paisMetroComboBox.DisplayMember = "NombrePais"; paisMetroComboBox.SelectedIndex = 0; }
internal static void OnComboBoxSelectedIndexChange(MetroComboBox comboBox) { #if DEBUG if (comboBox == mainForm.Debug_AutomatedState) { Debug.SetAutomatedState(comboBox.SelectedIndex); } else if (comboBox == mainForm.Debug_OutputState) { Debug.SetOutputState(comboBox.SelectedIndex); } #endif if (comboBox == mainForm.Settings_Theme_Selection) { Config.Theme = comboBox.SelectedIndex; } }
public void Category2(MetroComboBox dato) { using (PLMContext db = new PLMContext()) { try { var datos = db.Category_2.Select(x => new { x.IdCategory2, x.Descripción }).ToList(); dato.Items.Clear(); dato.ValueMember = "IdCategory2"; dato.DisplayMember = "Descripción"; dato.DataSource = datos; } catch (Exception ex) { Dialogs.Show(ex.Message, DialogsType.Error); } } }
private void AddProbeContros(TabPage tabPage) { // // label_probe // Label labelProbe = new Label(); labelProbe.ForeColor = System.Drawing.Color.Silver; labelProbe.Location = new System.Drawing.Point(17, 21); labelProbe.Name = "label_probe"; labelProbe.Size = new System.Drawing.Size(67, 20); labelProbe.TabIndex = 7; labelProbe.Text = "Probe:"; labelProbe.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; labelProbe.Font = new System.Drawing.Font("Verdana", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); // // metroComboBox_probe // MetroComboBox metroComboBoxProbe = new MetroComboBox(); metroComboBoxProbe.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17))))); metroComboBoxProbe.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; metroComboBoxProbe.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; metroComboBoxProbe.FlatStyle = System.Windows.Forms.FlatStyle.Flat; metroComboBoxProbe.FontSize = MetroFramework.MetroLinkSize.Small; metroComboBoxProbe.FontWeight = MetroFramework.MetroLinkWeight.Regular; metroComboBoxProbe.ForeColor = System.Drawing.SystemColors.Info; metroComboBoxProbe.FormattingEnabled = true; metroComboBoxProbe.ItemHeight = 19; metroComboBoxProbe.Items.AddRange(Enum.GetNames(typeof(Probe))); metroComboBoxProbe.Location = new System.Drawing.Point(90, 19); metroComboBoxProbe.Name = "metroComboBox_probe"; metroComboBoxProbe.Size = new System.Drawing.Size(89, 25); metroComboBoxProbe.Style = MetroFramework.MetroColorStyle.Silver; metroComboBoxProbe.StyleManager = null; metroComboBoxProbe.TabIndex = 0; metroComboBoxProbe.Theme = MetroFramework.MetroThemeStyle.Dark; metroComboBoxProbe.SelectedIndexChanged += new System.EventHandler(ProbeSelectionChanged); metroComboBoxProbe.SelectedIndex = 0; tabPage.Controls.Add(labelProbe); tabPage.Controls.Add(metroComboBoxProbe); }
/// <summary> /// Constructor de la pagina /// </summary> /// <param name="owner"></param> /// public pnlListadoVendedores(Form owner, ReportModel model) : base(owner) { InitializeComponent(); #region {Carga de combo box} var listadoComboBoxs = new List <ComboBox> { mcmbDespliegue, mcmbEstado }; foreach (var combo in listadoComboBoxs) { MetroComboBox mcomBox = (MetroComboBox)combo; vMiscelaneosModel.pb_CargaComboBox(ref mcomBox); } #endregion }