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(); }
private void CargarGrid() { ZonaImplement oZonaImplement = new ZonaImplement(); this.dgvZona.DataSource = oZonaImplement.Buscar(""); this.dgvZona.Enabled = true; }
private void CargarZonasFacturacion() { ZonaImplement oZonaImplement = new ZonaImplement(); List <cod_zonas> _listZonas = oZonaImplement.GetAll(); foreach (cod_zonas zona in _listZonas) { chkListZonaFacturacion.Items.Add(zona.zona); } }
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(); }
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; }
private void CargarZonas() { ZonaImplement oZonaImplement = new ZonaImplement(); oZonaImplement.CargarCombo(this.cmbZona, "Seleccione Zona"); }