if led_code returns 6, txtAcccountType.Text should be "CURRENT" if led_code returns 102 , txtAccountType.Text should be "SAVINGS" if led_code returns 335, txtAccountType.Text should be "OTHERS"
protected void btnGetAcctDetails_Click(object sender, EventArgs e) { bankacct = new unityws(); try { lblMessage.Text = ""; Ac = new AcctInfo.AccountInfo();// web service that returns the led_code Ac = bankacct.AccountInformation(txtAccountNumber.Text); if (Ac.ResponseCode == "00") { txtClientType.Text = Ac.AcctType.ToString(); if (txtClientType.Text == "1") { txtClientType.Text = "INDV"; } else { txtClientType.Text = "CORP"; } txtBranchName.Text = Ac.Branch.ToString(); txtFullname.Text = Ac.Name.ToString(); txtAcccountType.Text = Ac.AcctDesc.ToString(); AcctType = Ac.led_code.ToString(); //it passes the value into AcctType if (AcctType == "1" || "2")// { txtAcccountType.Text = "CURRENT"; } else if (AcctType == "101" || "165") { txtAcccountType.Text = "SAVINGS"; } else if (AcctType == "331" || "345") { txtAcccountType.Text = "OTHERS"; } } else { lblMessage.CssClass = "alert-warning"; lblMessage.Text = "You have entered an Invalid Account Number"; } } catch { } }
int.Parse()
int num = int.Parse("101"); // string input
if(num > 101 && num < 165) { // if evaluates to true }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)