Example #1
0
 //Método mostrar
 private void Mostrar()
 {
     this.dataListado.DataSource           = NArticulo.Mostrar();
     this.dataListadoCategorias.DataSource = NCategoria.Mostrar();
     this.dataListadoFruver.DataSource     = NFruver.Mostrar();
     this.OcultarColumnas();
     lblTotal.Text = "Total de registros: " + Convert.ToString(dataListado.Rows.Count);
 }
Example #2
0
        private void btnGuardarFruver_Click(object sender, EventArgs e)
        {
            try
            {
                string rpta = "";

                if (this.txtNombreFruver.Text == string.Empty || this.txtPrecioFruver.Text == string.Empty)
                {
                    MensajeError("Falta ingresar algun dato");
                    errorIcono.SetError(txtNombreFruver, "Ingrese un valor");
                    errorIcono.SetError(txtPrecioCompraFruver, "Ingrese un valor");
                    errorIcono.SetError(txtPrecioFruver, "Ingrese un valor");
                }
                else
                {
                    if (this.IsNuevoFruver)
                    {
                        rpta = NFruver.Insertar(this.txtNombreFruver.Text.Trim().ToUpper(), Convert.ToDecimal(this.txtPrecioCompraFruver.Text), Convert.ToDecimal(this.txtPrecioFruver.Text));
                    }
                    else
                    {
                        rpta = NFruver.Editar(Convert.ToInt32(this.txtIdFruver.Text), this.txtNombreFruver.Text.Trim().ToUpper(), Convert.ToDecimal(this.txtPrecioCompraFruver.Text), Convert.ToDecimal(this.txtPrecioFruver.Text));
                    }
                    if (rpta.Equals("OK"))
                    {
                        if (this.IsNuevoFruver)
                        {
                            this.MensajeOk("Se inserto correctamente el registro");
                        }
                        else
                        {
                            this.MensajeOk("Se actualizó correctamente el registro");
                        }
                    }
                    else
                    {
                        this.MensajeError(rpta);
                    }
                    this.IsNuevoFruver  = false;
                    this.IsEditarFruver = false;
                    this.LimpiarFruver();
                    this.MostrarFruver();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + ex.StackTrace);
            }
        }
Example #3
0
 public void MostrarFruver()
 {
     this.dataListadoFruver.DataSource = NFruver.Mostrar();
 }