ukerandi
asked on
if condition
please code below, i need to use code below less if statements, is look not properway or not very professional to use this much If conditions, i belive may be another way .
if (ComplainType == "Total")
{
SqlTotalComplaints = "select count(*) as YearlyTotalComplaint from NumberOfComplaints_YearlyT ots";
}
if (ComplainType == "ManualKit")
{
SqlTotalComplaints = "select count(*) as YearlyTotalComplaint from NumberOfComplaints_YearlyM an
}
if (ComplainType == "iComplaints")
{
SqlTotalComplaints = "select count(*) as YearlyTotalComplaint from NumberOfComplaints_YearlyI com
}
if (ComplainType == "InsComplaints")
{
SqlTotalComplaints = "select count(*) as YearlyTotalComplaint from NumberOfComplaints_YearlyI NS
}
if (ComplainType == "Total")
{
SqlTotalComplaints = "select count(*) as YearlyTotalComplaint from NumberOfComplaints_YearlyT
}
if (ComplainType == "ManualKit")
{
SqlTotalComplaints = "select count(*) as YearlyTotalComplaint from NumberOfComplaints_YearlyM
}
if (ComplainType == "iComplaints")
{
SqlTotalComplaints = "select count(*) as YearlyTotalComplaint from NumberOfComplaints_YearlyI
}
if (ComplainType == "InsComplaints")
{
SqlTotalComplaints = "select count(*) as YearlyTotalComplaint from NumberOfComplaints_YearlyI
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window