예제 #1
0
 protected void OnMultiplicarClicked(object sender, EventArgs e)
 {
     cont_punto = 0;
     valor_a    = Convert.ToDouble(Pantalla.Text);
     Pantalla.DeleteText(0, Pantalla.Text.Length);
     signo = "*";
 }
예제 #2
0
 protected void OnBBorrarClicked(object sender, EventArgs e)
 {
     if (flag == 0)
     {
         Pantalla.DeleteText(Pantalla.Text.Length - 1, Pantalla.Text.Length);
     }
 }
예제 #3
0
 protected void OnBRestarClicked(object sender, EventArgs e)
 {
     a = Convert.ToDouble(this.Pantalla.Text);
     c = "-";
     Pantalla.DeleteText(0, Pantalla.Text.Length);
     flag = 0;
 }
예제 #4
0
 protected void OnBProductoClicked(object sender, EventArgs e)
 {
     num1 = Convert.ToSingle(Pantalla.Text);
     Pantalla.DeleteText(0, Pantalla.Text.Length);
     contador = 0;
     opcion   = 3;
 }
예제 #5
0
파일: MainWindow.cs 프로젝트: antcha19/ed
    //cero
    protected void OnBceroClicked(object sender, EventArgs e)
    {
        String display = Pantalla.Text.ToString();

        Pantalla.DeleteText(0, Pantalla.Text.Length);
        Pantalla.InsertText(display + " 0 ");
    }
예제 #6
0
    protected void OnBIgualClicked(object sender, EventArgs e)
    {
        num2 = Convert.ToSingle(Pantalla.Text);
        String display = Pantalla.Text.ToString();

        Pantalla.DeleteText(0, Pantalla.Text.Length);


        switch (opcion)
        {
        case ("+"):
            resultado          = operacion.suma(num1, num2);
            this.Pantalla.Text = (Convert.ToString(resultado));
            contadorigual++;
            break;

        case ("-"):
            resultado          = operacion.resta(num1, num2);
            this.Pantalla.Text = (Convert.ToString(resultado));
            contadorigual++;
            break;

        case ("*"):
            resultado          = operacion.multiplicacion(num1, num2);
            this.Pantalla.Text = (Convert.ToString(resultado));
            contadorigual++;
            break;

        case ("/"):
            resultado          = operacion.division(num1, num2);
            this.Pantalla.Text = (Convert.ToString(resultado));
            contadorigual++;
            break;
        }
    }
예제 #7
0
파일: MainWindow.cs 프로젝트: antcha19/ed
    //boton suma
    protected void OnBsumaClicked(object sender, EventArgs e)
    {
        numero1 = Convert.ToSingle(Pantalla.Text);

        Pantalla.DeleteText(0, Pantalla.Text.Length);
        contador2 = 0;
        opcion    = "+";
    }
예제 #8
0
    protected void OnBDivisionClicked(object sender, EventArgs e)
    {
        num1 = Convert.ToSingle(Pantalla.Text);
        String display = Pantalla.Text.ToString();

        Pantalla.DeleteText(0, Pantalla.Text.Length);
        opcion = "/";
    }
예제 #9
0
파일: MainWindow.cs 프로젝트: kevinrm8/ed
    protected void OnClickedIgual(object sender, EventArgs e)
    {
        String Display = Pantalla.Text.ToString();

        operando2 = double.Parse(Pantalla.Text);
        Pantalla.DeleteText(0, Pantalla.Text.Length);
        calcula();
        res = true;
    }
예제 #10
0
 protected void OnB9Clicked(object sender, EventArgs e)
 {
     if (flag == 0)
     {
         String Display = Pantalla.Text.ToString();
         Pantalla.DeleteText(0, Pantalla.Text.Length);
         Pantalla.InsertText(Display + "9");
     }
 }
예제 #11
0
파일: MainWindow.cs 프로젝트: antcha19/ed
    //boton resta
    protected void OnBrestaClicked(object sender, EventArgs e)
    {
        numero1 = Convert.ToSingle(Pantalla.Text);
        String display = Pantalla.Text.ToString();

        //Pantalla.InsertText(display + " - ");
        Pantalla.DeleteText(0, Pantalla.Text.Length);
        opcion = "-";
    }
예제 #12
0
파일: MainWindow.cs 프로젝트: kevinrm8/ed
 protected void OnClickedpunto(object sender, EventArgs e)
 {
     if (Pantalla.Text.IndexOf(",") < 0)
     {
         String Display = Pantalla.Text;
         Pantalla.DeleteText(0, Pantalla.Text.Length);
         Pantalla.InsertText(Display + ",");
     }
 }
예제 #13
0
    protected void OnBorrarClicked(object sender, EventArgs e)
    {
        Pantalla.DeleteText(Pantalla.Text.Length - 1, Pantalla.Text.Length);
        string display = Pantalla.Text;

        if (display.Contains("."))

        {
        }
    }
예제 #14
0
    //NUEVE ====================================================//
    protected void OnCnueveClicked(object sender, EventArgs e)
    {
        if (contador_igual == 0)

        {
            String display = Pantalla.Text.ToString();
            Pantalla.DeleteText(0, Pantalla.Text.Length);
            Pantalla.InsertText(display + "9");
        }
    }
예제 #15
0
    //DIVISIÓN
    protected void OnCdividirClicked(object sender, EventArgs e)
    {
        if (contador_igual == 0)

        {
            opcion = 4;
            num1   = Convert.ToSingle(Pantalla.Text);
            Pantalla.DeleteText(0, Pantalla.Text.Length);
        }
    }
예제 #16
0
파일: MainWindow.cs 프로젝트: antcha19/ed
 //boton punto(.)
 protected void OnBpuntoClicked(object sender, EventArgs e)
 {
     if (contador == 0)
     {
         String display = Pantalla.Text.ToString();
         Pantalla.DeleteText(0, Pantalla.Text.Length);
         Pantalla.InsertText(display + ",");
         contador++;
     }
 }
예제 #17
0
파일: MainWindow.cs 프로젝트: antcha19/ed
    //boton  borrar solo un numero
    protected void OnBcClicked(object sender, EventArgs e)
    {
        Pantalla.DeleteText(Pantalla.Text.Length - 1, Pantalla.Text.Length);
        String display = Pantalla.Text.ToString();

        if (display.Contains(","))
        {
            contador = 0;
        }
    }
예제 #18
0
파일: MainWindow.cs 프로젝트: kevinrm8/ed
 protected void OnClickedReset(object sender, EventArgs e)
 {
     if (!Pantalla.Text.Equals(""))
     {
         String Display = Pantalla.Text.ToString();
         Pantalla.DeleteText(0, Pantalla.Text.Length);
         operacion = "";
         operando1 = 0;
         operando2 = 0;
     }
 }
예제 #19
0
파일: MainWindow.cs 프로젝트: kevinrm8/ed
 protected void OnClickedC(object sender, EventArgs e)
 {
     if (res)
     {
     }
     else
     {
         String Display = Pantalla.Text.ToString();
         Pantalla.DeleteText((Pantalla.Text.Length - 1), Pantalla.Text.Length);
     }
 }
예제 #20
0
파일: MainWindow.cs 프로젝트: kevinrm8/ed
 protected void OnClickedSuma(object sender, EventArgs e)
 {
     if (!Pantalla.Text.Equals(""))
     {
         String Display = Pantalla.Text;
         operacion = "+";
         //Pasar el texto a int para poder trabajar con el
         operando1 = double.Parse(Pantalla.Text);
         // Borramos lo que hay en pantalla
         Pantalla.DeleteText(0, Pantalla.Text.Length);
     }
 }
예제 #21
0
    protected void OnNueveClicked(object sender, EventArgs e)
    {
        if (cont_igual == 1)
        {
            Pantalla.DeleteText(0, Pantalla.Text.Length);
            cont_punto = 0;
        }
        cont_igual = 0;
        String display = Pantalla.Text.ToString();

        Pantalla.DeleteText(0, Pantalla.Text.Length);
        Pantalla.InsertText(display + "9");
    }
예제 #22
0
    protected void OnBIgualClicked(object sender, EventArgs e)
    {
        num2 = Convert.ToSingle(Pantalla.Text);
        Pantalla.DeleteText(0, Pantalla.Text.Length);
        contador = 0;

        switch (opcion)
        {
        case 1:
            result = operacion.suma(num1, num2);
            Pantalla.InsertText(Convert.ToString(result));
            contador1++;
            if (result >= 1)
            {
                break;
            }
            break;

        case 2:
            result = operacion.resta(num1, num2);
            Pantalla.InsertText(Convert.ToString(result));
            contador1++;
            if (result >= 1)
            {
                break;
            }
            break;

        case 3:
            result = operacion.producto(num1, num2);
            Pantalla.InsertText(Convert.ToString(result));
            contador1++;
            if (result >= 1)
            {
                break;
            }
            break;

        case 4:
            result = operacion.cociente(num1, num2);
            Pantalla.InsertText(Convert.ToString(result));
            contador1++;
            if (result >= 1)
            {
                break;
            }
            break;
        }
    }
예제 #23
0
파일: MainWindow.cs 프로젝트: kevinrm8/ed
 protected void OnClicked2(object sender, EventArgs e)
 {
     if (res)
     {
         Pantalla.DeleteText(0, Pantalla.Text.Length);
         Pantalla.InsertText("2");
         res = false;
     }
     else
     {
         String Display = Pantalla.Text.ToString();
         Pantalla.DeleteText(0, Pantalla.Text.Length);
         Pantalla.InsertText(Display + "2");
     }
 }
예제 #24
0
파일: MainWindow.cs 프로젝트: antcha19/ed
    //cinco
    protected void OnBcincoClicked(object sender, EventArgs e)
    {
        if (contadorigual == 1)

        {
            Pantalla.DeleteText(0, Pantalla.Text.Length);
        }
        contadorpunto = 0;
        contadorigual = 0;

        String display = Pantalla.Text.ToString();

        Pantalla.DeleteText(0, Pantalla.Text.Length);
        Pantalla.InsertText(display + "5");
    }
예제 #25
0
 protected void OnBPuntoClicked(object sender, EventArgs e)
 {
     if (flag == 0)
     {
         String Display = Pantalla.Text.ToString();
         if (Display.Contains(",") == false)
         {
             if (Display.Equals(""))
             {
                 Pantalla.InsertText("0,");
             }
             else
             {
                 Pantalla.DeleteText(0, Pantalla.Text.Length);
                 Pantalla.InsertText(Display + ",");
             }
         }
     }
 }
예제 #26
0
    //RESULTADO
    protected void OnCigualClicked(object sender, EventArgs e)
    {
        num2 = Convert.ToSingle(Pantalla.Text);
        Pantalla.DeleteText(0, Pantalla.Text.Length);

        if (contador_igual == 0)

        {
            switch (opcion)
            {
            case 1:

                resultado = resultados.suma(num1, num2);
                Pantalla.InsertText(Convert.ToString(resultado));
                contador_igual++;
                break;

            case 2:
                resultado = resultados.resta(num1, num2);
                Pantalla.InsertText(Convert.ToString(resultado));
                contador_igual++;
                break;

            case 3:
                resultado = resultados.multiplicacion(num1, num2);
                Pantalla.InsertText(Convert.ToString(resultado));
                contador_igual++;
                break;

            case 4:
                resultado = resultados.division(num1, num2);
                Pantalla.InsertText(Convert.ToString(resultado));
                contador_igual++;
                break;
            }
        }
        else
        {
            Pantalla.InsertText("↡Vacía para continuar↡");
            contador_igual++;
        }
    }
예제 #27
0
파일: MainWindow.cs 프로젝트: antcha19/ed
    //boton igual
    protected void OnBigualClicked(object sender, EventArgs e)
    {
        numero2 = Convert.ToSingle(Pantalla.Text);
        String display = Pantalla.Text.ToString();

        Pantalla.DeleteText(0, Pantalla.Text.Length);



        switch (opcion)
        {
        case "+":


            result             = resultado.suma(numero1, numero2);
            this.Pantalla.Text = (Convert.ToString(result));
            contadorigual++;
            break;


        case "-":
            result             = resultado.resta(numero1, numero2);
            this.Pantalla.Text = (Convert.ToString(result));
            contadorigual++;
            break;



        case "*":
            result             = resultado.multiplicacion(numero1, numero2);
            this.Pantalla.Text = (Convert.ToString(result));
            contadorigual++;
            break;


        case "/":
            result             = resultado.division(numero1, numero2);
            this.Pantalla.Text = (Convert.ToString(result));
            contadorigual++;
            break;
        }
    }
예제 #28
0
 protected void OnBVaciarClicked(object sender, EventArgs e)
 {
     Pantalla.DeleteText(0, Pantalla.Text.Length);
     flag = 0;
 }
예제 #29
0
 protected void OnBarraClicked(object sender, EventArgs e)
 {
     valor_a = Convert.ToDouble(Pantalla.Text);
     Pantalla.DeleteText(0, Pantalla.Text.Length);
     signo = "/";
 }
예제 #30
0
파일: MainWindow.cs 프로젝트: antcha19/ed
 //Boton vaciar
 protected void OnBvaciarClicked(object sender, EventArgs e)
 {
     Pantalla.DeleteText(0, Pantalla.Text.Length);
     contadorpunto = 0;
 }