Esempio n. 1
0
 private void LimpiarModificar()
 {
     comboBox_categoria.Enabled = true;
     Listar.Categorias(this.comboBox_categoria);
     comboBox_nombre.Enabled = true;
     Listar.Insumos(this.comboBox_nombre, this.comboBox_categoria);
     comboBox_cantidad.Items.Clear();
     comboBox_cantidad.Text = "";
 }
Esempio n. 2
0
        private void AgregarInsumo(string pNombre, int pCantidad)
        {
            Insumo ins2 = new Insumo("", "", 0, 0, true, 0);

            ins2          = ControladorFachada.ObtenerInsumo(pNombre);
            ins2.Cantidad = pCantidad;
            int posicion = 0;
            int _i       = 0;

            while ((posicion == 0) && (_listarInsumos.Count >= _i + 1))
            {
                this.InsumoAlmacenado = ControladorFachada.ObtenerInsumo(_listarInsumos[_i].Nombre);
                if (_listarInsumos[_i].Nombre == ins2.Nombre)
                {
                    posicion = 1;
                    int cantidadRetirar = _listarInsumos[_i].Cantidad + ins2.Cantidad;
                    if (this.InsumoAlmacenado.Cantidad < cantidadRetirar)
                    {
                        MessageBox.Show("Usted solo dispone de " + this.InsumoAlmacenado.Cantidad + " unidades de " + this.InsumoAlmacenado.Nombre);
                    }
                    else
                    {
                        _listarInsumos[_i].Cantidad = cantidadRetirar;
                        int cantidadMinima = this.InsumoAlmacenado.Cantidad - cantidadRetirar;
                        if (this.InsumoAlmacenado.CantidadMinima >= cantidadMinima)
                        {
                            MessageBox.Show("En stock solo dispone " + cantidadMinima + " unidades de " + this.InsumoAlmacenado.Nombre, "Stock Mínimo");
                        }
                        RefrescarDataGrid();
                    }
                    _i = _listarInsumos.Count;
                }
                _i = _i + 1;
            }
            if (posicion == 0)
            {
                int cantidadMinima = ins2.Cantidad;
                if (this.InsumoAlmacenado.CantidadMinima >= cantidadMinima)
                {
                    int cant = ControladorFachada.ObtenerInsumo(pNombre).Cantidad - cantidadMinima;
                    MessageBox.Show("En stock solo dispone " + cant + " unidades de " + this.InsumoAlmacenado.Nombre, "Stock Mínimo");
                }
                _listarInsumos.Add(ins2);
            }
            RefrescarDataGrid();
            comboBox_nombre.Items.Clear();
            Listar.Categorias(this.comboBox_categoria);
            Listar.Insumos(this.comboBox_nombre, this.comboBox_categoria);
            comboBox_cantidad.Items.Clear();
            comboBox_cantidad.Text = "";
        }
Esempio n. 3
0
 private void LimpiarTodo()
 {
     Listar.Areas(this.comboBox_area);
     this.comboBox_grupo.Items.Clear();
     this.comboBox_grupo.Enabled = false;
     this.comboBox_persona.Items.Clear();
     this.comboBox_persona.Text   = "";
     this.comboBox_categoria.Text = "";
     Listar.Categorias(this.comboBox_categoria);
     this.comboBox_nombre.Text = "";
     Listar.Insumos(this.comboBox_nombre, this.comboBox_categoria);
     this.comboBox_cantidad.Text = "";
     this.comboBox_cantidad.Items.Clear();
     Listar.Persona(this.comboBox_persona);
     this.textBoxPersonaRetira.Text = "";
     _listarInsumos.Clear();
     this.dataGridView1.Rows.Clear();
 }
Esempio n. 4
0
        private void V_principal_Load(object sender, EventArgs e)
        {
            Screen screen  = Screen.PrimaryScreen;
            int    _height = screen.Bounds.Height - 50;
            int    _width  = screen.Bounds.Width;

            this.Size = new Size(_width, _height);

            if (ControladorFachada.EsAdmin())
            {
                EsAdmin();
            }
            else
            {
                EsUsuario();
            }
            Listar.Areas(this.comboBox_area);
            Listar.Persona(this.comboBox_persona);
            Listar.Categorias(this.comboBox_categoria);
            Listar.Insumos(this.comboBox_nombre, this.comboBox_categoria);
        }
Esempio n. 5
0
 private void ComboBox_categoria_SelectedIndexChanged(object sender, EventArgs e)
 {
     Listar.Insumos(this.comboBox_nombre, this.comboBox_categoria);
 }