Link to home
Start Free TrialLog in
Avatar of avi7
avi7

asked on

Conversion question

Hi, I'm new to c# and am trying to convert this code. Thanks!

If CustAccount() = False Then

Else

If lblRec1.Text <> "" And txtPrice1.Text <> lblAAPrice1.Text Then Call UpdateCost(lblRec1.Text, IIf(txtPrice1.Text = "", 0, txtPrice1.Text), txtRRItem1.Text)

If lblTotalItemNo.Text > 100 Then
...
If txtTax.Text <> lblOldTax.Text Then Call UpdateCost(lblTaxRec.Text, IIf(txtTax.Text = "", 0, txtTax.Text))
End If
End If
...

If IsNumeric(txtTax.Text) = False Then
    txtTax.Text = 0.0
 ElseIf txtTax.Text = "" Then
    txtTax.Text = 0.0
 End If
Avatar of Peter Kwan
Peter Kwan
Flag of Hong Kong image

I don't think it is appropriate to ask many such questions (with some parts repeating previous questions) without taking at a look at the experts' comments to your previous questions. Please take a look and try first.
ASKER CERTIFIED SOLUTION
Avatar of Kalpesh Chhatrala
Kalpesh Chhatrala
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yes, ditto pkwan's comment.

And kalpesh2804, there is no IsNumeric function in C#, unless the programmer defines their own of course, which I don't think is being implied here.
And if u feel u hav got the solution kindly accept the solution and close the question. Tht would help everybody.
Avatar of avi7
avi7

ASKER

This code is still not working(IsNumeric is an old VB function) is there something in C#? Thanks!

if ((IsNumeric(txtTax.Text) == false)) {
        txtTax.Text = 0;
    }
    else if ((txtTax.Text == "")) {
        txtTax.Text = 0;
    }

Read your other questions please...

This question on IsNumeric is answered in the first post (mine) given to your question entitled 'Cannot implicitly convert type 'string' to 'double' '.

Re-asking questions that have already been answered is not a good way to impress people around here. You are just wasting people's time. In fact, this is probably my last post to one of your questions. I'm not trying to be rude, but evidently you need to learn how things work around here, and the impression you are giving is that you are simply trying to take advantage of the help being offered. Please make more of an effort in future.