Exemple #1
0
        private void BtnCalcular_Click(object sender, EventArgs e)
        {
            if (TxtCant.Text.Trim().Length == 0)
            {
                MessageBox.Show("Ingres calificacion 1");
                TxtCant.Focus();
                return;
            }

            double cant, totalp, precu;

            cant = Convert.ToDouble(TxtCant.Text.Trim());

            if (cant >= 10)
            {
                precu          = 80.00;
                totalp         = cant * precu;
                TxtTotalp.Text = TxtTotalp.Text + totalp;
            }
            else
            {
                precu          = 100.00;
                totalp         = cant * precu;
                TxtTotalp.Text = TxtTotalp.Text + totalp;
            }
        }
        private void button2_Click(object sender, EventArgs e)
        {
            if (TxtDescrip.Text.Trim().Length == 0)
            {
                MessageBox.Show("INGRESE UN DATO");
                TxtDescrip.Focus();
                return;
            }
            if (TxtCant.Text.Trim().Length == 0)
            {
                MessageBox.Show("INGRESE UN DATO");
                TxtCant.Focus();
                return;
            }
            if (TxtPrecu.Text.Trim().Length == 0)
            {
                MessageBox.Show("INGRESE UN DATO");
                TxtPrecu.Focus();
                return;
            }
            cant  = Convert.ToDouble(TxtCant.Text);
            precu = Convert.ToDouble(TxtPrecu.Text);
            LstMostrar.Items.Add(TxtDescrip.Text.Trim());
            LstCatn.Items.Add(TxtCant.Text.Trim());
            LstPrecu.Items.Add(TxtPrecu.Text.Trim());
            LstTotal.Items.Add(cant * precu);

            TxtCant.Clear();
            TxtDescrip.Clear();
            TxtPrecu.Clear();
            TxtDescrip.Focus();
        }
        private void BtnCalcular_Click(object sender, EventArgs e)
        {
            if (TxtCant.Text.Trim().Length == 0)
            {
                MessageBox.Show("Ingrese un dato");
                TxtCant.Focus();
                return;
            }

            if (TxtPrecu.Text.Trim().Length == 0)
            {
                MessageBox.Show("Ingrese un dato");
                TxtPrecu.Focus();
                return;
            }

            double cant, precu, totalp;

            cant  = Convert.ToDouble(TxtCant.Text);
            precu = Convert.ToDouble(TxtPrecu.Text);

            totalp = cant * precu;

            TxtTotalp.Text = totalp.ToString();
        }
 private void BtnLimpiar_Click(object sender, EventArgs e)
 {
     TxtCant.Clear();
     TxtPrecu.Clear();
     TxtTotalp.Clear();
     TxtCant.Focus();
 }
Exemple #5
0
        private void BtnCalcular_Click(object sender, EventArgs e)
        {
            if (TxtCant.Text.Trim().Length == 0)
            {
                MessageBox.Show("Ingrese los datos");
                TxtCant.Focus();
                return;
            }


            if (TxtPrecu.Text.Trim().Length == 0)
            {
                MessageBox.Show("Ingrese los datos");
                TxtPrecu.Focus();
                return;
            }

            double cant, precu, desc, totalp, tp;

            cant  = Convert.ToDouble(TxtCant.Text.Trim());
            precu = Convert.ToDouble(TxtPrecu.Text.Trim());

            totalp = cant * precu;

            if (cant >= 3)
            {
                desc = totalp * 0.2;
            }
            else
            {
                desc = 0;
            }

            tp             = totalp - desc;
            TxtdDesc.Text  = TxtdDesc.Text + desc;
            TxtTotalp.Text = TxtTotalp.Text + tp;
        }
Exemple #6
0
 private void BtnCancelar_Click(object sender, EventArgs e)
 {
     TxtCant.Clear();
     TxtTotalp.Clear();
     TxtCant.Focus();
 }