private void btnAdd_Click(object sender, EventArgs e)
        {
            CnfCotizacionDetalle obj = bList.SingleOrDefault(p => p.id_moneda == _moneda.id);

            if (obj == null)
            {
                bList.Insert(0, new CnfCotizacionDetalle
                {
                    id             = "0",
                    id_cotizacion  = one.id,
                    id_moneda      = _moneda.id,
                    last_update    = 0,
                    moneda_descrip = _moneda.descrip,
                    moneda_nombre  = _moneda.nombre,
                    order_id       = 0,
                    valor          = Convert.ToDouble(txtValorActual.Text),
                    valor_anterior = 0
                });
            }
            else
            {
                MessageBox.Show("La moneda seleccionada ya se encuentra en la lista");
            }

            txtValorActual.Text = "0,00";

            bntDel.Visible  = false;
            btnSave.Visible = false;
            if (bList.Count > 0)
            {
                bntDel.Visible  = true;
                btnSave.Visible = true;
            }
        }
示例#2
0
 private void cmbCotizacion_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (cmbCotizacion.SelectedIndex > -1)
     {
         _oneCotizacion          = Globals.cotizacion[cmbCotizacion.SelectedIndex];
         factor                  = Globals.cotizacion[cmbCotizacion.SelectedIndex].valor;
         Globals.valorCotizacion = factor;
         Console.WriteLine("Factor: " + factor);
         Totalizar();
     }
 }
        private void bntDel_Click(object sender, EventArgs e)
        {
            if (dgvList.RowCount > 0)
            {
                string item = dgvList[dgvList.CurrentCell.ColumnIndex, dgvList.CurrentCell.RowIndex].Value.ToString();
                if (item != null && dgvList.CurrentCell.ColumnIndex != 0)
                {
                    CnfCotizacionDetalle obj = (CnfCotizacionDetalle)dgvList.CurrentRow.DataBoundItem;
                    bList.Remove(obj);
                    //lblTotal.Text = Totalizar().ToString("N2", Globals.nfiVE);
                }
            }

            btnSave.Visible = false;
            bntDel.Visible  = false;
            if (bList.Count > 0)
            {
                bntDel.Visible  = true;
                btnSave.Visible = true;
            }
        }
示例#4
0
        //CONSTRUCTOR
        public frmPuntoVenta()
        {
            InitializeComponent();
            Globals.appParentWindow = this;

            //APP PATH
            string appPath = Application.StartupPath;

            Console.WriteLine("appPath: " + appPath);

            //READ CONFIG


            //Console.WriteLine("puerto COM: " + puertoCOM);

            Globals.cotizacion = srvCotizacion.GetLast(Globals.logEmpresa.id);
            _listaOperaciones  = srvOperacion.GetList("11E7C39A0EACD9A08F1A00E04C6F7E24");
            foreach (CnfCotizacionDetalle item in Globals.cotizacion)
            {
                if (item.id_moneda == Globals.logEmpresa.moneda_defecto)
                {
                    Globals.valorCotizacion = item.valor;
                    _oneCotizacion          = item;
                }
            }

            factor = Globals.valorCotizacion;

            CheckImpresoraFiscal();

            InicializarOperacion();

            this.KeyPreview = true;
            this.KeyDown   +=
                new KeyEventHandler(frmPuntoVenta_KeyDown);
        }