public void SelectedIncometype(Incometype incometype) { incomedetailgral.Idincometype = incometype.Id; txtDescripcion.Text = incometype.Description; txtMonto.Text = incometype.Amount; cmbTipoIngreso.SelectedValue = incomedetailgral.Idincometype; }
private void cmbTipoIngreso_TextChanged(object sender, EventArgs e) { Incometype incometype = new Incometype(); string json = incometype.readById(cmbTipoIngreso.SelectedValue.ToString()); incometype = JsonConvert.DeserializeObject <Incometype>(json.Replace("_id", "id")); txtDescripcion.Text = incometype.Description; txtMonto.Text = incometype.Amount; }
private void btnPrnuevo_Click(object sender, EventArgs e) { incometype = new Incometype(); txtPrnumero.Text = ""; txtPrdescripcion.Text = ""; txtPrcosto.Text = ""; txtPrfiltro.Text = ""; gbDatosForm.Enabled = true; btnGuardar.Enabled = true; gbDatosGrid.Enabled = false; }
private void loadComboboxIncomeTypes() { Incometype incometype = new Incometype(); string json = incometype.read(); List <Incometype> x = JsonConvert.DeserializeObject <List <Incometype> >(json.Replace("_id", "id")); if (!json.Equals("[]")) { Dictionary <String, String> datasource = new Dictionary <string, string>(); foreach (Incometype p in x) { datasource.Add(p.Id, p.Description); } cmbTipoIngreso.DataSource = new BindingSource(datasource, null); cmbTipoIngreso.DisplayMember = "Value"; cmbTipoIngreso.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["description"].Value); string c = Convert.ToString(selectedRow.Cells["amount"].Value); Incometype incometype = new Incometype(); incometype.Id = a; incometype.Description = b; incometype.Amount = c; _caller.SelectedIncometype((Incometype)incometype); this.DialogResult = DialogResult.OK; this.Close(); }