Ejemplo n.º 1
0
 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();
 }
Ejemplo n.º 2
0
 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();
     //    }
 }
Ejemplo n.º 3
0
 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();
 }
Ejemplo n.º 4
0
 private void CargarGrid()
 {
     CategoriaImplement oCategoriaImplement=new CategoriaImplement();
     this.dgvCategoria.DataSource = oCategoriaImplement.Buscar("");
     this.dgvCategoria.Enabled = true;
 }
Ejemplo n.º 5
0
 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;
 }
Ejemplo n.º 6
0
 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();
 }
Ejemplo n.º 7
0
        private void CargarCategorias()
        {
            CategoriaImplement oCategoriaImplement = new CategoriaImplement();
            List<cod_categorias> _listCategorias = oCategoriaImplement.GetAll();

            foreach (cod_categorias categoria in _listCategorias)
            {
                chkListCategorias.Items.Add(categoria.categoria);
            }
        }
Ejemplo n.º 8
0
 private void CargarCategoria()
 {
     CategoriaImplement oCategoriaImplement = new CategoriaImplement();
     oCategoriaImplement.CargarCombo(ref this.cmbCategoria, "Seleccione");
 }