Exemple #1
0
 private void CargarSeleccion()
 {
     cod_zonas oZona = new cod_zonas();
     ZonaImplement oZonaImplement = new ZonaImplement();
     DataGridViewRow row = this.dgvZona.CurrentRow;
     int id = Convert.ToInt32(row.Cells[0].Value);
     oZona = oZonaImplement.Get(id);
     this.lblCodigo.Text = oZona.id_zona.ToString();
     this.txtNombre.Text = oZona.zona;
     this.chkImprimir.Checked = oZona.imprimir.Value;
     this.txtNombre.Enabled = false;
     Deshabilitar();
 }
Exemple #2
0
        private void Guardar()
        {
            ZonaImplement oZonaImplement = new ZonaImplement();
            cod_zonas oZona = new cod_zonas();

            if (this.lblCodigo.Text == "")
            {
                oZona.zona = this.txtNombre.Text;
                oZona.imprimir=this.chkImprimir.Checked;
                oZonaImplement.Save(oZona);
            }
            else
            {

                DataGridViewRow row = this.dgvZona.CurrentRow;
                int id = Convert.ToInt32(row.Cells[0].Value);
                oZona = oZonaImplement.Get(id);
                oZona.zona = this.txtNombre.Text;
                oZona.imprimir = this.chkImprimir.Checked;
                oZonaImplement.Update(oZona);
            }
            Deshabilitar();
            this.txtNombre.Text = "";
            CargarGrid();
        }
Exemple #3
0
 private void ModificarZona()
 {
     HabilitarBotones();
     this.txtNombre.Enabled = true;
     this.chkImprimir.Enabled=true;
     cod_zonas oZona = new cod_zonas();
     ZonaImplement oZonaImplement=new ZonaImplement();
     DataGridViewRow row = this.dgvZona.CurrentRow;
     int id = Convert.ToInt32(row.Cells[0].Value);
     oZona = oZonaImplement.Get(id);
     this.lblCodigo.Text = oZona.id_zona.ToString();
     this.txtNombre.Text = oZona.zona;
     this.chkImprimir.Checked = oZona.imprimir.Value;
     this.dgvZona.Enabled = false;
 }