private void cmbLineaNegocio_SelectedIndexChanged(object sender, EventArgs e) { Lineanegocio businessline = new Lineanegocio(); string json = businessline.readById(cmbLineaNegocio.SelectedValue.ToString()); businessline = JsonConvert.DeserializeObject <Lineanegocio>(json.Replace("_id", "id")); txtLineaNegDesc.Text = businessline.Name; }
private void btnPrnuevo_Click(object sender, EventArgs e) { bussinesline = new Lineanegocio(); txtPrnumero.Text = ""; txtPrdescripcion.Text = ""; txtPrname.Text = ""; txtPrfiltro.Text = ""; gbDatosForm.Enabled = true; btnGuardar.Enabled = true; gbDatosGrid.Enabled = false; }
private void loadComboboxBussinesLines() { Lineanegocio bussinesline = new Lineanegocio(); string json = bussinesline.read(); List <Lineanegocio> x = JsonConvert.DeserializeObject <List <Lineanegocio> >(json.Replace("_id", "id")); if (!json.Equals("[]")) { Dictionary <String, String> datasource = new Dictionary <string, string>(); foreach (Lineanegocio p in x) { datasource.Add(p.Id, p.Name); } cmbBussinesline.DataSource = new BindingSource(datasource, null); cmbBussinesline.DisplayMember = "Value"; cmbBussinesline.ValueMember = "Key"; } }
private void seleccionar(int i) { if (dataGrid.CurrentRow == null) { return; } int selectedrowindex = i; DataGridViewRow selectedRow = dataGrid.Rows[selectedrowindex]; string a = Convert.ToString(selectedRow.Cells["_id"].Value); string b = Convert.ToString(selectedRow.Cells["name"].Value); Lineanegocio lineanegocio = new Lineanegocio(); lineanegocio.Id = a; lineanegocio.Name = b; _caller.Selected((Lineanegocio)lineanegocio); this.DialogResult = DialogResult.OK; this.Close(); }
public void Selected(Lineanegocio bussinesline) { outcome.Idbusinessline = bussinesline.Id; cmbBussinesline.SelectedValue = outcome.Idbusinessline; }
public void Selected(Lineanegocio bussinesline) { incomedetailgral.Idbusinessline = bussinesline.Id; txtLineaNegDesc.Text = bussinesline.Name; cmbLineaNegocio.SelectedValue = incomedetailgral.Idbusinessline; }