Beispiel #1
0
 public EquiposGas()
 {
     InitializeComponent();
     modelo = null;
     dgvEquipos.AutoGenerateColumns = false;
     ActualizaGrid();
     btnExportar.Tag = 0;
 }
Beispiel #2
0
 private void Limpiar()
 {
     modelo           = null;
     btnGuardar.Text  = "Agregar";
     btnExportar.Text = "Exportar";
     btnExportar.Tag  = 0;
     txtDescripcion.Clear();
     txtCapacidad.Clear();
     chkEstatus.Checked = true;
 }
Beispiel #3
0
 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
         );
 }
Beispiel #4
0
        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;
            }
        }