private void CargarSeleccion() { cod_intimaciones oIntimidacion = new cod_intimaciones(); TipoIntimacionImplement oTipoIntimidacionImplement = new TipoIntimacionImplement(); DataGridViewRow row = this.dgvTipoIntimacion.CurrentRow; int id = Convert.ToInt32(row.Cells[0].Value); oIntimidacion = oTipoIntimidacionImplement.Get(id); this.lblCodigo.Text = oIntimidacion.id_intimacion.ToString(); this.txtNombre.Text = oIntimidacion.intimacion; this.gbIntimacion.Enabled = false; Deshabilitar(); }
private void Guardar() { cod_intimaciones oIntimidacion = new cod_intimaciones(); TipoIntimacionImplement oTipoIntimidacionImplement = new TipoIntimacionImplement(); if (this.lblCodigo.Text == "") { oIntimidacion.intimacion = this.txtNombre.Text; oTipoIntimidacionImplement.Save(oIntimidacion); } else { DataGridViewRow row = this.dgvTipoIntimacion.CurrentRow; int id = Convert.ToInt32(row.Cells[0].Value); oIntimidacion = oTipoIntimidacionImplement.Get(id); oIntimidacion.intimacion = this.txtNombre.Text; oTipoIntimidacionImplement.Update(oIntimidacion); } Deshabilitar(); this.txtNombre.Text = ""; CargarGrid(); }