Example #1
0
        public void EnviarDatos(int cantidad, int row) //Abonar a nota
        {
            int    nota_id = Convert.ToInt32(dgvNota[0, row].Value);
            Nota   _no     = new Nota();
            string _res    = "";

            _co.Abrir();
            _co.AtraparNota(nota_id, ref _no, ref _res);
            _co.Cerrar();

            Abono _aux = new Abono();

            _aux.Cantidad   = cantidad;
            _aux.Id_Nota    = nota_id;
            _aux.Id_Pedido  = _no.Id_Pedido;
            _aux.Id_User    = _user.Login;
            _aux.Id_Cliente = _cli.Id_Cliente;

            _co.Abrir();
            bool _agregado = _co.AgregarAbono(_aux, ref _res);

            _co.Cerrar();

            if (_agregado)
            {
                MessageBox.Show("Abono Agregado Nota Cliente: " + _cli.Nombre + " " + _cli.Apellido + " Nota ID " + _no.Id_Nota);
            }
            else
            {
                MessageBox.Show("No se pudo agregar abono", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            Refresh();
        }
Example #2
0
        private void dgvPedido_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            DataGridView dgv = (DataGridView)sender;

            if (dgv.Columns[e.ColumnIndex] is DataGridViewButtonColumn && e.RowIndex >= 0)
            {
                if (MessageBox.Show("¿Desea quitar este abono permanentemente?", "Aviso", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    Abono _abo = new Abono();
                    _abo.Id_Abono = Convert.ToInt32(dgv[0, e.RowIndex].Value);
                    string _res = "";
                    _co.Abrir();
                    _co.QuitarAbono(_abo, ref _res);
                    _co.Cerrar();
                    MostrarAbonos();
                    MessageBox.Show(_res, "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
        }