コード例 #1
0
 public void buscar()
 {
     try
     {
         this.dataGridViewCategoria.DataSource = Lcategoria.Buscar(this.txtconsultarCategoria.Text);
     }
     catch (Exception ex)
     {
         mesajerror(ex.Message);
     }
 }
コード例 #2
0
 public void mostrar()
 {
     try
     {
         this.Dock = DockStyle.Fill;
         this.dataGridViewCategoria.DataSource         = Lcategoria.mostrarC();
         this.dataGridViewCategoria.Columns[0].Visible = false;
     }
     catch (Exception ex)
     {
         mesajerror(ex.Message);
     }
 }
コード例 #3
0
        private void btnguardar_Click(object sender, EventArgs e)
        {
            string rsp = "";

            try
            {
                if (this.txtCateg.Text == string.Empty)
                {
                    mesajerror("No puede dejar nombre de campo vacío");
                    erroricono.SetError(txtCateg, "Debe ingresar nombre de Categoria");
                }
                else
                {
                    if (this.iseditar)
                    {
                        rsp = Lcategoria.Editar(Convert.ToInt32(this.txtcodigo.Text), this.txtCateg.Text.ToUpper(), txtdescrip.Text);
                    }


                    if (rsp.Equals("Y"))


                    {
                        this.mesajeok("Se editó correctamente");
                        _valor.mostrar();
                        this.Close();
                    }

                    else
                    {
                        this.mesajerror(rsp);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
コード例 #4
0
        private void btnguardar_Click(object sender, EventArgs e)
        {
            string rsp = "";


            try
            {
                if (this.txtNombCateg.Text == string.Empty)
                {
                    mesajerror("No puede dejar nombre de campo vacío");
                    erroricono.SetError(txtNombCateg, "Debe ingresar nombre de Categoria");
                }
                if (this.isnuevo)
                {
                    rsp = Lcategoria.Insertar(this.txtNombCateg.Text, this.txtdescripCateg.Text);
                }

                if (rsp.Equals("Y"))

                {
                    this.mesajeok("Se registró con exito");

                    _owner.mostrar();

                    this.Close();
                }
                else

                {
                    this.mesajerror(rsp);
                }
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }