public EquiposGas() { InitializeComponent(); modelo = null; dgvEquipos.AutoGenerateColumns = false; ActualizaGrid(); btnExportar.Tag = 0; }
private void Limpiar() { modelo = null; btnGuardar.Text = "Agregar"; btnExportar.Text = "Exportar"; btnExportar.Tag = 0; txtDescripcion.Clear(); txtCapacidad.Clear(); chkEstatus.Checked = true; }
private void btnGuardar_Click(object sender, EventArgs e) { if (modelo == null) { modelo = new Entities.EquipoGas.EquipoGas(); modelo.Id = null; } AppHelper.DoMethod( delegate { DoValidate(); DoSave(); Limpiar(); ActualizaGrid(); }, this ); }
private void dgvEquipos_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= 0) { if (modelo == null) { modelo = new Entities.EquipoGas.EquipoGas(); } modelo = lequipos[e.RowIndex]; txtDescripcion.Text = modelo.Descripcion; txtCapacidad.Text = modelo.Capacidad.ToString(); chkEstatus.Checked = modelo.EstatusEquipoGas_ID == 1; btnGuardar.Text = "Guardar"; btnExportar.Text = "Cancelar"; btnExportar.Tag = 1; } }