Beispiel #1
0
 private void BtnCalcular_Click(object sender, EventArgs e)
 {
     lblError.Text = "";
     indice        = (int)numericUpDownIndice.Value;
     if (INumeroComplejo.Equals(radicando, null) || indice <= 0)
     {
         if (INumeroComplejo.Equals(radicando, null))
         {
             lblError.Text = "Ingrese un número complejo válido";
         }
         if (indice <= 0)
         {
             lblError.Text += "ingrese un indice positivo";
         }
         return;
     }
     else
     {
         listBoxResultados.Items.Clear();
         foreach (INumeroComplejo item in OperacionesService.Radicacion(radicando, indice))
         {
             listBoxResultados.Items.Add(item.Show());//
         }
     }
 }
Beispiel #2
0
        public IFasor SumarEnSen(IFasor sumando)
        {
            NumeroComplejoBinomico sumando1  = this.EnSen().EnBinomico();
            NumeroComplejoBinomico sumando2  = sumando.EnSen().EnBinomico();
            INumeroComplejo        resultado = OperacionesService.Sumar(sumando1, sumando2);

            return(new FasorCoseno(resultado.GetModulo(), this.periodo, resultado.GetArgumento()));
        }
 private void BtnCalcular_Click(object sender, EventArgs e)
 {
     if (INumeroComplejo.Equals(numeroComplejo, null))
     {
         lblResultado.Text = "Ingrese un número complejo válido";
     }
     else
     {
         lblResultado.Text = OperacionesService.Potenciacion(numeroComplejo, (int)numericUpDownExponente.Value).Show();
     }
 }
Beispiel #4
0
 private void RaicesPrimitivas_Click(object sender, EventArgs e)
 {
     indice = (int)numericUpDownIndice.Value;
     if (indice <= 0)
     {
         lblError.Text += "ingrese un indice positivo";
         return;
     }
     listBoxResultados.Items.Clear();
     foreach (var item in OperacionesService.RaicesPrimitivasDeLaUnidadReal(indice))
     {
         listBoxResultados.Items.Add(item);
     }
 }
Beispiel #5
0
        static void Main(string[] args)
        {
            OperacionesService operacionesService = new OperacionesService();
            var json = (string)operacionesService.getAllJson();

            operacionesService.addItem("Otritoo");



            Product product = new Product();

            product.ExpiryDate = new DateTime(2008, 12, 28);

            JsonSerializer serializer = new JsonSerializer();

            serializer.Converters.Add(new JavaScriptDateTimeConverter());
            serializer.NullValueHandling = NullValueHandling.Ignore;
        }
Beispiel #6
0
        private void CalcularButton_Click(object sender, EventArgs e)
        {
            if (INumeroComplejo.Equals(operando1, null) || INumeroComplejo.Equals(operando2, null))
            {
                resultadoLabel.Text = "Falta asignar algun operando, asignelo y vuelva a intentar";
            }
            else
            {
                if (SumaButton.Checked)
                {
                    //logica de la suma. en lo posible delegar todas las cuentas a un servicio asi queda limpia esta parte del codigo ?
                    resultado = OperacionesService.Sumar(operando1, operando2);
                }
                if (RestaButton.Checked)
                {
                    //resta
                    resultado = OperacionesService.Resta(operando1, operando2);
                }
                if (MultiplicacionButton.Checked)
                {
                    //multiplicacion
                    resultado = OperacionesService.Multiplicar(operando1, operando2);
                }
                if (DivisionButton.Checked)
                {
                    if (operando2.GetFormaPolar().GetModulo() != 0)
                    {
                        resultado = OperacionesService.Dividir(operando1, operando2);
                    }
                    else
                    {
                        resultadoLabel.Text = "No es posible dividir por cero";
                        return;
                    }
                }

                resultadoLabel.Text = resultado.Show();
            }
        }