private void CargarGrid() { CategoriaImplement oCategoriaImplement = new CategoriaImplement(); this.dgvCategoria.DataSource = oCategoriaImplement.Buscar(""); this.dgvCategoria.Enabled = true; }
private void CargarCategorias() { CategoriaImplement oCategoriaImplement = new CategoriaImplement(); List <cod_categorias> _listCategorias = oCategoriaImplement.GetAll(); foreach (cod_categorias categoria in _listCategorias) { chkListCategorias.Items.Add(categoria.categoria); } }
private void CargarSeleccion() { cod_categorias oCategorias = new cod_categorias(); CategoriaImplement oCategoriaImplement = new CategoriaImplement(); DataGridViewRow row = this.dgvCategoria.CurrentRow; int id = Convert.ToInt32(row.Cells[0].Value); oCategorias = oCategoriaImplement.Get(id); this.lblCodigo.Text = oCategorias.id_categoria.ToString(); this.txtNombre.Text = oCategorias.categoria; this.gbCategorias.Enabled = false; Deshabilitar(); }
private void ModificarCategoria() { HabilitarBotones(); this.gbCategorias.Enabled = true; cod_categorias oCategoria = new cod_categorias(); CategoriaImplement oCategoriaImplement = new CategoriaImplement(); DataGridViewRow row = this.dgvCategoria.CurrentRow; int id = Convert.ToInt32(row.Cells[0].Value); oCategoria = oCategoriaImplement.Get(id); this.lblCodigo.Text = oCategoria.id_categoria.ToString(); this.txtNombre.Text = oCategoria.categoria; this.dgvCategoria.Enabled = false; }
private void Imprimir() { CategoriaImplement oCategoriaImplement = new CategoriaImplement(); SysConfigImplement oSysConfigImplement = new SysConfigImplement(); Reportes.frmReportes frmRpt = new Reportes.frmReportes(); Reportes.rptCategorias rpt = new Reportes.rptCategorias(); //Cargo el Data Set DataSet ds = new DataSet("Generico"); ds.Tables.Add(oSysConfigImplement.GetEncabezadoDT("Encabezado")); ds.Tables[0].TableName = "dtEncabezado"; ds.Tables.Add(oCategoriaImplement.GetByCategoriaDT("")); ds.Tables[1].TableName = "dtCategorias"; rpt.SetDataSource(ds); frmRpt.crvGenerico.ReportSource = rpt; frmRpt.Show(); }
private void Eliminar() { CategoriaImplement oCategoriaImplement = new CategoriaImplement(); foreach (DataGridViewRow item in this.dgvCategoria.SelectedRows) { // oCategoriaImplement.Delete(id); dgvCategoria.Rows.RemoveAt(item.Index); } // if (this.dgvCategoria.SelectedRows.Count >0) // { // // _eliminoBarrio = true; // DataGridViewRow row = this.dgvCategoria.CurrentRow; // int id = Convert.ToInt32(row.Cells[0].Value); // oCategoriaImplement.Delete(id); // dgvCategoria.Rows.RemoveAt(dgvCategoria.CurrentRow.Index); // CargarGrid(); // } }
private void Guardar() { cod_categorias oCategoria = new cod_categorias(); CategoriaImplement oCategoriaImplement = new CategoriaImplement(); if (this.lblCodigo.Text == "") { oCategoria.categoria = this.txtNombre.Text; oCategoriaImplement.Save(oCategoria); } else { DataGridViewRow row = this.dgvCategoria.CurrentRow; int id = Convert.ToInt32(row.Cells[0].Value); oCategoria = oCategoriaImplement.Get(id); oCategoria.categoria = this.txtNombre.Text; oCategoriaImplement.Update(oCategoria); } Deshabilitar(); this.txtNombre.Text = ""; CargarGrid(); }
private void CargarCategorias() { CategoriaImplement oCategoriaImplement = new CategoriaImplement(); oCategoriaImplement.CargarCombo(ref this.cmbCategoria, "Seleccione Categoria"); }