Example #1
0
 public ArticuloN(
            int p_Id,
            string p_Nombre,
            decimal p_IVA,
            decimal p_PrecioCompra,
            decimal p_Porcentaje,
            String p_CodigoBarra,
            decimal p_PrecioSugerido,
            CuentaN p_Cuenta,
            bool p_LlevaStock,
            int p_cantidad,
            bool p_BloqueaPrecio,
            int p_IdCategoria)
 {
     Id = p_Id;
     Nombre = p_Nombre;
     IVA = p_IVA;
     PrecioCompra = p_PrecioCompra;
     Porcentaje = p_Porcentaje;
     CodigoBarra = p_CodigoBarra;
     PrecioSugerido = p_PrecioSugerido;
    
     if (p_Cuenta != null) {
         IdCuenta = p_Cuenta.Id;
         Cuenta = (CuentaE)p_Cuenta;
     }
     LlevaStock = p_LlevaStock;
     Cantidad = p_cantidad;
     BloqueaPrecio = p_BloqueaPrecio;
     IdCategoria = p_IdCategoria;
 }
        private void txtCuenta_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter && txtCuenta.Text != "")
            {
                _Cuenta = new CuentaN(int.Parse(txtCuenta.Text));

                if (_Cuenta.Succed)
                {
                    txtNombreCuenta.Text = _Cuenta.Nombre;
                    epControlCampos.Clear();
                }
            }
            else if (e.KeyCode == Keys.F3)
            {
                try
                {
                    List<CuentaN> Cuentas = Negocios.FuncionesGlobales.CuentaS.ListarCuentasPorTipo(true);
                    string[] cool = { "Id", "Nombre" };
                    txtCuenta.Parametros<CuentaN>(Keys.F3, cool, "Id", Cuentas,"Nombre");
                }
                catch (Exception E)
                {
                    MessageBox.Show(E.StackTrace);
                    throw;
                }
            }
        }
Example #3
0
        public void txtCuenta_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter && txtCuenta.Text != "")
            {
                _Cuenta = new CuentaN(int.Parse(txtCuenta.Text));

                if (_Cuenta.Succed)
                {
                    txtNombreCuenta.Text = _Cuenta.Nombre;
                    
                }
                else
                {
                    txtCuenta.Text = "";
                    MessageBox.Show("La Cuenta ingresada no existe");
                }

                /* if (txtIdTipoMov.Text != "" && txtPuntoVenta.Text != "" && txtCuenta.Text != "" && ((txtNroComprobante.Text != "" && _TipoMovimiento.Numeracion == "M") || (txtNroComprobante.Text == "" && _TipoMovimiento.Numeracion == "A")))
                 {*/

                if (txtIdTipoMov.Text != "")
                {
                   
                    _Movimiento = new MovimientoN(int.Parse(txtIdTipoMov.Text), int.Parse(txtPuntoVenta.Text), int.Parse(txtNroComprobante.Text == "" ? "0" : txtNroComprobante.Text), int.Parse(txtCuenta.Text));
                    if (_Movimiento.Id != 0)
                    {
                        ClaveMov = _Movimiento.Id;
                        txtFechaComprobante.Text = _Movimiento.Fecha.ToShortDateString();
                        cmbCondicionPago.SelectedValue = _Movimiento.CondicionDePago;
                        txtFechaContabilizacion.Text = _Movimiento.FechaContabilizacion.ToShortDateString();
                        txtObservaciones.Text = _Movimiento.Observacion;
                        CambiarModoPantalla(Negocios.FuncionesGlobales.Globales.Modo.Consultar);
                        if (_Movimiento.ListarDetalles().Count > 0)
                        {
                            LlenarDTGV(_Movimiento.ListarDetalles());
                        }
                        _MovimientoActual = _Movimiento;
                        btnModificar.Enabled = false;
                        btnGrabar.Enabled = false;
                        btnAnular.Enabled = true;
                    }
                    else
                    {
                        btnAnular.Enabled = false;
                        CambiarModoPantalla(Negocios.FuncionesGlobales.Globales.Modo.Agregar);
                        if (_TipoMovimiento.Numeracion == "A")
                        {
                            txtNroComprobante.Text = "";
                        }
                    }
                }
                //}
            }
            else if (e.KeyCode == Keys.F3)
            {
                try
                {
                    List<CuentaN> Cuentas = Negocios.FuncionesGlobales.CuentaS.ListadoCuentas();
                    string[] cool = { "Id", "Nombre" };
                    txtCuenta.Parametros<CuentaN>(Keys.F3, cool, "Id", Cuentas, "Nombre");
                }
                catch (Exception E)
                {
                    MessageBox.Show(E.StackTrace);
                    throw;
                }
            }
        }
Example #4
0
        /// <summary>
        /// Obtiene la cuenta a la que pertenece el articulo
        /// </summary>
        /// <returns></returns>
        public CuentaN ObtenerCuenta()
        {
            if (IdCuenta != 0)
            {
                return (CuentaN)Cuenta;
            }
            else
            {
                CuentaN t_cuenta = new CuentaN(IdCuenta);
                if (t_cuenta.Succed == true)
                {
                    Cuenta = (CuentaE)t_cuenta;

                    return (CuentaN)Cuenta;
                }
                else
                {
                    Cuenta = null;

                    return null;
                }
            }
        }
Example #5
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            if (ControlErrores())
            {
                if (_Estado == Negocios.FuncionesGlobales.Globales.Modo.Agregar)
                {
                    _Cuenta = new CuentaN(
                        txtNombre.Text,
                        txtNombreFantasia.Text == "" ? null : txtNombreFantasia.Text,
                        Globales.ConvertInt(cmbCategoriaAFIP.SelectedValue.ToString()),
                        Globales.ConvertInt(cmbTipoDoc.SelectedValue.ToString()),
                        txtNumeroDoc.Text == "" ? null : txtNumeroDoc.Text,
                        txtIngBrutos.Text == "" ? null : txtIngBrutos.Text,
                        Globales.ConvertInt(txtCodigoLocalidad.Text),
                        txtDomicilio.Text== "" ? null : txtDomicilio.Text,
                        Globales.ConvertInt(txtNumeroDomicilio.Text),
                        Globales.ConvertInt(txtPiso.Text),
                        txtDepartamento.Text== "" ? null : txtDepartamento.Text,
                        chkProveedor.Checked,
                        txtMail.Text== "" ? null : txtMail.Text,
                        txtTelefono.Text== "" ? null : txtTelefono.Text);


                    if (_Cuenta.Guardar())
                    {
                        dgvclipro.Rows.Add();
                        dgvclipro.Rows[dgvclipro.Rows.Count - 1].Cells["ID"].Value = _Cuenta.Id;
                        dgvclipro.Rows[dgvclipro.Rows.Count - 1].Cells["Nombre"].Value = _Cuenta.Nombre;
                        dgvclipro.Rows[dgvclipro.Rows.Count - 1].Cells["mail"].Value = _Cuenta.Mail;
                        dgvclipro.Rows[dgvclipro.Rows.Count - 1].Cells["Telefono"].Value = _Cuenta.Telefono;

                    }
                    else
                    {
                        MessageBox.Show("La cuenta no a sido guardada, Intente nuevamente.\nDe lo contrario contacte a sus programadores.");
                    }
                }
                if (_Estado == Negocios.FuncionesGlobales.Globales.Modo.Modificar)
                {
                    _Cuenta.Departamento = txtDepartamento.Text;
                    _Cuenta.Domicilio = txtDomicilio.Text;
                    _Cuenta.NroIngresosBrutos = txtIngBrutos.Text;
                    _Cuenta.IdLocalidad = int.Parse(txtCodigoLocalidad.Text);
                    _Cuenta.Mail = txtMail.Text;
                    _Cuenta.Nombre = txtNombre.Text;
                    _Cuenta.NombreFantasia = txtNombreFantasia.Text;
                    _Cuenta.NroDocumento = txtNumeroDoc.Text;
                    _Cuenta.NroDomicilio = int.Parse(txtNumeroDomicilio.Text);
                    _Cuenta.Piso = int.Parse(txtPiso.Text);
                    _Cuenta.Telefono = txtTelefono.Text;
                    _Cuenta.IdCategoriaAfip = int.Parse(cmbCategoriaAFIP.SelectedValue.ToString());
                    _Cuenta.IdTipoDocumento = int.Parse(cmbTipoDoc.SelectedValue.ToString());
                    if (_Cuenta.Actualizar())
                    {
                        MessageBox.Show("El Registro se modifico correctamente");
                    }
                    else
                    {
                        MessageBox.Show("El registro no se ha modificado");
                    }
                }
                Limpiarpantalla();
                btnGuardar.Enabled = false;
                btnCancelar.Enabled = false;
                btnModificar.Enabled = false;
                btnEliminar.Enabled = false;
                Bloqueartxt();
            }
            else
            {
                MessageBox.Show("Revise los campos campos obligatorios");
            }
        }
Example #6
0
        private void dgvclipro_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            Limpiarpantalla();
            int Id = int.Parse(dgvclipro.Rows[e.RowIndex].Cells["id"].Value.ToString());
            _Cuenta = new CuentaN(Id);
            txtDepartamento.Text = _Cuenta.Departamento;
            txtDomicilio.Text = _Cuenta.Domicilio;
            txtId.Text = _Cuenta.Id.ToString();
            txtIngBrutos.Text = _Cuenta.NroIngresosBrutos;
            txtNombreLocalidad.Text = _Cuenta.IdLocalidad.ToString();
            txtCodigoLocalidad.Text = _Cuenta.IdLocalidad.ToString();
            txtMail.Text = _Cuenta.Mail;
            txtNombre.Text = _Cuenta.Nombre;
            txtNombreFantasia.Text = _Cuenta.NombreFantasia;
            txtNumeroDoc.Text = _Cuenta.NroDocumento;
            txtNumeroDomicilio.Text = _Cuenta.NroDomicilio.ToString();
            txtPiso.Text = _Cuenta.Piso.ToString();
            txtTelefono.Text = _Cuenta.Telefono;
            cmbCategoriaAFIP.SelectedValue = _Cuenta.IdCategoriaAfip;
            cmbTipoDoc.SelectedValue = _Cuenta.IdTipoDocumento;
            chkProveedor.Checked = _Cuenta.Proveedor;
            btnModificar.Enabled = true;
            btnEliminar.Enabled = true;
            Bloqueartxt();

        }