Example #1
0
 //Division Method
 private void btnDiv_Click(object sender, EventArgs e)
 {
     if (txtNum1.Text != String.Empty && txtNum2.Text != String.Empty)
     {
         if (txtNum2.Text == "0")
         {
             MessageBox.Show("div By Zero can not be possible!!! Enter another value. ");
         }
         else
         {
             if (IsNumeric(txtNum1.Text) && IsNumeric(txtNum2.Text))
             {
                 ServiceReference1.calCWebServiceSoapClient client = new ServiceReference1.calCWebServiceSoapClient();
                 txtAns.Text = client.div(Convert.ToInt32(txtNum1.Text), Convert.ToInt32(txtNum2.Text)).ToString();
             }
             else
             {
                 MessageBox.Show("Plz, Enter the number only !!");
             }
         }
     }
     else
     {
         MessageBox.Show("Plz, Enter Both the number First !!");
     }
 }
Example #2
0
 //Multiply Method
 private void btnMul_Click(object sender, EventArgs e)
 {
     if (txtNum1.Text != String.Empty && txtNum2.Text != String.Empty)
     {
         if (IsNumeric(txtNum1.Text) && IsNumeric(txtNum2.Text))
         {
             ServiceReference1.calCWebServiceSoapClient client = new ServiceReference1.calCWebServiceSoapClient();
             txtAns.Text = client.mul(Convert.ToInt32(txtNum1.Text), Convert.ToInt32(txtNum2.Text)).ToString();
         }
         else
         {
             MessageBox.Show("Plz, Enter the number only !!");
         }
     }
     else
     {
         MessageBox.Show("Plz, Enter Both the number First !!");
     }
 }