コード例 #1
0
ファイル: FrmDesconto.cs プロジェクト: agtecnica/waiter_web
        /// <summary>
        /// </summary>
        /// <param name="texto de numeros"></param>

        private void btnDesconto_Click(object sender, EventArgs e)
        {
            Decimal desconto = 0, totalReceber = 0;

            if (Decimal.TryParse(txtDesconto.Text, out desconto))
            {
                _frmFinalizaVenda.lblDescontoValor.Text = desconto.ToString("F");
                _frmFinalizaVenda.CalcularValoresVenda();
                Close();
                Dispose();
            }
            //if (Decimal.TryParse(txtDesconto.Text, out desconto))
            //{
            //    if (this._frmFinalizaVenda.lblTotalReceberValor.Text.Contains("R$"))
            //    {
            //        Decimal.TryParse(this._frmFinalizaVenda.lblTotalReceberValor.Text.Replace("R$", "").Trim(), out totalReceber);
            //    }
            //    else
            //    {
            //        Decimal.TryParse(this._frmFinalizaVenda.lblTotalReceberValor.Text.Trim(), out totalReceber);
            //    }

            //    this._frmFinalizaVenda.lblDescontoValor.Text = desconto.ToString("c");
            //    this._frmFinalizaVenda.lblTotalReceberValor.Text = (totalReceber - desconto).ToString("c");
            //    this._frmFinalizaVenda.lblSaldoRestanteValor.Text = (totalReceber - desconto).ToString("c");
            //    this.Close();
            //    this.Dispose();
            //}
            else
            {
                MessageBox.Show("Informe um valor válido!", "Atenção", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
コード例 #2
0
ファイル: FrmAcrescimo.cs プロジェクト: agtecnica/waiter_web
        private void btnAcrecimo_Click(object sender, EventArgs e)
        {
            Decimal acrescimo = 0, totalReceber = 0;

            if (Decimal.TryParse(txtAcrescimo.Text, out acrescimo))
            {
                _frmFinalizaVenda.lblAcrescimoValor.Text = acrescimo.ToString("F");
                _frmFinalizaVenda.CalcularValoresVenda();
                Close();
                Dispose();
            }
            else
            {
                MessageBox.Show("Informe um valor válido!", "Atenção", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }