I can't understand why this error occurs:
public string GetStatusText(string abc) {
string status = "";
STATUSDTO StatusList = new STATUSDTO();
StatusList.LoadByMasterWayBill(abc);
// this method return List<STATUSDTO>
bool has190s = false;
bool hasother = false;
foreach(V_TMSDetail_STATUSDTO v in StatusList) {
if (v.Status == "190" || v.Status == "191") has190s = true;
else hasother = true;
}
if (has190s && hasother) status = "Partially Submitted";
else if (has190s && !hasother) status = "Submitted";
else if (!has190s && hasother) status = "Not Submitted";
return status;
}
When I compile this program, it gives me this error:
foreach statement cannot operate on variables of type because does not contain a public definition for 'GetEnumerator'
Please help me to fix it.